You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2016/01/07 20:55:22 UTC
[math] Avoid transient test failure; reorder imports.
Repository: commons-math
Updated Branches:
refs/heads/MATH_3_X 838788fd6 -> a9006aa8b
Avoid transient test failure; reorder imports.
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/a9006aa8
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/a9006aa8
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/a9006aa8
Branch: refs/heads/MATH_3_X
Commit: a9006aa8b91712fcfcac157d5d1300758cd07efb
Parents: 838788f
Author: Phil Steitz <ph...@gmail.com>
Authored: Thu Jan 7 12:55:15 2016 -0700
Committer: Phil Steitz <ph...@gmail.com>
Committed: Thu Jan 7 12:55:15 2016 -0700
----------------------------------------------------------------------
.../neuralnet/sofm/KohonenUpdateActionTest.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-math/blob/a9006aa8/src/test/java/org/apache/commons/math3/ml/neuralnet/sofm/KohonenUpdateActionTest.java
----------------------------------------------------------------------
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.