X-Git-Url: https://git1-us-west.apache.org/repos/asf?p=commons-math.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Forg%2Fapache%2Fcommons%2Fmath3%2Fml%2Fneuralnet%2Fsofm%2FKohonenUpdateActionTest.java;h=b209d56b8651eb6e7bbfca10ad9bdb1802fb24f3;hp=334a5a8ebbbd011aa7d10bebbc5478df5f82becc;hb=a9006aa;hpb=838788fd6302d6cc91e1743144e0f14b71e4812e diff --git a/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java b/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java index 334a5a8..b209d56 100644 --- a/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java +++ b/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java @@ -17,18 +17,19 @@ package org.apache.commons.math3.ml.neuralnet.sofm; -import org.apache.commons.math3.ml.neuralnet.Neuron; -import org.apache.commons.math3.ml.neuralnet.Network; -import org.apache.commons.math3.ml.neuralnet.MapUtils; -import org.apache.commons.math3.ml.neuralnet.UpdateAction; -import org.apache.commons.math3.ml.neuralnet.OffsetFeatureInitializer; -import org.apache.commons.math3.ml.neuralnet.FeatureInitializer; -import org.apache.commons.math3.ml.neuralnet.FeatureInitializerFactory; import org.apache.commons.math3.ml.distance.DistanceMeasure; import org.apache.commons.math3.ml.distance.EuclideanDistance; +import org.apache.commons.math3.ml.neuralnet.FeatureInitializer; +import org.apache.commons.math3.ml.neuralnet.FeatureInitializerFactory; +import org.apache.commons.math3.ml.neuralnet.MapUtils; +import org.apache.commons.math3.ml.neuralnet.Network; +import org.apache.commons.math3.ml.neuralnet.Neuron; +import org.apache.commons.math3.ml.neuralnet.OffsetFeatureInitializer; +import org.apache.commons.math3.ml.neuralnet.UpdateAction; import org.apache.commons.math3.ml.neuralnet.oned.NeuronString; -import org.junit.Test; +import org.apache.commons.math3.util.Precision; import org.junit.Assert; +import org.junit.Test; /** * Tests for {@link KohonenUpdateAction} class. @@ -82,7 +83,7 @@ public class KohonenUpdateActionTest { Assert.assertEquals(bestBefore, bestAfter); // Distance is now zero. - Assert.assertEquals(0, dist.compute(bestAfter.getFeatures(), features), 0d); + Assert.assertEquals(0, dist.compute(bestAfter.getFeatures(), features), Precision.EPSILON); for (int i = 0; i < netSize; i++) { // All distances have decreased.