http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java b/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java index 03409de..45e2a2b 100644 --- a/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java +++ b/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java @@ -49,20 +49,20 @@ public class UniformCrossoverTest { public void testRatioTooLow() { new UniformCrossover<Integer>(-0.5d); } - + @Test(expected = OutOfRangeException.class) public void testRatioTooHigh() { new UniformCrossover<Integer>(1.5d); } - + @Test public void testCrossover() { // test crossover with different ratios performCrossover(0.5); performCrossover(0.7); - performCrossover(0.2); + performCrossover(0.2); } - + private void performCrossover(double ratio) { final DummyBinaryChromosome p1c = new DummyBinaryChromosome(p1); final DummyBinaryChromosome p2c = new DummyBinaryChromosome(p2); @@ -107,7 +107,7 @@ public class UniformCrossoverTest { Assert.assertEquals(1.0 - ratio, (double) from2 / LEN, 0.1); } } - + @Test(expected = DimensionMismatchException.class) public void testCrossoverDimensionMismatchException(){ @SuppressWarnings("boxing") @@ -121,7 +121,7 @@ public class UniformCrossoverTest { final CrossoverPolicy cp = new UniformCrossover<Integer>(0.5d); cp.crossover(p1c, p2c); } - + @Test(expected = MathIllegalArgumentException.class) public void testCrossoverInvalidFixedLengthChromosomeFirst() { @SuppressWarnings("boxing") @@ -137,7 +137,7 @@ public class UniformCrossoverTest { final CrossoverPolicy cp = new UniformCrossover<Integer>(0.5d); cp.crossover(p1c, p2c); } - + @Test(expected = MathIllegalArgumentException.class) public void testCrossoverInvalidFixedLengthChromosomeSecond() { @SuppressWarnings("boxing")
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java index d59850f..24e5515 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java @@ -488,7 +488,7 @@ public class FieldVector3DTest { Assert.assertEquals(FastMath.PI / 2, createVector(0, 1, 0, 3).getAlpha().getReal(), 1.0e-10); Assert.assertEquals(0, createVector(0, 1, 0, 3).getDelta().getReal(), 1.0e-10); Assert.assertEquals(FastMath.PI / 2, createVector(0, 0, 1, 3).getDelta().getReal(), 1.0e-10); - + FieldVector3D<DerivativeStructure> u = createVector(-1, 1, -1, 3); Assert.assertEquals(3 * FastMath.PI /4, u.getAlpha().getReal(), 1.0e-10); Assert.assertEquals(-1.0 / FastMath.sqrt(3), u.getDelta().sin().getReal(), 1.0e-10); @@ -634,8 +634,8 @@ public class FieldVector3DTest { final FieldVector3D<DerivativeStructure> u2 = createVector( 1796571811118507.0 / 2147483648.0, 7853468008299307.0 / 2147483648.0, 2599586637357461.0 / 17179869184.0, 3); - final FieldVector3D<DerivativeStructure> u3 = createVector(12753243807587107.0 / 18446744073709551616.0, - -2313766922703915.0 / 18446744073709551616.0, + final FieldVector3D<DerivativeStructure> u3 = createVector(12753243807587107.0 / 18446744073709551616.0, + -2313766922703915.0 / 18446744073709551616.0, -227970081415313.0 / 288230376151711744.0, 3); FieldVector3D<DerivativeStructure> cNaive = new FieldVector3D<DerivativeStructure>(u1.getY().multiply(u2.getZ()).subtract(u1.getZ().multiply(u2.getY())), u1.getZ().multiply(u2.getX()).subtract(u1.getX().multiply(u2.getZ())), http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java index 66418bd..ad03bfa 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java @@ -131,7 +131,7 @@ public class LineTest { @Test public void testRevert() { - + // setup Line line = new Line(new Vector3D(1653345.6696423641, 6170370.041579291, 90000), new Vector3D(1650757.5050732433, 6160710.879908984, 0.9), http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java index 8d4b003..5630f34 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java @@ -258,20 +258,20 @@ public class PolyhedronsSetTest { @Test public void testIssue780() throws MathArithmeticException { float[] coords = { - 1.000000f, -1.000000f, -1.000000f, - 1.000000f, -1.000000f, 1.000000f, - -1.000000f, -1.000000f, 1.000000f, - -1.000000f, -1.000000f, -1.000000f, - 1.000000f, 1.000000f, -1f, - 0.999999f, 1.000000f, 1.000000f, // 1.000000f, 1.000000f, 1.000000f, - -1.000000f, 1.000000f, 1.000000f, + 1.000000f, -1.000000f, -1.000000f, + 1.000000f, -1.000000f, 1.000000f, + -1.000000f, -1.000000f, 1.000000f, + -1.000000f, -1.000000f, -1.000000f, + 1.000000f, 1.000000f, -1f, + 0.999999f, 1.000000f, 1.000000f, // 1.000000f, 1.000000f, 1.000000f, + -1.000000f, 1.000000f, 1.000000f, -1.000000f, 1.000000f, -1.000000f}; int[] indices = { - 0, 1, 2, 0, 2, 3, - 4, 7, 6, 4, 6, 5, - 0, 4, 5, 0, 5, 1, - 1, 5, 6, 1, 6, 2, - 2, 6, 7, 2, 7, 3, + 0, 1, 2, 0, 2, 3, + 4, 7, 6, 4, 6, 5, + 0, 4, 5, 0, 5, 1, + 1, 5, 6, 1, 6, 2, + 2, 6, 7, 2, 7, 3, 4, 0, 3, 4, 3, 7}; ArrayList<SubHyperplane<Euclidean3D>> subHyperplaneList = new ArrayList<SubHyperplane<Euclidean3D>>(); for (int idx = 0; idx < indices.length; idx += 3) { http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java index 0320175..6739625 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java @@ -539,7 +539,7 @@ public class RotationTest { Assert.assertEquals(1.0, q2, 1.0e-14); Assert.assertEquals(0.0, Vector3D.angle(v1, quat.applyTo(u1)), 1.0e-14); Assert.assertEquals(0.0, Vector3D.angle(v2, quat.applyTo(u2)), 1.0e-14); - + } private void checkVector(Vector3D v1, Vector3D v2) { http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java index deb0cc3..5fdc4f6 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java @@ -151,7 +151,7 @@ public class SphereGeneratorTest { Assert.assertEquals(0.0, refCenter.distance(sphere.getCenter()), 4e-7 * refRadius); Assert.assertEquals(refRadius, sphere.getRadius(), 1e-7 * refRadius); } - + } @Test http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java index b1d4e68..48e5fca 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java @@ -98,7 +98,7 @@ public class SphericalCoordinatesTest { cvalue.getPartialDerivative(0, 0, 1)); Vector3D testCGradient = new Vector3D(sc.toCartesianGradient(sGradient)); - + Assert.assertEquals(0, testCGradient.distance(refCGradient) / refCGradient.getNorm(), 5.0e-14); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java index a2509fa..2c2b17d 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java @@ -156,7 +156,7 @@ public class SubLineTest { Assert.assertNull(sub1.intersection(sub2, true)); Assert.assertNull(sub1.intersection(sub2, false)); } - + @Test public void testIntersectionNotIntersecting() throws MathIllegalArgumentException { SubLine sub1 = new SubLine(new Vector3D(1, 1, 1), new Vector3D(1.5, 1, 1), 1.0e-10); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java index d53a0f5..41b0e3a 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java @@ -260,7 +260,7 @@ public class Vector3DTest { Assert.assertEquals(0, Vector3D.PLUS_J.getDelta(), 1.0e-10); Assert.assertEquals(0, Vector3D.PLUS_K.getAlpha(), 1.0e-10); Assert.assertEquals(FastMath.PI / 2, Vector3D.PLUS_K.getDelta(), 1.0e-10); - + Vector3D u = new Vector3D(-1, 1, -1); Assert.assertEquals(3 * FastMath.PI /4, u.getAlpha(), 1.0e-10); Assert.assertEquals(-1.0 / FastMath.sqrt(3), FastMath.sin(u.getDelta()), 1.0e-10); @@ -377,8 +377,8 @@ public class Vector3DTest { final Vector3D u2 = new Vector3D( 1796571811118507.0 / 2147483648.0, 7853468008299307.0 / 2147483648.0, 2599586637357461.0 / 17179869184.0); - final Vector3D u3 = new Vector3D(12753243807587107.0 / 18446744073709551616.0, - -2313766922703915.0 / 18446744073709551616.0, + final Vector3D u3 = new Vector3D(12753243807587107.0 / 18446744073709551616.0, + -2313766922703915.0 / 18446744073709551616.0, -227970081415313.0 / 288230376151711744.0); Vector3D cNaive = new Vector3D(u1.getY() * u2.getZ() - u1.getZ() * u2.getY(), u1.getZ() * u2.getX() - u1.getX() * u2.getZ(), http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java index f26d467..5ca9295 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java @@ -116,6 +116,6 @@ public class DiskGeneratorTest { Assert.assertEquals(0.0, refCenter.distance(disk.getCenter()), 3e-9 * refRadius); Assert.assertEquals(refRadius, disk.getRadius(), 7e-10 * refRadius); } - + } } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java index 34f10c2..28b5eda 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java @@ -226,7 +226,7 @@ public class PolygonsSetTest { Assert.assertEquals(3.0, p.getY(), 1.0e-10); Assert.assertEquals(+v.distance(new Vector2D(3, 3)), projection.getOffset(), 1.0e-10); } - + } } @@ -1108,15 +1108,15 @@ public class PolygonsSetTest { public void testIssue1162() { PolygonsSet p = new PolygonsSet(1.0e-10, new Vector2D(4.267199999996532, -11.928637756014894), - new Vector2D(4.267200000026445, -14.12360595809307), - new Vector2D(9.144000000273694, -14.12360595809307), + new Vector2D(4.267200000026445, -14.12360595809307), + new Vector2D(9.144000000273694, -14.12360595809307), new Vector2D(9.144000000233383, -11.928637756020067)); PolygonsSet w = new PolygonsSet(1.0e-10, new Vector2D(2.56735636510452512E-9, -11.933116461089332), - new Vector2D(2.56735636510452512E-9, -12.393225665247766), - new Vector2D(2.56735636510452512E-9, -27.785625665247778), - new Vector2D(4.267200000030211, -27.785625665247778), + new Vector2D(2.56735636510452512E-9, -12.393225665247766), + new Vector2D(2.56735636510452512E-9, -27.785625665247778), + new Vector2D(4.267200000030211, -27.785625665247778), new Vector2D(4.267200000030211, -11.933116461089332)); Assert.assertFalse(p.contains(w)); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java index 255324a..ef2c0f7 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java @@ -28,13 +28,13 @@ public class Vector2DTest { Vector2D p1 = new Vector2D(1, 1); Vector2D p2 = new Vector2D(2, 2); - + Vector2D p3 = new Vector2D(3, 3); Assert.assertEquals(0.0, p3.crossProduct(p1, p2), epsilon); - + Vector2D p4 = new Vector2D(1, 2); Assert.assertEquals(1.0, p4.crossProduct(p1, p2), epsilon); - + Vector2D p5 = new Vector2D(2, 1); Assert.assertEquals(-1.0, p5.crossProduct(p1, p2), epsilon); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java index 5b3f8ae..717b264 100644 --- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java @@ -40,7 +40,7 @@ import org.junit.Test; /** * Abstract base test class for 2D convex hull generators. - * + * */ public abstract class ConvexHullGenerator2DAbstractTest { @@ -67,7 +67,7 @@ public abstract class ConvexHullGenerator2DAbstractTest { public void testNullArgument() { generator.generate(null); } - + @Test public void testEmpty() { ConvexHull2D hull = generator.generate(Collections.<Vector2D>emptyList()); @@ -246,9 +246,9 @@ public abstract class ConvexHullGenerator2DAbstractTest { hull = createConvexHullGenerator(true).generate(points); checkConvexHull(points, hull, true); - + points.clear(); - + // second case: multiple points are collinear points.add(new Vector2D(0, -29.959696875)); points.add(new Vector2D(0, -31.621809375)); @@ -327,7 +327,7 @@ public abstract class ConvexHullGenerator2DAbstractTest { points.add(new Vector2D(line[0], line[1])); } - Vector2D[] referenceHull = new Vector2D[] { + Vector2D[] referenceHull = new Vector2D[] { new Vector2D(-11.0, -1.0), new Vector2D(-10.0, -3.0), new Vector2D( -6.0, -7.0), @@ -364,7 +364,7 @@ public abstract class ConvexHullGenerator2DAbstractTest { } // ------------------------------------------------------------------------------ - + protected final List<Vector2D> createRandomPoints(int size) { // create the cloud container List<Vector2D> points = new ArrayList<Vector2D>(size); @@ -419,13 +419,13 @@ public abstract class ConvexHullGenerator2DAbstractTest { return false; } } - + sign = cmp; } - + return true; } - + // verify that all points are inside the convex hull region protected final void checkPointsInsideHullRegion(final Collection<Vector2D> points, final ConvexHull2D hull, http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java index ecad646..e6934b1 100644 --- a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java +++ b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java @@ -96,7 +96,7 @@ public class CircleTest { Assert.assertEquals(circle.getPhase(p), circle.getPhase(samePhase), 1.0e-10); Assert.assertEquals(0.0, circle.getPhase(circle.getXAxis()), 1.0e-10); Assert.assertEquals(0.5 * FastMath.PI, circle.getPhase(circle.getYAxis()), 1.0e-10); - + } @Test @@ -129,7 +129,7 @@ public class CircleTest { Assert.assertEquals(0.0, circle.getOffset(new S2Point(Vector3D.MINUS_J)), 1.0e-10); Assert.assertEquals(-0.5 * FastMath.PI, circle.getOffset(new S2Point(Vector3D.PLUS_K)), 1.0e-10); Assert.assertEquals( 0.5 * FastMath.PI, circle.getOffset(new S2Point(Vector3D.MINUS_K)), 1.0e-10); - + } @Test http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java b/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java index cd703f5..fb41169 100644 --- a/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java +++ b/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java @@ -129,14 +129,14 @@ public class DiagonalMatrixTest { Assert.assertEquals(0d, out[i][j], 0d); } } - } + } } @Test public void testAdd() { final double[] data1 = { -1.2, 3.4, 5 }; final DiagonalMatrix m1 = new DiagonalMatrix(data1); - + final double[] data2 = { 10.1, 2.3, 45 }; final DiagonalMatrix m2 = new DiagonalMatrix(data2); @@ -157,7 +157,7 @@ public class DiagonalMatrixTest { public void testSubtract() { final double[] data1 = { -1.2, 3.4, 5 }; final DiagonalMatrix m1 = new DiagonalMatrix(data1); - + final double[] data2 = { 10.1, 2.3, 45 }; final DiagonalMatrix m2 = new DiagonalMatrix(data2); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java index cf86a4c..fba9e90 100644 --- a/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java +++ b/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java @@ -335,7 +335,7 @@ public class EigenDecompositionTest { EigenDecomposition ed; ed = new EigenDecomposition(symmetric); - + RealMatrix d = ed.getD(); RealMatrix v = ed.getV(); RealMatrix vT = ed.getVT(); @@ -401,7 +401,7 @@ public class EigenDecompositionTest { { 27.0, 9.0, 3.0, 1.0 }, { 64.0, 16.0, 4.0, 1.0 } }; checkUnsymmetricMatrix(MatrixUtils.createRealMatrix(vData)); - + RealMatrix randMatrix = MatrixUtils.createRealMatrix(new double[][] { {0, 1, 0, 0}, {1, 0, 2.e-7, 0}, @@ -421,7 +421,7 @@ public class EigenDecompositionTest { }; checkUnsymmetricMatrix(MatrixUtils.createRealMatrix(randData2)); } - + @Test @Ignore public void testRandomUnsymmetricMatrix() { @@ -440,12 +440,12 @@ public class EigenDecompositionTest { RealMatrix m = MatrixUtils.createRealMatrix(data); checkUnsymmetricMatrix(m); - } + } } /** * Tests the porting of a bugfix in Jama-1.0.3 (from changelog): - * + * * Patched hqr2 method in Jama.EigenvalueDecomposition to avoid infinite loop; * Thanks Frederic Devernay <frederic.dever...@m4x.org> */ @@ -458,7 +458,7 @@ public class EigenDecompositionTest { {1,1,0,0,1}, {1,0,1,0,1} }; - + RealMatrix m = MatrixUtils.createRealMatrix(data); checkUnsymmetricMatrix(m); } @@ -484,7 +484,7 @@ public class EigenDecompositionTest { checkUnsymmetricMatrix(m); } } - + @Test public void testMath848() { double[][] data = { @@ -507,18 +507,18 @@ public class EigenDecompositionTest { private void checkUnsymmetricMatrix(final RealMatrix m) { try { EigenDecomposition ed = new EigenDecomposition(m); - + RealMatrix d = ed.getD(); RealMatrix v = ed.getV(); //RealMatrix vT = ed.getVT(); RealMatrix x = m.multiply(v); RealMatrix y = v.multiply(d); - + double diffNorm = x.subtract(y).getNorm(); Assert.assertTrue("The norm of (X-Y) is too large: " + diffNorm + ", matrix=" + m.toString(), x.subtract(y).getNorm() < 1000 * Precision.EPSILON * FastMath.max(x.getNorm(), y.getNorm())); - + RealMatrix invV = new LUDecomposition(v).getSolver().getInverse(); double norm = v.multiply(d).multiply(invV).subtract(m).getNorm(); Assert.assertEquals(0.0, norm, 1.0e-10); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java b/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java index 75e3af6..310f23d 100644 --- a/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java +++ b/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java @@ -167,17 +167,17 @@ public class HessenbergTransformerTest { /////////////////////////////////////////////////////////////////////////// // Test helpers /////////////////////////////////////////////////////////////////////////// - + private RealMatrix checkAEqualPHPt(RealMatrix matrix) { HessenbergTransformer transformer = new HessenbergTransformer(matrix); RealMatrix p = transformer.getP(); RealMatrix pT = transformer.getPT(); RealMatrix h = transformer.getH(); - + RealMatrix result = p.multiply(h).multiply(pT); double norm = result.subtract(matrix).getNorm(); Assert.assertEquals(0, norm, 1.0e-10); - + for (int i = 0; i < matrix.getRowDimension(); ++i) { for (int j = 0; j < matrix.getColumnDimension(); ++j) { if (i > j + 1) { @@ -185,7 +185,7 @@ public class HessenbergTransformerTest { } } } - + return transformer.getH(); } @@ -206,7 +206,7 @@ public class HessenbergTransformerTest { } } } - + private void checkMatricesValues(double[][] matrix, double[][] pRef, double[][] hRef) { HessenbergTransformer transformer = new HessenbergTransformer(MatrixUtils.createRealMatrix(matrix)); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java b/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java index e22e5ff..7fbd12d 100644 --- a/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java +++ b/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java @@ -22,7 +22,7 @@ import org.junit.Test; /** * Test for {@link MatrixDimensionMismatchException}. - * + * */ public class MatrixDimensionMismatchExceptionTest { @Test http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java b/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java index 9d80d3a..b547cdc 100644 --- a/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java +++ b/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java @@ -315,8 +315,8 @@ public final class MatrixUtilsTest { } return d; } - - @Test + + @Test public void testSolveLowerTriangularSystem(){ RealMatrix rm = new Array2DRowRealMatrix( new double[][] { {2,0,0,0 }, { 1,1,0,0 }, { 3,3,3,0 }, { 3,3,3,4 } }, @@ -325,8 +325,8 @@ public final class MatrixUtilsTest { MatrixUtils.solveLowerTriangularSystem(rm, b); TestUtils.assertEquals( new double[]{1,2,-1.66666666666667, 1.0} , b.toArray() , 1.0e-12); } - - + + /* * Taken from R manual http://stat.ethz.ch/R-manual/R-patched/library/base/html/backsolve.html */ @@ -449,7 +449,7 @@ public final class MatrixUtilsTest { }; MatrixUtils.checkSymmetric(MatrixUtils.createRealMatrix(dataSym), Math.ulp(1d)); } - + @Test(expected=NonSymmetricMatrixException.class) public void testCheckSymmetric2() { final double[][] dataNonSym = { @@ -459,19 +459,19 @@ public final class MatrixUtilsTest { }; MatrixUtils.checkSymmetric(MatrixUtils.createRealMatrix(dataNonSym), Math.ulp(1d)); } - + @Test(expected=SingularMatrixException.class) public void testInverseSingular() { RealMatrix m = MatrixUtils.createRealMatrix(testData3x3Singular); MatrixUtils.inverse(m); } - + @Test(expected=NonSquareMatrixException.class) public void testInverseNonSquare() { RealMatrix m = MatrixUtils.createRealMatrix(testData3x4); MatrixUtils.inverse(m); } - + @Test public void testInverseDiagonalMatrix() { final double[] data = { 1, 2, 3 }; http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java index e501f1d..6b62df5 100644 --- a/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java +++ b/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java @@ -281,7 +281,7 @@ public class QRDecompositionTest { }); return m; } - + @Test(expected=SingularMatrixException.class) public void testQRSingular() { final RealMatrix a = MatrixUtils.createRealMatrix(new double[][] { http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java b/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java index eb91c45..6dbd956 100644 --- a/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java +++ b/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java @@ -127,10 +127,10 @@ public class RRQRSolverTest { { 1, 2515 }, { 2, 422 }, { -3, 898 } }); - + RRQRDecomposition decomposition = new RRQRDecomposition(MatrixUtils.createRealMatrix(testData3x3NonSingular)); DecompositionSolver solver = decomposition.getSolver(); - + // using RealMatrix Assert.assertEquals(0, solver.solve(b).subtract(xRef).getNorm(), 3.0e-16 * xRef.getNorm()); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java index 42e2f2d..e1a6eb6 100644 --- a/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java +++ b/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java @@ -105,7 +105,7 @@ public class RectangularCholeskyDecompositionTest { composeAndTest(m3, 4); } - + private void composeAndTest(RealMatrix m, int expectedRank) { RectangularCholeskyDecomposition r = new RectangularCholeskyDecomposition(m); Assert.assertEquals(expectedRank, r.getRank()); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java b/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java index 4c645fb..e0a5611 100644 --- a/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java +++ b/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java @@ -74,7 +74,7 @@ public class SchurTransformerTest { public void testPOrthogonal() { checkOrthogonal(new SchurTransformer(MatrixUtils.createRealMatrix(testSquare5)).getP()); checkOrthogonal(new SchurTransformer(MatrixUtils.createRealMatrix(testSquare3)).getP()); - checkOrthogonal(new SchurTransformer(MatrixUtils.createRealMatrix(testRandom)).getP()); + checkOrthogonal(new SchurTransformer(MatrixUtils.createRealMatrix(testRandom)).getP()); } @Test @@ -159,12 +159,12 @@ public class SchurTransformerTest { RealMatrix p = transformer.getP(); RealMatrix t = transformer.getT(); RealMatrix pT = transformer.getPT(); - + RealMatrix result = p.multiply(t).multiply(pT); double norm = result.subtract(matrix).getNorm(); Assert.assertEquals(0, norm, 1.0e-9); - + return t; } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java index 06e28c9..0820fbc 100644 --- a/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java +++ b/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java @@ -149,19 +149,19 @@ public class DBSCANClustererTest { new DoublePoint(new int[] {14, 8}), // C new DoublePoint(new int[] {7, 15}), // N - Noise, should not be present new DoublePoint(new int[] {17, 8}), // D - single-link connected to C should not be present - + }; - + final DBSCANClusterer<DoublePoint> clusterer = new DBSCANClusterer<DoublePoint>(3, 3); List<Cluster<DoublePoint>> clusters = clusterer.cluster(Arrays.asList(points)); - + Assert.assertEquals(1, clusters.size()); - + final List<DoublePoint> clusterOne = Arrays.asList(points[0], points[1], points[2], points[3], points[4], points[5], points[6], points[7]); Assert.assertTrue(clusters.get(0).getPoints().containsAll(clusterOne)); } - + @Test public void testGetEps() { final DBSCANClusterer<DoublePoint> transformer = new DBSCANClusterer<DoublePoint>(2.0, 5); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java index 31d4288..39ef2c5 100644 --- a/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java +++ b/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java @@ -41,7 +41,7 @@ public class KMeansPlusPlusClustererTest { @Before public void setUp() { random = new JDKRandomGenerator(); - random.setSeed(1746432956321l); + random.setSeed(1746432956321l); } /** @@ -156,7 +156,7 @@ public class KMeansPlusPlusClustererTest { final int NUM_CLUSTERS = 2; final int NUM_ITERATIONS = 0; random.setSeed(RANDOM_SEED); - + KMeansPlusPlusClusterer<DoublePoint> clusterer = new KMeansPlusPlusClusterer<DoublePoint>(NUM_CLUSTERS, NUM_ITERATIONS, new CloseDistance(), random); @@ -171,15 +171,15 @@ public class KMeansPlusPlusClustererTest { } Assert.assertTrue(uniquePointIsCenter); } - + /** * 2 variables cannot be clustered into 3 clusters. See issue MATH-436. */ @Test(expected=NumberIsTooSmallException.class) public void testPerformClusterAnalysisToManyClusters() { - KMeansPlusPlusClusterer<DoublePoint> transformer = + KMeansPlusPlusClusterer<DoublePoint> transformer = new KMeansPlusPlusClusterer<DoublePoint>(3, 1, new EuclideanDistance(), random); - + DoublePoint[] points = new DoublePoint[] { new DoublePoint(new int[] { 1959, 325100 @@ -187,7 +187,7 @@ public class KMeansPlusPlusClustererTest { 1960, 373200 }) }; - + transformer.cluster(Arrays.asList(points)); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java index cf4ec54..d707112 100644 --- a/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java +++ b/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java @@ -36,7 +36,7 @@ public class MultiKMeansPlusPlusClustererTest { MultiKMeansPlusPlusClusterer<DoublePoint> transformer = new MultiKMeansPlusPlusClusterer<DoublePoint>( new KMeansPlusPlusClusterer<DoublePoint>(3, 10), 5); - + DoublePoint[] points = new DoublePoint[] { // first expected cluster http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java index 4dde78f..0b20f8b 100644 --- a/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java +++ b/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java @@ -56,7 +56,7 @@ public class SumOfClusterVariancesTest { }; final List<Cluster<DoublePoint>> clusters = new ArrayList<Cluster<DoublePoint>>(); - + final Cluster<DoublePoint> cluster1 = new Cluster<DoublePoint>(); for (DoublePoint p : points1) { cluster1.addPoint(p); @@ -73,7 +73,7 @@ public class SumOfClusterVariancesTest { assertEquals(6.148148148, evaluator.score(clusters), 1e-6); } - + @Test public void testOrdering() { assertTrue(evaluator.isBetterScore(10, 20)); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java index 7163e0d..0e34f6b 100644 --- a/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java +++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java @@ -149,14 +149,14 @@ public class NetworkTest { initArray).getNetwork(); final Network copy = net.copy(); - + final Neuron netNeuron0 = net.getNeuron(0); final Neuron copyNeuron0 = copy.getNeuron(0); final Neuron netNeuron1 = net.getNeuron(1); final Neuron copyNeuron1 = copy.getNeuron(1); Collection<Neuron> netNeighbours; Collection<Neuron> copyNeighbours; - + // Check that both networks have the same connections. netNeighbours = net.getNeighbours(netNeuron0); copyNeighbours = copy.getNeighbours(copyNeuron0); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java index cc19143..9e13e35 100644 --- a/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java +++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java @@ -37,7 +37,7 @@ public class OffsetFeatureInitializer * each call. * * @param orig Original initializer. - */ + */ public OffsetFeatureInitializer(FeatureInitializer orig) { this.orig = orig; } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java index 0bd4d2a..dd669d5 100644 --- a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java +++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java @@ -150,7 +150,7 @@ public class KohonenTrainingTaskTest { for (double[] c : solver.getCoordinatesList()) { s.append(c[0]).append(" ").append(c[1]).append(" "); final City city = solver.getClosestCity(c[0], c[1]); - final double[] cityCoord = city.getCoordinates(); + final double[] cityCoord = city.getCoordinates(); s.append(cityCoord[0]).append(" ").append(cityCoord[1]).append(" "); s.append(" # ").append(city.getName()).append("\n"); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java index f11329c..fea0f16 100644 --- a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java +++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java @@ -125,7 +125,7 @@ public class TravellingSalesmanSolver { createRandomIterator(numSamplesPerTask), action); } - + return tasks; } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java b/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java index b4e20ed..d843ccb 100644 --- a/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java +++ b/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java @@ -467,7 +467,7 @@ public class JacobianMatricesTest { } else { dFdP[0] = cy - y[1]; dFdP[1] = y[0] - cx; - } + } } public double[] exactY(double t) { http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java b/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java index bbb2bc5..cb8f5a8 100644 --- a/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java +++ b/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java @@ -88,11 +88,11 @@ public class EventStateTest { MaxCountExceededException, NoBracketingException { FirstOrderDifferentialEquations equation = new FirstOrderDifferentialEquations() { - + public int getDimension() { return 1; } - + public void computeDerivatives(double t, double[] y, double[] yDot) { yDot[0] = 1.0; } @@ -153,11 +153,11 @@ public class EventStateTest { ExpandableStatefulODE equation = new ExpandableStatefulODE(new FirstOrderDifferentialEquations() { - + public int getDimension() { return 1; } - + public void computeDerivatives(double t, double[] y, double[] yDot) { yDot[0] = 2.0; } @@ -165,11 +165,11 @@ public class EventStateTest { equation.setTime(0.0); equation.setPrimaryState(new double[1]); equation.addSecondaryEquations(new SecondaryEquations() { - + public int getDimension() { return 1; } - + public void computeDerivatives(double t, double[] primary, double[] primaryDot, double[] secondary, double[] secondaryDot) { @@ -221,11 +221,11 @@ public class EventStateTest { MaxCountExceededException, NoBracketingException { FirstOrderDifferentialEquations equation = new FirstOrderDifferentialEquations() { - + public int getDimension() { return 1; } - + public void computeDerivatives(double t, double[] y, double[] yDot) { yDot[0] = 1.0; } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java b/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java index 3a4e138..d34de40 100644 --- a/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java +++ b/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java @@ -356,7 +356,7 @@ public class HighamHall54IntegratorTest { FirstOrderIntegrator integ = new HighamHall54Integrator(minStep, maxStep, vecAbsoluteTolerance, vecRelativeTolerance); - TestProblemHandler handler = new TestProblemHandler(pb, integ); + TestProblemHandler handler = new TestProblemHandler(pb, integ); integ.addStepHandler(handler); integ.integrate(pb, pb.getInitialTime(), pb.getInitialState(), http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java b/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java index 0013052..1955321 100644 --- a/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java +++ b/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java @@ -239,10 +239,10 @@ public abstract class StepNormalizerOutputTestBase * @param bounds the step normalizer bounds setting to use * @param expected the expected output (normalized time points) * @param reverse whether to reverse the integration direction - * @throws NoBracketingException - * @throws MaxCountExceededException - * @throws NumberIsTooSmallException - * @throws DimensionMismatchException + * @throws NoBracketingException + * @throws MaxCountExceededException + * @throws NumberIsTooSmallException + * @throws DimensionMismatchException */ private void doTest(StepNormalizerMode mode, StepNormalizerBounds bounds, double[] expected, boolean reverse) http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java b/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java index e363214..e496e9e 100644 --- a/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java @@ -33,7 +33,7 @@ public class SimplePointCheckerTest { final int max = 10; final SimplePointChecker<PointValuePair> checker = new SimplePointChecker<PointValuePair>(1e-1, 1e-2, max); - Assert.assertTrue(checker.converged(max, null, null)); + Assert.assertTrue(checker.converged(max, null, null)); Assert.assertTrue(checker.converged(max + 1, null, null)); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java b/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java index 64ff78c..5ba4aab 100644 --- a/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java @@ -32,7 +32,7 @@ public class SimpleValueCheckerTest { public void testIterationCheck() { final int max = 10; final SimpleValueChecker checker = new SimpleValueChecker(1e-1, 1e-2, max); - Assert.assertTrue(checker.converged(max, null, null)); + Assert.assertTrue(checker.converged(max, null, null)); Assert.assertTrue(checker.converged(max + 1, null, null)); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java index 5064f55..db69efd 100644 --- a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java @@ -42,22 +42,22 @@ import org.junit.Test; public class BOBYQAOptimizerTest { static final int DIM = 13; - + @Test(expected=NumberIsTooLargeException.class) public void testInitOutOfBounds() { double[] startPoint = point(DIM, 3); double[][] boundaries = boundaries(DIM, -1, 2); doTest(new Rosen(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, 2000, null); } - + @Test(expected=DimensionMismatchException.class) public void testBoundariesDimensionMismatch() { double[] startPoint = point(DIM, 0.5); double[][] boundaries = boundaries(DIM + 1, -1, 2); doTest(new Rosen(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, 2000, null); } @@ -75,7 +75,7 @@ public class BOBYQAOptimizerTest { double[] startPoint = point(DIM, 0.1); double[][] boundaries = null; doTest(new Rosen(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, lowMaxEval, null); } @@ -85,7 +85,7 @@ public class BOBYQAOptimizerTest { double[][] boundaries = null; PointValuePair expected = new PointValuePair(point(DIM,1.0),0.0); doTest(new Rosen(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, 2000, expected); } @@ -95,12 +95,12 @@ public class BOBYQAOptimizerTest { double[][] boundaries = null; PointValuePair expected = new PointValuePair(point(DIM,0.0),1.0); doTest(new MinusElli(), startPoint, boundaries, - GoalType.MAXIMIZE, + GoalType.MAXIMIZE, 2e-10, 5e-6, 1000, expected); - boundaries = boundaries(DIM,-0.3,0.3); + boundaries = boundaries(DIM,-0.3,0.3); startPoint = point(DIM,0.1); doTest(new MinusElli(), startPoint, boundaries, - GoalType.MAXIMIZE, + GoalType.MAXIMIZE, 2e-10, 5e-6, 1000, expected); } @@ -111,7 +111,7 @@ public class BOBYQAOptimizerTest { PointValuePair expected = new PointValuePair(point(DIM,0.0),0.0); doTest(new Elli(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, 1000, expected); } @@ -122,7 +122,7 @@ public class BOBYQAOptimizerTest { PointValuePair expected = new PointValuePair(point(DIM,0.0),0.0); doTest(new ElliRotated(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-12, 1e-6, 10000, expected); } @@ -133,7 +133,7 @@ public class BOBYQAOptimizerTest { PointValuePair expected = new PointValuePair(point(DIM,0.0),0.0); doTest(new Cigar(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, 100, expected); } @@ -155,7 +155,7 @@ public class BOBYQAOptimizerTest { PointValuePair expected = new PointValuePair(point(DIM,0.0),0.0); doTest(new CigTab(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 5e-5, 100, expected); } @@ -166,18 +166,18 @@ public class BOBYQAOptimizerTest { PointValuePair expected = new PointValuePair(point(DIM,0.0),0.0); doTest(new Sphere(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, 100, expected); } @Test public void testTablet() { - double[] startPoint = point(DIM,1.0); + double[] startPoint = point(DIM,1.0); double[][] boundaries = null; PointValuePair expected = new PointValuePair(point(DIM,0.0),0.0); doTest(new Tablet(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, 100, expected); } @@ -188,7 +188,7 @@ public class BOBYQAOptimizerTest { PointValuePair expected = new PointValuePair(point(DIM/2,0.0),0.0); doTest(new DiffPow(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-8, 1e-1, 21000, expected); } @@ -199,7 +199,7 @@ public class BOBYQAOptimizerTest { PointValuePair expected = new PointValuePair(point(DIM/2,0.0),0.0); doTest(new SsDiffPow(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-2, 1.3e-1, 50000, expected); } @@ -222,7 +222,7 @@ public class BOBYQAOptimizerTest { PointValuePair expected = new PointValuePair(point(DIM,0.0),0.0); doTest(new Rastrigin(), startPoint, boundaries, - GoalType.MINIMIZE, + GoalType.MINIMIZE, 1e-13, 1e-6, 1000, expected); } @@ -334,7 +334,7 @@ public class BOBYQAOptimizerTest { new InitialGuess(startPoint), new SimpleBounds(boundaries[0], boundaries[1])); -// System.out.println(func.getClass().getName() + " = " +// System.out.println(func.getClass().getName() + " = " // + optim.getEvaluations() + " f("); // for (double x: result.getPoint()) System.out.print(x + " "); // System.out.println(") = " + result.getValue()); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java index b6c5622..51617d6 100644 --- a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java @@ -71,7 +71,7 @@ public class CMAESOptimizerTest { GoalType.MINIMIZE, LAMBDA, true, 0, 1e-13, 1e-13, 1e-6, 100000, expected); } - + @Test(expected = DimensionMismatchException.class) public void testBoundariesDimensionMismatch() { double[] startPoint = point(DIM,0.5); @@ -119,7 +119,7 @@ public class CMAESOptimizerTest { GoalType.MINIMIZE, LAMBDA, true, 0, 1e-13, 1e-13, 1e-6, 100000, expected); } - + @Test @Retry(3) public void testRosen() { @@ -150,7 +150,7 @@ public class CMAESOptimizerTest { doTest(new MinusElli(), startPoint, insigma, boundaries, GoalType.MAXIMIZE, LAMBDA, false, 0, 1.0-1e-13, 2e-10, 5e-6, 100000, expected); - boundaries = boundaries(DIM,-0.3,0.3); + boundaries = boundaries(DIM,-0.3,0.3); startPoint = point(DIM,0.1); doTest(new MinusElli(), startPoint, insigma, boundaries, GoalType.MAXIMIZE, LAMBDA, true, 0, 1.0-1e-13, @@ -409,7 +409,7 @@ public class CMAESOptimizerTest { }; final double[] start = { 1 }; - + // No bounds. PointValuePair result = optimizer.optimize(new MaxEval(100000), new ObjectiveFunction(fitnessFunction), @@ -454,7 +454,7 @@ public class CMAESOptimizerTest { Assert.assertEquals(resNoBound, resNearLo, 1e-3); Assert.assertEquals(resNoBound, resNearHi, 1e-3); } - + /** * @param func Function to optimize. * @param startPoint Starting point. @@ -477,7 +477,7 @@ public class CMAESOptimizerTest { GoalType goal, int lambda, boolean isActive, - int diagonalOnly, + int diagonalOnly, double stopValue, double fTol, double pointTol, http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java index d5ea82a..319e0f1 100644 --- a/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java @@ -89,7 +89,7 @@ public final class BrentOptimizerTest { public void testBoundaries() { final double lower = -1.0; final double upper = +1.0; - UnivariateFunction f = new UnivariateFunction() { + UnivariateFunction f = new UnivariateFunction() { public double value(double x) { if (x < lower) { throw new NumberIsTooSmallException(x, lower, true); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java index 4946431..ec8ec06 100644 --- a/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java @@ -117,7 +117,7 @@ public class MultiStartUnivariateOptimizerTest { JDKRandomGenerator g = new JDKRandomGenerator(); g.setSeed(4312000053L); MultiStartUnivariateOptimizer optimizer = new MultiStartUnivariateOptimizer(underlying, 5, g); - + try { optimizer.optimize(new MaxEval(300), new UnivariateObjectiveFunction(f), http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java b/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java index 72c02b1..a515b06 100644 --- a/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java @@ -32,7 +32,7 @@ public class SimpleUnivariateValueCheckerTest { public void testIterationCheck() { final int max = 10; final SimpleUnivariateValueChecker checker = new SimpleUnivariateValueChecker(1e-1, 1e-2, max); - Assert.assertTrue(checker.converged(max, null, null)); + Assert.assertTrue(checker.converged(max, null, null)); Assert.assertTrue(checker.converged(max + 1, null, null)); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/primes/PrimesTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/primes/PrimesTest.java b/src/test/java/org/apache/commons/math4/primes/PrimesTest.java index 085dfac..26bcd37 100644 --- a/src/test/java/org/apache/commons/math4/primes/PrimesTest.java +++ b/src/test/java/org/apache/commons/math4/primes/PrimesTest.java @@ -171,4 +171,4 @@ public class PrimesTest { Assert.assertEquals(1, factors.size()); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java index 282ec38..79cf97d 100644 --- a/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java @@ -28,12 +28,12 @@ public class AbstractRandomGeneratorTest extends RandomGeneratorAbstractTest { public AbstractRandomGeneratorTest() { super(); } - + @Override protected RandomGenerator makeGenerator() { RandomGenerator generator = new TestRandomGenerator(); generator.setSeed(1001); return generator; } - + } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java index cc47304..7f43ccb 100644 --- a/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java @@ -31,14 +31,14 @@ public class BitsStreamGeneratorTest extends RandomGeneratorAbstractTest { public BitsStreamGeneratorTest() { super(); } - + @Override protected RandomGenerator makeGenerator() { RandomGenerator generator = new TestBitStreamGenerator(); generator.setSeed(1000); return generator; } - + /** * Test BitStreamGenerator using a Random as bit source. */ @@ -46,7 +46,7 @@ public class BitsStreamGeneratorTest extends RandomGeneratorAbstractTest { private static final long serialVersionUID = 1L; private BitRandom ran = new BitRandom(); - + @Override public void setSeed(int seed) { ran.setSeed(seed); @@ -61,15 +61,15 @@ public class BitsStreamGeneratorTest extends RandomGeneratorAbstractTest { @Override public void setSeed(long seed) { ran.setSeed((int) seed); - + } - + @Override protected int next(int bits) { return ran.nextBits(bits); - } + } } - + /** * Extend Random to expose next(bits) */ @@ -82,5 +82,5 @@ public class BitsStreamGeneratorTest extends RandomGeneratorAbstractTest { return next(bits); } } - + } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java index 038380c..9b2dd82 100644 --- a/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java @@ -151,7 +151,7 @@ public class CorrelatedRandomVectorGeneratorTest { {0.009881156, 0.008196856, 0.019023866, 0.009210099}, {0.010499559, 0.010732709, 0.009210099, 0.019107243} }; - + final double[][] covMatrix2 = new double[][]{ {0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.013445532, 0.010394690, 0.009881156, 0.010499559}, @@ -159,7 +159,7 @@ public class CorrelatedRandomVectorGeneratorTest { {0.0, 0.009881156, 0.008196856, 0.019023866, 0.009210099}, {0.0, 0.010499559, 0.010732709, 0.009210099, 0.019107243} }; - + final double[][] covMatrix3 = new double[][]{ {0.013445532, 0.010394690, 0.0, 0.009881156, 0.010499559}, {0.010394690, 0.023006616, 0.0, 0.008196856, 0.010732709}, @@ -167,7 +167,7 @@ public class CorrelatedRandomVectorGeneratorTest { {0.009881156, 0.008196856, 0.0, 0.019023866, 0.009210099}, {0.010499559, 0.010732709, 0.0, 0.009210099, 0.019107243} }; - + testSampler(covMatrix1, 10000, 0.001); testSampler(covMatrix2, 10000, 0.001); testSampler(covMatrix3, 10000, 0.001); @@ -186,7 +186,7 @@ public class CorrelatedRandomVectorGeneratorTest { private void testSampler(final double[][] covMatrix, int samples, double epsilon) { CorrelatedRandomVectorGenerator sampler = createSampler(covMatrix); - + StorelessCovariance cov = new StorelessCovariance(covMatrix.length); for (int i = 0; i < samples; ++i) { cov.increment(sampler.nextVector()); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java index cf59363..f7ed491 100644 --- a/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java @@ -86,7 +86,7 @@ public class HaltonSequenceGeneratorTest { } catch (OutOfRangeException e) { // expected } - + try { new HaltonSequenceGenerator(41); Assert.fail("an exception should have been thrown"); @@ -124,7 +124,7 @@ public class HaltonSequenceGeneratorTest { double[] result = generator.skipTo(5); Assert.assertArrayEquals(referenceValues[5], result, 1e-3); Assert.assertEquals(6, generator.getNextIndex()); - + for (int i = 6; i < referenceValues.length; i++) { result = generator.nextVector(); Assert.assertArrayEquals(referenceValues[i], result, 1e-3); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java b/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java index b04e753..1446003 100644 --- a/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java +++ b/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java @@ -27,10 +27,10 @@ public class MersenneTwisterTest extends RandomGeneratorAbstractTest { protected RandomGenerator makeGenerator() { return new MersenneTwister(111); } - + // TODO: Some of the tests moved up to RandomGeneratorAbstractTest tested alternative seeding / constructors // Tests exercising these features directly should be added to this class. - + @Test public void testMakotoNishimura() { MersenneTwister mt = new MersenneTwister(new int[] {0x123, 0x234, 0x345, 0x456}); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java b/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java index 1218398..da7e763 100644 --- a/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java +++ b/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java @@ -60,13 +60,13 @@ public class RandomAdaptorTest { * */ public static class ConstantGenerator implements RandomGenerator { - + private final double value; - + public ConstantGenerator() { value = 0; } - + public ConstantGenerator(double value) { this.value = value; } http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java b/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java index eabbd85..fa0a462 100644 --- a/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java +++ b/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java @@ -67,7 +67,7 @@ public abstract class RandomGeneratorAbstractTest extends RandomDataGeneratorTes public void setUp() { generator = makeGenerator(); } - + // Omit secureXxx tests, since they do not use the provided generator @Override public void testNextSecureLongIAE() {} http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java index 7ee4d10..e7663eb 100644 --- a/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java @@ -55,7 +55,7 @@ public class SobolSequenceGeneratorTest { Assert.assertEquals(i + 1, generator.getNextIndex()); } } - + @Test public void testConstructor() { try { @@ -64,7 +64,7 @@ public class SobolSequenceGeneratorTest { } catch (OutOfRangeException e) { // expected } - + try { new SobolSequenceGenerator(1001); Assert.fail("an exception should have been thrown"); @@ -83,7 +83,7 @@ public class SobolSequenceGeneratorTest { } catch (OutOfRangeException e) { // expected } - + try { new SobolSequenceGenerator(1001); Assert.fail("an exception should have been thrown"); @@ -97,7 +97,7 @@ public class SobolSequenceGeneratorTest { double[] result = generator.skipTo(5); Assert.assertArrayEquals(referenceValues[5], result, 1e-6); Assert.assertEquals(6, generator.getNextIndex()); - + for (int i = 6; i < referenceValues.length; i++) { result = generator.nextVector(); Assert.assertArrayEquals(referenceValues[i], result, 1e-6); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java index 9ede227..f6c9f3e 100644 --- a/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java @@ -28,7 +28,7 @@ import org.junit.Test; /** * The class <code>StableRandomGeneratorTest</code> contains tests for the class * {@link StableRandomGenerator} - * + * */ public class StableRandomGeneratorTest { @@ -38,7 +38,7 @@ public class StableRandomGeneratorTest { /** * Run the double nextDouble() method test Due to leptokurtic property the * acceptance range is widened. - * + * * TODO: verify that tolerance this wide is really OK */ @Test @@ -131,4 +131,4 @@ public class StableRandomGeneratorTest { Assert.assertEquals(2.0, e.getArgument()); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java index aa60e1f..453de34 100644 --- a/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java @@ -30,7 +30,7 @@ public class UnitSphereRandomVectorGeneratorTest { */ @Test public void test2DDistribution() { - + RandomGenerator rg = new JDKRandomGenerator(); rg.setSeed(17399225432l); UnitSphereRandomVectorGenerator generator = new UnitSphereRandomVectorGenerator(2, rg); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well19937aTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/Well19937aTest.java b/src/test/java/org/apache/commons/math4/random/Well19937aTest.java index 170457a..97f05f4 100644 --- a/src/test/java/org/apache/commons/math4/random/Well19937aTest.java +++ b/src/test/java/org/apache/commons/math4/random/Well19937aTest.java @@ -22,7 +22,7 @@ import org.junit.Assert; import org.junit.Test; public class Well19937aTest extends RandomGeneratorAbstractTest { - + @Override public RandomGenerator makeGenerator() { return new Well19937a(100); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well19937cTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/Well19937cTest.java b/src/test/java/org/apache/commons/math4/random/Well19937cTest.java index 45d188b..cfffcd1 100644 --- a/src/test/java/org/apache/commons/math4/random/Well19937cTest.java +++ b/src/test/java/org/apache/commons/math4/random/Well19937cTest.java @@ -22,7 +22,7 @@ import org.junit.Assert; import org.junit.Test; public class Well19937cTest extends RandomGeneratorAbstractTest { - + @Override public RandomGenerator makeGenerator() { return new Well19937c(100); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well44497aTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/Well44497aTest.java b/src/test/java/org/apache/commons/math4/random/Well44497aTest.java index 436b64a..e6dc96f 100644 --- a/src/test/java/org/apache/commons/math4/random/Well44497aTest.java +++ b/src/test/java/org/apache/commons/math4/random/Well44497aTest.java @@ -22,12 +22,12 @@ import org.junit.Assert; import org.junit.Test; public class Well44497aTest extends RandomGeneratorAbstractTest { - + @Override public RandomGenerator makeGenerator() { return new Well44497a(100); } - + @Test public void testReferenceCode() { int[] base = { http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well44497bTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/Well44497bTest.java b/src/test/java/org/apache/commons/math4/random/Well44497bTest.java index d9e519f..7f3dee1 100644 --- a/src/test/java/org/apache/commons/math4/random/Well44497bTest.java +++ b/src/test/java/org/apache/commons/math4/random/Well44497bTest.java @@ -22,12 +22,12 @@ import org.junit.Assert; import org.junit.Test; public class Well44497bTest extends RandomGeneratorAbstractTest { - + @Override public RandomGenerator makeGenerator() { return new Well44497b(100); } - + @Test public void testReferenceCode() { int[] base = { http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well512aTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/Well512aTest.java b/src/test/java/org/apache/commons/math4/random/Well512aTest.java index f3b106c..192d7d5 100644 --- a/src/test/java/org/apache/commons/math4/random/Well512aTest.java +++ b/src/test/java/org/apache/commons/math4/random/Well512aTest.java @@ -22,7 +22,7 @@ import org.junit.Assert; import org.junit.Test; public class Well512aTest extends RandomGeneratorAbstractTest { - + @Override public RandomGenerator makeGenerator() { return new Well512a(101); http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/special/BesselJTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/special/BesselJTest.java b/src/test/java/org/apache/commons/math4/special/BesselJTest.java index a50ccc4..cf3bf31 100644 --- a/src/test/java/org/apache/commons/math4/special/BesselJTest.java +++ b/src/test/java/org/apache/commons/math4/special/BesselJTest.java @@ -36,7 +36,7 @@ public class BesselJTest { * near.eight = 8 + seq(-.5,.5,.1) * largexs = c(10,30,100,300,1000) * xs = unique(sort(c(smallxs, medxs, near.eight,largexs))) - * + * * for (n in c(0:15, 30, 100)) { * for (x in xs) { * val = format( besselJ(x,n), digits=20 ) @@ -764,12 +764,12 @@ public class BesselJTest { Assert.assertEquals(msg, expected, actual, tol); } } - + @Test(expected=MathIllegalArgumentException.class) public void testIAEBadOrder() { BesselJ.value(-1, 1); } - + @Test(expected=MathIllegalArgumentException.class) public void testIAEBadArgument() { BesselJ.value(1, 100000);