@@ -0,0 +1,1279 @@
+/*%0A * This file is part of COMPASS. It is subject to the license terms in%0A * the LICENSE file found in the top-level directory of this distribution.%0A * (Also available at http://www.apache.org/licenses/LICENSE-2.0.txt)%0A * You may not use this file except in compliance with the License.%0A */%0Apackage de.dfki.asr.compass.test.matcher;%0A%0Aimport de.dfki.asr.compass.math.Quat4f;%0Aimport org.hamcrest.Description;%0Aimport org.hamcrest.TypeSafeMatcher;%0A%0Apublic class Quat4fSimilarity extends TypeSafeMatcher%3CQuat4f%3E %7B%0A%09private final Quat4f template;%0A%09private final float epsilon;%0A%0A%09public Quat4fSimilarity(final Quat4f template, final float epsilon) %7B%0A%09%09this.template = template;%0A%09%09this.epsilon = epsilon;%0A%09%7D%0A%0A%09@Override%0A%09protected boolean matchesSafely(final Quat4f t) %7B%0A%09%09return t.epsilonEquals(template, epsilon);%0A%09%7D%0A%0A%09@Override%0A%09public void describeTo(final Description d) %7B%0A%09%09d.appendText(%22similar value to %22);%0A%09%09d.appendValue(template);%0A%09%09d.appendText(%22 (error of %22);%0A%09%09d.appendValue(epsilon);%0A%09%09d.appendText(%22)%22);%0A%09%7D%0A%0A%09public static Quat4fSimilarity similarTo(final Quat4f template, final float epsilon) %7B%0A%09%09return new Quat4fSimilarity(template, epsilon);%0A%09%7D%0A%0A%09public static Quat4fSimilarity similarTo(final Quat4f template) %7B%0A%09%09return new Quat4fSimilarity(template, 0.001f);%0A%09%7D%0A%7D%0A

Add Quat4fSimilarity matcher