Repository: commons-math Updated Branches: refs/heads/master 8b5f4535e -> 6df150da2
http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java index 601a32f..86ed2f9 100644 --- a/src/test/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math4/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java @@ -34,7 +34,7 @@ public class ThreeEighthesFieldStepInterpolatorTest extends RungeKuttaFieldStepI FieldODEStateAndDerivative<T> softPreviousState, FieldODEStateAndDerivative<T> softCurrentState, FieldEquationsMapper<T> mapper) { - return new ThreeEighthesFieldStepInterpolator<>(field, forward, yDotK, + return new ThreeEighthesFieldStepInterpolator<T>(field, forward, yDotK, globalPreviousState, globalCurrentState, softPreviousState, softCurrentState, mapper); @@ -42,7 +42,7 @@ public class ThreeEighthesFieldStepInterpolatorTest extends RungeKuttaFieldStepI protected <T extends RealFieldElement<T>> FieldButcherArrayProvider<T> createButcherArrayProvider(final Field<T> field) { - return new ThreeEighthesFieldIntegrator<>(field, field.getOne()); + return new ThreeEighthesFieldIntegrator<T>(field, field.getOne()); } @Test http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/ode/sampling/DummyFieldStepInterpolator.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ode/sampling/DummyFieldStepInterpolator.java b/src/test/java/org/apache/commons/math4/ode/sampling/DummyFieldStepInterpolator.java index cda8f2c..f546745 100644 --- a/src/test/java/org/apache/commons/math4/ode/sampling/DummyFieldStepInterpolator.java +++ b/src/test/java/org/apache/commons/math4/ode/sampling/DummyFieldStepInterpolator.java @@ -40,7 +40,7 @@ public class DummyFieldStepInterpolator<T extends RealFieldElement<T>> final FieldODEStateAndDerivative<T> newSoftPreviousState, final FieldODEStateAndDerivative<T> newSoftCurrentState, final FieldEquationsMapper<T> newMapper) { - return new DummyFieldStepInterpolator<>(newForward, + return new DummyFieldStepInterpolator<T>(newForward, newGlobalPreviousState, newGlobalCurrentState, newSoftPreviousState, newSoftCurrentState, newMapper); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/ode/sampling/StepInterpolatorTestUtils.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/ode/sampling/StepInterpolatorTestUtils.java b/src/test/java/org/apache/commons/math4/ode/sampling/StepInterpolatorTestUtils.java index d3d5fca..5c592d3 100644 --- a/src/test/java/org/apache/commons/math4/ode/sampling/StepInterpolatorTestUtils.java +++ b/src/test/java/org/apache/commons/math4/ode/sampling/StepInterpolatorTestUtils.java @@ -137,7 +137,7 @@ public class StepInterpolatorTestUtils { }); - integrator.integrate(new FieldExpandableODE<>(problem), problem.getInitialState(), problem.getFinalTime()); + integrator.integrate(new FieldExpandableODE<T>(problem), problem.getInitialState(), problem.getFinalTime()); } } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/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 6f6bfbe..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 @@ -255,7 +255,7 @@ public abstract class StepNormalizerOutputTestBase double[] y = {0.0}; double start = reverse ? getEnd() : getStart(); double end = reverse ? getStart() : getEnd(); - output = new ArrayList<>(); + output = new ArrayList<Double>(); integ.integrate(this, start, y, end, y); double[] actual = new double[output.size()]; for(int i = 0; i < actual.length; i++) { http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/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 262bb60..e496e9e 100644 --- a/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java +++ b/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java @@ -32,7 +32,7 @@ public class SimplePointCheckerTest { public void testIterationCheck() { final int max = 10; final SimplePointChecker<PointValuePair> checker - = new SimplePointChecker<>(1e-1, 1e-2, max); + = new SimplePointChecker<PointValuePair>(1e-1, 1e-2, max); Assert.assertTrue(checker.converged(max, null, null)); Assert.assertTrue(checker.converged(max + 1, null, null)); } @@ -40,7 +40,7 @@ public class SimplePointCheckerTest { @Test public void testIterationCheckDisabled() { final SimplePointChecker<PointValuePair> checker - = new SimplePointChecker<>(1e-8, 1e-8); + = new SimplePointChecker<PointValuePair>(1e-8, 1e-8); final PointValuePair a = new PointValuePair(new double[] { 1d }, 1d); final PointValuePair b = new PointValuePair(new double[] { 10d }, 10d); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/optim/linear/SimplexSolverTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/linear/SimplexSolverTest.java b/src/test/java/org/apache/commons/math4/optim/linear/SimplexSolverTest.java index 503f782..987ab6c 100644 --- a/src/test/java/org/apache/commons/math4/optim/linear/SimplexSolverTest.java +++ b/src/test/java/org/apache/commons/math4/optim/linear/SimplexSolverTest.java @@ -54,7 +54,7 @@ public class SimplexSolverTest { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 10, -57, -9, -24}, 0); - ArrayList<LinearConstraint> constraints = new ArrayList<>(); + ArrayList<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {0.5, -5.5, -2.5, 9}, Relationship.LEQ, 0)); constraints.add(new LinearConstraint(new double[] {0.5, -1.5, -0.5, 1}, Relationship.LEQ, 0)); @@ -75,7 +75,7 @@ public class SimplexSolverTest { LinearObjectiveFunction f = new LinearObjectiveFunction( new double[] { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, 0.0); - ArrayList <LinearConstraint>constraints = new ArrayList<>(); + ArrayList <LinearConstraint>constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {0.0, 39.0, 23.0, 96.0, 15.0, 48.0, 9.0, 21.0, 48.0, 36.0, 76.0, 19.0, 88.0, 17.0, 16.0, 36.0,}, Relationship.GEQ, 15.0)); constraints.add(new LinearConstraint(new double[] {0.0, 59.0, 93.0, 12.0, 29.0, 78.0, 73.0, 87.0, 32.0, 70.0, 68.0, 24.0, 11.0, 26.0, 65.0, 25.0,}, Relationship.GEQ, 29.0)); @@ -97,7 +97,7 @@ public class SimplexSolverTest { LinearObjectiveFunction f = new LinearObjectiveFunction( new double[] { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, 0.0); - ArrayList <LinearConstraint>constraints = new ArrayList<>(); + ArrayList <LinearConstraint>constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {0.0, 16.0, 14.0, 69.0, 1.0, 85.0, 52.0, 43.0, 64.0, 97.0, 14.0, 74.0, 89.0, 28.0, 94.0, 58.0, 13.0, 22.0, 21.0, 17.0, 30.0, 25.0, 1.0, 59.0, 91.0, 78.0, 12.0, 74.0, 56.0, 3.0, 88.0,}, Relationship.GEQ, 91.0)); constraints.add(new LinearConstraint(new double[] {0.0, 60.0, 40.0, 81.0, 71.0, 72.0, 46.0, 45.0, 38.0, 48.0, 40.0, 17.0, 33.0, 85.0, 64.0, 32.0, 84.0, 3.0, 54.0, 44.0, 71.0, 67.0, 90.0, 95.0, 54.0, 99.0, 99.0, 29.0, 52.0, 98.0, 9.0,}, Relationship.GEQ, 54.0)); @@ -120,7 +120,7 @@ public class SimplexSolverTest { public void testMath781() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 2, 6, 7 }, 0); - ArrayList<LinearConstraint> constraints = new ArrayList<>(); + ArrayList<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 2, 1 }, Relationship.LEQ, 2)); constraints.add(new LinearConstraint(new double[] { -1, 1, 1 }, Relationship.LEQ, -1)); constraints.add(new LinearConstraint(new double[] { 2, -3, 1 }, Relationship.LEQ, -1)); @@ -139,7 +139,7 @@ public class SimplexSolverTest { @Test public void testMath713NegativeVariable() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] {1.0, 1.0}, 0.0d); - ArrayList<LinearConstraint> constraints = new ArrayList<>(); + ArrayList<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {1, 0}, Relationship.EQ, 1)); double epsilon = 1e-6; @@ -154,7 +154,7 @@ public class SimplexSolverTest { @Test public void testMath434NegativeVariable() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] {0.0, 0.0, 1.0}, 0.0d); - ArrayList<LinearConstraint> constraints = new ArrayList<>(); + ArrayList<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {1, 1, 0}, Relationship.EQ, 5)); constraints.add(new LinearConstraint(new double[] {0, 0, 1}, Relationship.GEQ, -10)); @@ -174,7 +174,7 @@ public class SimplexSolverTest { double epsilon = 1e-6; LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] {1.0, 0.0}, 0.0); - ArrayList<LinearConstraint> constraints = new ArrayList<>(); + ArrayList<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {epsilon/2, 0.5}, Relationship.EQ, 0)); constraints.add(new LinearConstraint(new double[] {1e-3, 0.1}, Relationship.EQ, 10)); @@ -189,7 +189,7 @@ public class SimplexSolverTest { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] {1.0}, 0.0); double epsilon = 1e-6; - ArrayList<LinearConstraint> constraints = new ArrayList<>(); + ArrayList<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {200}, Relationship.GEQ, 1)); constraints.add(new LinearConstraint(new double[] {100}, Relationship.GEQ, 0.499900001)); @@ -205,7 +205,7 @@ public class SimplexSolverTest { public void testMath434PivotRowSelection2() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] {0.0d, 1.0d, 1.0d, 0.0d, 0.0d, 0.0d, 0.0d}, 0.0d); - ArrayList<LinearConstraint> constraints = new ArrayList<>(); + ArrayList<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {1.0d, -0.1d, 0.0d, 0.0d, 0.0d, 0.0d, 0.0d}, Relationship.EQ, -0.1d)); constraints.add(new LinearConstraint(new double[] {1.0d, 0.0d, 0.0d, 0.0d, 0.0d, 0.0d, 0.0d}, Relationship.GEQ, -1e-18d)); constraints.add(new LinearConstraint(new double[] {0.0d, 1.0d, 0.0d, 0.0d, 0.0d, 0.0d, 0.0d}, Relationship.GEQ, 0.0d)); @@ -230,7 +230,7 @@ public class SimplexSolverTest { @Test public void testMath272() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 2, 2, 1 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 1, 0 }, Relationship.GEQ, 1)); constraints.add(new LinearConstraint(new double[] { 1, 0, 1 }, Relationship.GEQ, 1)); constraints.add(new LinearConstraint(new double[] { 0, 1, 0 }, Relationship.GEQ, 1)); @@ -248,7 +248,7 @@ public class SimplexSolverTest { @Test public void testMath286() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 0.8, 0.2, 0.7, 0.3, 0.6, 0.4 }, 0 ); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 0, 1, 0, 1, 0 }, Relationship.EQ, 23.0)); constraints.add(new LinearConstraint(new double[] { 0, 1, 0, 1, 0, 1 }, Relationship.EQ, 23.0)); constraints.add(new LinearConstraint(new double[] { 1, 0, 0, 0, 0, 0 }, Relationship.GEQ, 10.0)); @@ -270,7 +270,7 @@ public class SimplexSolverTest { @Test public void testDegeneracy() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 0.8, 0.7 }, 0 ); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 1 }, Relationship.LEQ, 18.0)); constraints.add(new LinearConstraint(new double[] { 1, 0 }, Relationship.GEQ, 10.0)); constraints.add(new LinearConstraint(new double[] { 0, 1 }, Relationship.GEQ, 8.0)); @@ -284,7 +284,7 @@ public class SimplexSolverTest { @Test public void testMath288() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 7, 3, 0, 0 }, 0 ); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 3, 0, -5, 0 }, Relationship.LEQ, 0.0)); constraints.add(new LinearConstraint(new double[] { 2, 0, 0, -5 }, Relationship.LEQ, 0.0)); constraints.add(new LinearConstraint(new double[] { 0, 3, 0, -5 }, Relationship.LEQ, 0.0)); @@ -300,7 +300,7 @@ public class SimplexSolverTest { @Test public void testMath290GEQ() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 1, 5 }, 0 ); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 2, 0 }, Relationship.GEQ, -1.0)); SimplexSolver solver = new SimplexSolver(); PointValuePair solution = solver.optimize(DEFAULT_MAX_ITER, f, new LinearConstraintSet(constraints), @@ -313,7 +313,7 @@ public class SimplexSolverTest { @Test(expected=NoFeasibleSolutionException.class) public void testMath290LEQ() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 1, 5 }, 0 ); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 2, 0 }, Relationship.LEQ, -1.0)); SimplexSolver solver = new SimplexSolver(); solver.optimize(DEFAULT_MAX_ITER, f, new LinearConstraintSet(constraints), @@ -323,7 +323,7 @@ public class SimplexSolverTest { @Test public void testMath293() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 0.8, 0.2, 0.7, 0.3, 0.4, 0.6}, 0 ); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 0, 1, 0, 1, 0 }, Relationship.EQ, 30.0)); constraints.add(new LinearConstraint(new double[] { 0, 1, 0, 1, 0, 1 }, Relationship.EQ, 30.0)); constraints.add(new LinearConstraint(new double[] { 0.8, 0.2, 0.0, 0.0, 0.0, 0.0 }, Relationship.GEQ, 10.0)); @@ -347,7 +347,7 @@ public class SimplexSolverTest { double valC = 0.4 * solution1.getPoint()[4] + 0.6 * solution1.getPoint()[5]; f = new LinearObjectiveFunction(new double[] { 0.8, 0.2, 0.7, 0.3, 0.4, 0.6}, 0 ); - constraints = new ArrayList<>(); + constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 0, 1, 0, 1, 0 }, Relationship.EQ, 30.0)); constraints.add(new LinearConstraint(new double[] { 0, 1, 0, 1, 0, 1 }, Relationship.EQ, 30.0)); constraints.add(new LinearConstraint(new double[] { 0.8, 0.2, 0.0, 0.0, 0.0, 0.0 }, Relationship.GEQ, valA)); @@ -374,7 +374,7 @@ public class SimplexSolverTest { } private List<LinearConstraint> createMath930Constraints() { - List<LinearConstraint> constraints = new ArrayList<>(); + List<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 0}, Relationship.GEQ, 0.0)); constraints.add(new LinearConstraint(new double[] {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, Relationship.GEQ, 0.0)); constraints.add(new LinearConstraint(new double[] {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, Relationship.LEQ, 0.0)); @@ -479,7 +479,7 @@ public class SimplexSolverTest { public void testSimplexSolver() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 15, 10 }, 7); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 0 }, Relationship.LEQ, 2)); constraints.add(new LinearConstraint(new double[] { 0, 1 }, Relationship.LEQ, 3)); constraints.add(new LinearConstraint(new double[] { 1, 1 }, Relationship.EQ, 4)); @@ -495,7 +495,7 @@ public class SimplexSolverTest { @Test public void testSingleVariableAndConstraint() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 3 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1 }, Relationship.LEQ, 10)); SimplexSolver solver = new SimplexSolver(); @@ -512,7 +512,7 @@ public class SimplexSolverTest { @Test public void testModelWithNoArtificialVars() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 15, 10 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 0 }, Relationship.LEQ, 2)); constraints.add(new LinearConstraint(new double[] { 0, 1 }, Relationship.LEQ, 3)); constraints.add(new LinearConstraint(new double[] { 1, 1 }, Relationship.LEQ, 4)); @@ -528,7 +528,7 @@ public class SimplexSolverTest { @Test public void testMinimization() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { -2, 1 }, -5); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 2 }, Relationship.LEQ, 6)); constraints.add(new LinearConstraint(new double[] { 3, 2 }, Relationship.LEQ, 12)); constraints.add(new LinearConstraint(new double[] { 0, 1 }, Relationship.GEQ, 0)); @@ -544,7 +544,7 @@ public class SimplexSolverTest { @Test public void testSolutionWithNegativeDecisionVariable() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { -2, 1 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 1 }, Relationship.GEQ, 6)); constraints.add(new LinearConstraint(new double[] { 1, 2 }, Relationship.LEQ, 14)); @@ -559,7 +559,7 @@ public class SimplexSolverTest { @Test(expected = NoFeasibleSolutionException.class) public void testInfeasibleSolution() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 15 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1 }, Relationship.LEQ, 1)); constraints.add(new LinearConstraint(new double[] { 1 }, Relationship.GEQ, 3)); @@ -571,7 +571,7 @@ public class SimplexSolverTest { @Test(expected = UnboundedSolutionException.class) public void testUnboundedSolution() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 15, 10 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 0 }, Relationship.EQ, 2)); SimplexSolver solver = new SimplexSolver(); @@ -582,7 +582,7 @@ public class SimplexSolverTest { @Test public void testRestrictVariablesToNonNegative() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 409, 523, 70, 204, 339 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 43, 56, 345, 56, 5 }, Relationship.LEQ, 4567456)); constraints.add(new LinearConstraint(new double[] { 12, 45, 7, 56, 23 }, Relationship.LEQ, 56454)); constraints.add(new LinearConstraint(new double[] { 8, 768, 0, 34, 7456 }, Relationship.LEQ, 1923421)); @@ -604,7 +604,7 @@ public class SimplexSolverTest { public void testEpsilon() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 10, 5, 1 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 9, 8, 0 }, Relationship.EQ, 17)); constraints.add(new LinearConstraint(new double[] { 0, 7, 8 }, Relationship.LEQ, 7)); constraints.add(new LinearConstraint(new double[] { 10, 0, 2 }, Relationship.LEQ, 10)); @@ -621,7 +621,7 @@ public class SimplexSolverTest { @Test public void testTrivialModel() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 1, 1 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 1 }, Relationship.EQ, 0)); SimplexSolver solver = new SimplexSolver(); @@ -657,7 +657,7 @@ public class SimplexSolverTest { 1, 1, 1, 1, 1, 1}; LinearObjectiveFunction f = new LinearObjectiveFunction(objective, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(equationFromString(objective.length, "x0 + x1 + x2 + x3 - x12 = 0")); constraints.add(equationFromString(objective.length, "x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 - x13 = 0")); constraints.add(equationFromString(objective.length, "x4 + x5 + x6 + x7 + x8 + x9 + x10 + x11 >= 49")); @@ -765,7 +765,7 @@ public class SimplexSolverTest { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 7, 3, 0, 0 }, 0 ); - List<LinearConstraint> constraints = new ArrayList<>(); + List<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 3, 0, -5, 0 }, Relationship.LEQ, 0.0)); constraints.add(new LinearConstraint(new double[] { 2, 0, 0, -5 }, Relationship.LEQ, 0.0)); constraints.add(new LinearConstraint(new double[] { 0, 3, 0, -5 }, Relationship.LEQ, 0.0)); @@ -805,7 +805,7 @@ public class SimplexSolverTest { // x1,x2,x3 >= 0 LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 2, 15, 18 }, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); // this constraint is wrong, the dimension is less than expected one constraints.add(new LinearConstraint(new double[] { -1, 2 - 6 }, Relationship.LEQ, -10)); constraints.add(new LinearConstraint(new double[] { 0, 1, 2 }, Relationship.LEQ, 6)); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/optim/linear/SimplexTableauTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/linear/SimplexTableauTest.java b/src/test/java/org/apache/commons/math4/optim/linear/SimplexTableauTest.java index be774c4..e0c99da 100644 --- a/src/test/java/org/apache/commons/math4/optim/linear/SimplexTableauTest.java +++ b/src/test/java/org/apache/commons/math4/optim/linear/SimplexTableauTest.java @@ -65,7 +65,7 @@ public class SimplexTableauTest { @Test public void testTableauWithNoArtificialVars() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] {15, 10}, 0); - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {1, 0}, Relationship.LEQ, 2)); constraints.add(new LinearConstraint(new double[] {0, 1}, Relationship.LEQ, 3)); constraints.add(new LinearConstraint(new double[] {1, 1}, Relationship.LEQ, 4)); @@ -94,7 +94,7 @@ public class SimplexTableauTest { } private Collection<LinearConstraint> createConstraints() { - Collection<LinearConstraint> constraints = new ArrayList<>(); + Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] {1, 0}, Relationship.LEQ, 2)); constraints.add(new LinearConstraint(new double[] {0, 1}, Relationship.LEQ, 3)); constraints.add(new LinearConstraint(new double[] {1, 1}, Relationship.EQ, 4)); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/CircleScalar.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/CircleScalar.java b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/CircleScalar.java index 0c80254..4c2acaa 100644 --- a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/CircleScalar.java +++ b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/gradient/CircleScalar.java @@ -32,7 +32,7 @@ public class CircleScalar { private ArrayList<Vector2D> points; public CircleScalar() { - points = new ArrayList<>(); + points = new ArrayList<Vector2D>(); } public void addPoint(double px, double py) { http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/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 831a86e..26bcd37 100644 --- a/src/test/java/org/apache/commons/math4/primes/PrimesTest.java +++ b/src/test/java/org/apache/commons/math4/primes/PrimesTest.java @@ -140,7 +140,7 @@ public class PrimesTest { } return out; } - static final HashSet<Integer> PRIMES_SET = new HashSet<>(); + static final HashSet<Integer> PRIMES_SET = new HashSet<Integer>(); static { for (int p : PRIMES) { PRIMES_SET.add(p); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/random/EmpiricalDistributionTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/EmpiricalDistributionTest.java b/src/test/java/org/apache/commons/math4/random/EmpiricalDistributionTest.java index d4d5bc2..4854979 100644 --- a/src/test/java/org/apache/commons/math4/random/EmpiricalDistributionTest.java +++ b/src/test/java/org/apache/commons/math4/random/EmpiricalDistributionTest.java @@ -62,7 +62,7 @@ public final class EmpiricalDistributionTest extends RealDistributionAbstractTes super.setUp(); empiricalDistribution = new EmpiricalDistribution(100); url = getClass().getResource("testData.txt"); - final ArrayList<Double> list = new ArrayList<>(); + final ArrayList<Double> list = new ArrayList<Double>(); try { empiricalDistribution2 = new EmpiricalDistribution(100); BufferedReader in = http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/random/RandomDataGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/RandomDataGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/RandomDataGeneratorTest.java index d7d7bb5..2982efb 100644 --- a/src/test/java/org/apache/commons/math4/random/RandomDataGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/RandomDataGeneratorTest.java @@ -483,7 +483,7 @@ public class RandomDataGeneratorTest { * [binBounds[binCount - 2], upper = binBounds[binCount - 1]), [upper, +inf) * */ - List<Integer> binBounds = new ArrayList<>(); + List<Integer> binBounds = new ArrayList<Integer>(); binBounds.add(lower); int bound = lower + binWidth; while (bound < upper - binWidth) { @@ -872,14 +872,14 @@ public class RandomDataGeneratorTest { long[] observed = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; double[] expected = { 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 }; - HashSet<Object> cPop = new HashSet<>(); // {0,1,2,3,4} + HashSet<Object> cPop = new HashSet<Object>(); // {0,1,2,3,4} for (int i = 0; i < 5; i++) { cPop.add(Integer.toString(i)); } Object[] sets = new Object[10]; // 2-sets from 5 for (int i = 0; i < 10; i++) { - HashSet<Object> hs = new HashSet<>(); + HashSet<Object> hs = new HashSet<Object>(); hs.add(c[i][0]); hs.add(c[i][1]); sets[i] = hs; @@ -898,7 +898,7 @@ public class RandomDataGeneratorTest { testStatistic.chiSquare(expected, observed) < 27.88); // Make sure sample of size = size of collection returns same collection - HashSet<Object> hs = new HashSet<>(); + HashSet<Object> hs = new HashSet<Object>(); hs.add("one"); Object[] one = randomData.nextSample(hs, 1); String oneString = (String) one[0]; @@ -916,7 +916,7 @@ public class RandomDataGeneratorTest { // Make sure we fail for empty collection try { - hs = new HashSet<>(); + hs = new HashSet<Object>(); one = randomData.nextSample(hs, 0); Assert.fail("n = k = 0, expecting MathIllegalArgumentException"); } catch (MathIllegalArgumentException ex) { @@ -928,7 +928,7 @@ public class RandomDataGeneratorTest { private int findSample(Object[] u, Object[] samp) { for (int i = 0; i < u.length; i++) { HashSet<Object> set = (HashSet<Object>) u[i]; - HashSet<Object> sampSet = new HashSet<>(); + HashSet<Object> sampSet = new HashSet<Object>(); for (int j = 0; j < samp.length; j++) { sampSet.add(samp[j]); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java index f4ec2cd..b66a127 100644 --- a/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java +++ b/src/test/java/org/apache/commons/math4/random/SynchronizedRandomGeneratorTest.java @@ -95,7 +95,7 @@ public class SynchronizedRandomGeneratorTest { final RandomGenerator rng = new MersenneTwister(); final RandomGenerator wrapper = sync ? new SynchronizedRandomGenerator(rng) : rng; - final List<Callable<Double>> tasks = new ArrayList<>(); + final List<Callable<Double>> tasks = new ArrayList<Callable<Double>>(); for (int i = 0; i < numGenerators; i++) { tasks.add(new Callable<Double>() { @Override http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/FrequencyTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/FrequencyTest.java b/src/test/java/org/apache/commons/math4/stat/FrequencyTest.java index 7263a1e..444c57a 100644 --- a/src/test/java/org/apache/commons/math4/stat/FrequencyTest.java +++ b/src/test/java/org/apache/commons/math4/stat/FrequencyTest.java @@ -367,7 +367,7 @@ public final class FrequencyTest { Frequency h = new Frequency(); h.addValue(THREE_LONG); - List<Frequency> coll = new ArrayList<>(); + List<Frequency> coll = new ArrayList<Frequency>(); coll.add(g); coll.add(h); f.merge(coll); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/data/CertifiedDataAbstractTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/data/CertifiedDataAbstractTest.java b/src/test/java/org/apache/commons/math4/stat/data/CertifiedDataAbstractTest.java index 74262b9..32cfbdd 100644 --- a/src/test/java/org/apache/commons/math4/stat/data/CertifiedDataAbstractTest.java +++ b/src/test/java/org/apache/commons/math4/stat/data/CertifiedDataAbstractTest.java @@ -48,7 +48,7 @@ public abstract class CertifiedDataAbstractTest { public void setUp() throws IOException { descriptives = new DescriptiveStatistics(); summaries = new SummaryStatistics(); - certifiedValues = new HashMap<>(); + certifiedValues = new HashMap<String, Double>(); loadData(); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java index 94c980d..5324ecf 100644 --- a/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java +++ b/src/test/java/org/apache/commons/math4/stat/descriptive/AggregateSummaryStatisticsTest.java @@ -147,7 +147,7 @@ public class AggregateSummaryStatisticsTest { for (int i = 0; i < nSamples; i++) { subSampleStats[i] = new SummaryStatistics(); } - Collection<SummaryStatistics> aggregate = new ArrayList<>(); + Collection<SummaryStatistics> aggregate = new ArrayList<SummaryStatistics>(); for (int i = 0; i < nSamples; i++) { for (int j = 0; j < subSamples[i].length; j++) { subSampleStats[i].addValue(subSamples[i][j]); @@ -183,7 +183,7 @@ public class AggregateSummaryStatisticsTest { for (int i = 0; i < nSamples; i++) { subSampleStats[i] = new SummaryStatistics(); } - Collection<StatisticalSummary> aggregate = new ArrayList<>(); + Collection<StatisticalSummary> aggregate = new ArrayList<StatisticalSummary>(); for (int i = 0; i < nSamples; i++) { for (int j = 0; j < subSamples[i].length; j++) { subSampleStats[i].addValue(subSamples[i][j]); @@ -213,7 +213,7 @@ public class AggregateSummaryStatisticsTest { for (int i = 0; i < 5; i++) { subSampleStats[i] = new SummaryStatistics(); } - Collection<SummaryStatistics> aggregate = new ArrayList<>(); + Collection<SummaryStatistics> aggregate = new ArrayList<SummaryStatistics>(); for (int i = 0; i < 5; i++) { for (int j = 0; j < subSamples[i].length; j++) { subSampleStats[i].addValue(subSamples[i][j]); @@ -242,7 +242,7 @@ public class AggregateSummaryStatisticsTest { for (int i = 0; i < 4; i++) { subSampleStats[i] = new SummaryStatistics(); } - Collection<SummaryStatistics> aggregate = new ArrayList<>(); + Collection<SummaryStatistics> aggregate = new ArrayList<SummaryStatistics>(); for (int i = 0; i < 4; i++) { for (int j = 0; j < subSamples[i].length; j++) { subSampleStats[i].addValue(subSamples[i][j]); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java b/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java index 19b9b9f..7bdd800 100644 --- a/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java +++ b/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImpl.java @@ -47,7 +47,7 @@ public class ListUnivariateImpl extends DescriptiveStatistics implements Seriali * No argument Constructor */ public ListUnivariateImpl(){ - this(new ArrayList<>()); + this(new ArrayList<Object>()); } /** http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImplTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImplTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImplTest.java index 2e22fc3..964d066 100644 --- a/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImplTest.java +++ b/src/test/java/org/apache/commons/math4/stat/descriptive/ListUnivariateImplTest.java @@ -49,7 +49,7 @@ public final class ListUnivariateImplTest { /** test stats */ @Test public void testStats() { - List<Object> externalList = new ArrayList<>(); + List<Object> externalList = new ArrayList<Object>(); DescriptiveStatistics u = new ListUnivariateImpl( externalList ); @@ -72,7 +72,7 @@ public final class ListUnivariateImplTest { @Test public void testN0andN1Conditions() { - List<Object> list = new ArrayList<>(); + List<Object> list = new ArrayList<Object>(); DescriptiveStatistics u = new ListUnivariateImpl( list ); @@ -105,7 +105,7 @@ public final class ListUnivariateImplTest { @Test public void testProductAndGeometricMean() { - ListUnivariateImpl u = new ListUnivariateImpl(new ArrayList<>()); + ListUnivariateImpl u = new ListUnivariateImpl(new ArrayList<Object>()); u.setWindowSize(10); u.addValue( 1.0 ); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/descriptive/MixedListUnivariateImplTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/MixedListUnivariateImplTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/MixedListUnivariateImplTest.java index 7d3ab04..410a2e1 100644 --- a/src/test/java/org/apache/commons/math4/stat/descriptive/MixedListUnivariateImplTest.java +++ b/src/test/java/org/apache/commons/math4/stat/descriptive/MixedListUnivariateImplTest.java @@ -59,7 +59,7 @@ public final class MixedListUnivariateImplTest { /** test stats */ @Test public void testStats() { - List<Object> externalList = new ArrayList<>(); + List<Object> externalList = new ArrayList<Object>(); DescriptiveStatistics u = new ListUnivariateImpl(externalList,transformers); @@ -82,7 +82,7 @@ public final class MixedListUnivariateImplTest { @Test public void testN0andN1Conditions() { - DescriptiveStatistics u = new ListUnivariateImpl(new ArrayList<>(),transformers); + DescriptiveStatistics u = new ListUnivariateImpl(new ArrayList<Object>(),transformers); Assert.assertTrue( "Mean of n = 0 set should be NaN", @@ -112,7 +112,7 @@ public final class MixedListUnivariateImplTest { @Test public void testSkewAndKurtosis() { ListUnivariateImpl u = - new ListUnivariateImpl(new ArrayList<>(), transformers); + new ListUnivariateImpl(new ArrayList<Object>(), transformers); u.addObject("12.5"); u.addObject(Integer.valueOf(12)); @@ -146,7 +146,7 @@ public final class MixedListUnivariateImplTest { @Test public void testProductAndGeometricMean() { - ListUnivariateImpl u = new ListUnivariateImpl(new ArrayList<>(),transformers); + ListUnivariateImpl u = new ListUnivariateImpl(new ArrayList<Object>(),transformers); u.setWindowSize(10); u.addValue(1.0); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java index c3542b2..6f12b1e 100644 --- a/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java +++ b/src/test/java/org/apache/commons/math4/stat/descriptive/UnivariateStatisticAbstractTest.java @@ -188,7 +188,7 @@ public abstract class UnivariateStatisticAbstractTest { // and fill valuesList with values from values array with // values[i] repeated weights[i] times, each i final RealDistribution valueDist = new NormalDistribution(mu, sigma); - List<Double> valuesList = new ArrayList<>(); + List<Double> valuesList = new ArrayList<Double>(); for (int i = 0; i < len; i++) { double value = valueDist.sample(); values[i] = value; http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java index bab2ec7..dfdcd4e 100644 --- a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java +++ b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PSquarePercentileTest.java @@ -209,7 +209,7 @@ public class PSquarePercentileTest extends public void testHashCodeInMarkers() { PSquarePercentile p = new PSquarePercentile(95); PSquarePercentile p2 = new PSquarePercentile(95); - Set<PSquarePercentile> s = new HashSet<>(); + Set<PSquarePercentile> s = new HashSet<PSquarePercentile>(); s.add(p); s.add(p2); Assert.assertEquals(1, s.size()); @@ -237,7 +237,7 @@ public class PSquarePercentileTest extends 95.1959, 95.1442, 95.0610, 95.1591, 95.1195, 95.1772, 95.0925, 95.1990, 95.1682 }), 0.0); Assert.assertTrue(m1.equals(m2)); - Set<PSquareMarkers> setMarkers = new LinkedHashSet<>(); + Set<PSquareMarkers> setMarkers = new LinkedHashSet<PSquareMarkers>(); Assert.assertTrue(setMarkers.add(m1)); Assert.assertFalse(setMarkers.add(m2)); Assert.assertEquals(1, setMarkers.size()); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/inference/OneWayAnovaTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/inference/OneWayAnovaTest.java b/src/test/java/org/apache/commons/math4/stat/inference/OneWayAnovaTest.java index cf35f30..3442382 100644 --- a/src/test/java/org/apache/commons/math4/stat/inference/OneWayAnovaTest.java +++ b/src/test/java/org/apache/commons/math4/stat/inference/OneWayAnovaTest.java @@ -47,7 +47,7 @@ public class OneWayAnovaTest { @Test public void testAnovaFValue() { // Target comparison values computed using R version 2.6.0 (Linux version) - List<double[]> threeClasses = new ArrayList<>(); + List<double[]> threeClasses = new ArrayList<double[]>(); threeClasses.add(classA); threeClasses.add(classB); threeClasses.add(classC); @@ -55,14 +55,14 @@ public class OneWayAnovaTest { Assert.assertEquals("ANOVA F-value", 24.67361709460624, testStatistic.anovaFValue(threeClasses), 1E-12); - List<double[]> twoClasses = new ArrayList<>(); + List<double[]> twoClasses = new ArrayList<double[]>(); twoClasses.add(classA); twoClasses.add(classB); Assert.assertEquals("ANOVA F-value", 0.0150579150579, testStatistic.anovaFValue(twoClasses), 1E-12); - List<double[]> emptyContents = new ArrayList<>(); + List<double[]> emptyContents = new ArrayList<double[]>(); emptyContents.add(emptyArray); emptyContents.add(classC); try { @@ -72,7 +72,7 @@ public class OneWayAnovaTest { // expected } - List<double[]> tooFew = new ArrayList<>(); + List<double[]> tooFew = new ArrayList<double[]>(); tooFew.add(classA); try { testStatistic.anovaFValue(tooFew); @@ -86,7 +86,7 @@ public class OneWayAnovaTest { @Test public void testAnovaPValue() { // Target comparison values computed using R version 2.6.0 (Linux version) - List<double[]> threeClasses = new ArrayList<>(); + List<double[]> threeClasses = new ArrayList<double[]>(); threeClasses.add(classA); threeClasses.add(classB); threeClasses.add(classC); @@ -94,7 +94,7 @@ public class OneWayAnovaTest { Assert.assertEquals("ANOVA P-value", 6.959446E-06, testStatistic.anovaPValue(threeClasses), 1E-12); - List<double[]> twoClasses = new ArrayList<>(); + List<double[]> twoClasses = new ArrayList<double[]>(); twoClasses.add(classA); twoClasses.add(classB); @@ -106,7 +106,7 @@ public class OneWayAnovaTest { @Test public void testAnovaPValueSummaryStatistics() { // Target comparison values computed using R version 2.6.0 (Linux version) - List<SummaryStatistics> threeClasses = new ArrayList<>(); + List<SummaryStatistics> threeClasses = new ArrayList<SummaryStatistics>(); SummaryStatistics statsA = new SummaryStatistics(); for (double a : classA) { statsA.addValue(a); @@ -126,7 +126,7 @@ public class OneWayAnovaTest { Assert.assertEquals("ANOVA P-value", 6.959446E-06, testStatistic.anovaPValue(threeClasses, true), 1E-12); - List<SummaryStatistics> twoClasses = new ArrayList<>(); + List<SummaryStatistics> twoClasses = new ArrayList<SummaryStatistics>(); twoClasses.add(statsA); twoClasses.add(statsB); @@ -138,14 +138,14 @@ public class OneWayAnovaTest { @Test public void testAnovaTest() { // Target comparison values computed using R version 2.3.1 (Linux version) - List<double[]> threeClasses = new ArrayList<>(); + List<double[]> threeClasses = new ArrayList<double[]>(); threeClasses.add(classA); threeClasses.add(classB); threeClasses.add(classC); Assert.assertTrue("ANOVA Test P<0.01", testStatistic.anovaTest(threeClasses, 0.01)); - List<double[]> twoClasses = new ArrayList<>(); + List<double[]> twoClasses = new ArrayList<double[]>(); twoClasses.add(classA); twoClasses.add(classB); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/stat/inference/TestUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/stat/inference/TestUtilsTest.java b/src/test/java/org/apache/commons/math4/stat/inference/TestUtilsTest.java index 59914e0..b22131e 100644 --- a/src/test/java/org/apache/commons/math4/stat/inference/TestUtilsTest.java +++ b/src/test/java/org/apache/commons/math4/stat/inference/TestUtilsTest.java @@ -457,7 +457,7 @@ public class TestUtilsTest { private double[] classC = {110.0, 115.0, 111.0, 117.0, 128.0}; - private List<double[]> classes = new ArrayList<>(); + private List<double[]> classes = new ArrayList<double[]>(); private OneWayAnova oneWayAnova = new OneWayAnova(); @Test http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java b/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java index 1dd31ce..fece225 100644 --- a/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java +++ b/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java @@ -125,7 +125,7 @@ public class ArithmeticUtilsTest { @Test public void testGcdConsistency() { int[] primeList = {19, 23, 53, 67, 73, 79, 101, 103, 111, 131}; - ArrayList<Integer> primes = new ArrayList<>(); + ArrayList<Integer> primes = new ArrayList<Integer>(); for (int i = 0; i < primeList.length; i++) { primes.add(Integer.valueOf(primeList[i])); } http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/util/CombinatoricsUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/util/CombinatoricsUtilsTest.java b/src/test/java/org/apache/commons/math4/util/CombinatoricsUtilsTest.java index faaf786..0ad8a02 100644 --- a/src/test/java/org/apache/commons/math4/util/CombinatoricsUtilsTest.java +++ b/src/test/java/org/apache/commons/math4/util/CombinatoricsUtilsTest.java @@ -38,7 +38,7 @@ import org.junit.Test; public class CombinatoricsUtilsTest { /** cached binomial coefficients */ - private static final List<Map<Integer, Long>> binomialCache = new ArrayList<>(); + private static final List<Map<Integer, Long>> binomialCache = new ArrayList<Map<Integer, Long>>(); /** Verify that b(0,0) = 1 */ @Test http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java b/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java index d38d42e..77a0c7c 100644 --- a/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java +++ b/src/test/java/org/apache/commons/math4/util/FastMathStrictComparisonTest.java @@ -212,7 +212,7 @@ public class FastMathStrictComparisonTest { @Parameters public static List<Object[]> data() throws Exception { String singleMethod = System.getProperty("testMethod"); - List<Object[]> list = new ArrayList<>(); + List<Object[]> list = new ArrayList<Object[]>(); for(Method mathMethod : StrictMath.class.getDeclaredMethods()) { method: if (Modifier.isPublic(mathMethod.getModifiers())){// Only test public methods http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/util/IntegerSequenceTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/util/IntegerSequenceTest.java b/src/test/java/org/apache/commons/math4/util/IntegerSequenceTest.java index 4b29906..25eec4f 100644 --- a/src/test/java/org/apache/commons/math4/util/IntegerSequenceTest.java +++ b/src/test/java/org/apache/commons/math4/util/IntegerSequenceTest.java @@ -33,7 +33,7 @@ public class IntegerSequenceTest { final int max = 7; final int step = 2; - final List<Integer> seq = new ArrayList<>(); + final List<Integer> seq = new ArrayList<Integer>(); final IntegerSequence.Range r = IntegerSequence.range(start, max, step); final int numTimes = 3; @@ -53,7 +53,7 @@ public class IntegerSequenceTest { final int max = 7; final int step = 2; - final List<Integer> seq = new ArrayList<>(); + final List<Integer> seq = new ArrayList<Integer>(); final IntegerSequence.Range r = IntegerSequence.range(start, max, step); for (Integer i : r) { seq.add(i); @@ -72,7 +72,7 @@ public class IntegerSequenceTest { final int max = -1; final int step = 2; - final List<Integer> seq = new ArrayList<>(); + final List<Integer> seq = new ArrayList<Integer>(); final IntegerSequence.Range r = IntegerSequence.range(start, max, step); for (Integer i : r) { seq.add(i); @@ -91,7 +91,7 @@ public class IntegerSequenceTest { final int max = -8; final int step = -3; - final List<Integer> seq = new ArrayList<>(); + final List<Integer> seq = new ArrayList<Integer>(); final IntegerSequence.Range r = IntegerSequence.range(start, max, step); for (Integer i : r) { seq.add(i); @@ -110,7 +110,7 @@ public class IntegerSequenceTest { final int max = 1; final int step = -1; - final List<Integer> seq = new ArrayList<>(); + final List<Integer> seq = new ArrayList<Integer>(); final IntegerSequence.Range r = IntegerSequence.range(start, max, step); for (Integer i : r) { seq.add(i); @@ -126,7 +126,7 @@ public class IntegerSequenceTest { final int start = -2; final int end = 4; - final List<Integer> seq = new ArrayList<>(); + final List<Integer> seq = new ArrayList<Integer>(); for (Integer i : IntegerSequence.range(start, end)) { seq.add(i); } @@ -141,7 +141,7 @@ public class IntegerSequenceTest { final int start = 2; final int end = 0; - final List<Integer> seq = new ArrayList<>(); + final List<Integer> seq = new ArrayList<Integer>(); final IntegerSequence.Range r = IntegerSequence.range(start, end); for (Integer i : r) { seq.add(i); @@ -157,7 +157,7 @@ public class IntegerSequenceTest { final int max = -1; final int step = -1; - final List<Integer> seq = new ArrayList<>(); + final List<Integer> seq = new ArrayList<Integer>(); final IntegerSequence.Range r = IntegerSequence.range(start, max, step); for (Integer i : r) { seq.add(i); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/util/OpenIntToDoubleHashMapTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/util/OpenIntToDoubleHashMapTest.java b/src/test/java/org/apache/commons/math4/util/OpenIntToDoubleHashMapTest.java index eea8560..0841868 100644 --- a/src/test/java/org/apache/commons/math4/util/OpenIntToDoubleHashMapTest.java +++ b/src/test/java/org/apache/commons/math4/util/OpenIntToDoubleHashMapTest.java @@ -37,7 +37,7 @@ import org.junit.Test; @SuppressWarnings("boxing") public class OpenIntToDoubleHashMapTest { - private Map<Integer, Double> javaMap = new HashMap<>(); + private Map<Integer, Double> javaMap = new HashMap<Integer, Double>(); @Before public void setUp() throws Exception { @@ -60,7 +60,7 @@ public class OpenIntToDoubleHashMapTest { } private Map<Integer, Double> generate() { - Map<Integer, Double> map = new HashMap<>(); + Map<Integer, Double> map = new HashMap<Integer, Double>(); Random r = new Random(); for (int i = 0; i < 2000; ++i) map.put(r.nextInt(), r.nextDouble()); @@ -168,7 +168,7 @@ public class OpenIntToDoubleHashMapTest { OpenIntToDoubleHashMap map = createFromJavaMap(); int mapSize = javaMap.size(); int count = 0; - Set<Integer> keysInMap = new HashSet<>(javaMap.keySet()); + Set<Integer> keysInMap = new HashSet<Integer>(javaMap.keySet()); for (Map.Entry<Integer, Double> mapEntry : javaMap.entrySet()) { keysInMap.remove(mapEntry.getKey()); map.remove(mapEntry.getKey()); @@ -206,7 +206,7 @@ public class OpenIntToDoubleHashMapTest { * Returns a map with at least 100 elements where each element is absent from javaMap. */ private Map<Integer, Double> generateAbsent() { - Map<Integer, Double> generated = new HashMap<>(); + Map<Integer, Double> generated = new HashMap<Integer, Double>(); do { generated.putAll(generate()); for (Integer key : javaMap.keySet()) http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/util/OpenIntToFieldTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/util/OpenIntToFieldTest.java b/src/test/java/org/apache/commons/math4/util/OpenIntToFieldTest.java index d7de53c..6df12dd 100644 --- a/src/test/java/org/apache/commons/math4/util/OpenIntToFieldTest.java +++ b/src/test/java/org/apache/commons/math4/util/OpenIntToFieldTest.java @@ -38,7 +38,7 @@ import org.junit.Test; @SuppressWarnings("boxing") public class OpenIntToFieldTest { - private Map<Integer, Fraction> javaMap = new HashMap<>(); + private Map<Integer, Fraction> javaMap = new HashMap<Integer, Fraction>(); private FractionField field = FractionField.getInstance(); @Before @@ -62,7 +62,7 @@ public class OpenIntToFieldTest { } private Map<Integer, Fraction> generate() { - Map<Integer, Fraction> map = new HashMap<>(); + Map<Integer, Fraction> map = new HashMap<Integer, Fraction>(); Random r = new Random(); double dd=0; for (int i = 0; i < 2000; ++i) @@ -76,7 +76,7 @@ public class OpenIntToFieldTest { } private OpenIntToFieldHashMap<Fraction> createFromJavaMap(Field<Fraction> field) { - OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<>(field); + OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<Fraction>(field); for (Map.Entry<Integer, Fraction> mapEntry : javaMap.entrySet()) { map.put(mapEntry.getKey(), mapEntry.getValue()); } @@ -85,19 +85,19 @@ public class OpenIntToFieldTest { @Test public void testPutAndGetWith0ExpectedSize() { - OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<>(field,0); + OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<Fraction>(field,0); assertPutAndGet(map); } @Test public void testPutAndGetWithExpectedSize() { - OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<>(field,500); + OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<Fraction>(field,500); assertPutAndGet(map); } @Test public void testPutAndGet() { - OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<>(field); + OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<Fraction>(field); assertPutAndGet(map); } @@ -149,7 +149,7 @@ public class OpenIntToFieldTest { @Test public void testGetFromEmpty() { - OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<>(field); + OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<Fraction>(field); Assert.assertTrue(field.getZero().equals(map.get(5))); Assert.assertTrue(field.getZero().equals(map.get(0))); Assert.assertTrue(field.getZero().equals(map.get(50))); @@ -176,7 +176,7 @@ public class OpenIntToFieldTest { OpenIntToFieldHashMap<Fraction> map = createFromJavaMap(field); int mapSize = javaMap.size(); int count = 0; - Set<Integer> keysInMap = new HashSet<>(javaMap.keySet()); + Set<Integer> keysInMap = new HashSet<Integer>(javaMap.keySet()); for (Map.Entry<Integer, Fraction> mapEntry : javaMap.entrySet()) { keysInMap.remove(mapEntry.getKey()); map.remove(mapEntry.getKey()); @@ -192,7 +192,7 @@ public class OpenIntToFieldTest { @Test public void testRemoveFromEmpty() { - OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<>(field); + OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<Fraction>(field); Assert.assertTrue(field.getZero().equals(map.remove(50))); } @@ -214,7 +214,7 @@ public class OpenIntToFieldTest { * Returns a map with at least 100 elements where each element is absent from javaMap. */ private Map<Integer, Fraction> generateAbsent() { - Map<Integer, Fraction> generated = new HashMap<>(); + Map<Integer, Fraction> generated = new HashMap<Integer, Fraction>(); do { generated.putAll(generate()); for (Integer key : javaMap.keySet()) @@ -226,7 +226,7 @@ public class OpenIntToFieldTest { @Test public void testCopy() { OpenIntToFieldHashMap<Fraction> copy = - new OpenIntToFieldHashMap<>(createFromJavaMap(field)); + new OpenIntToFieldHashMap<Fraction>(createFromJavaMap(field)); Assert.assertEquals(javaMap.size(), copy.size()); for (Map.Entry<Integer, Fraction> mapEntry : javaMap.entrySet()) @@ -292,7 +292,7 @@ public class OpenIntToFieldTest { */ @Test public void testPutKeysWithCollisions() { - OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<>(field); + OpenIntToFieldHashMap<Fraction> map = new OpenIntToFieldHashMap<Fraction>(field); int key1 = -1996012590; Fraction value1 = new Fraction(1); map.put(key1, value1); @@ -316,7 +316,7 @@ public class OpenIntToFieldTest { */ @Test public void testPutKeysWithCollision2() { - OpenIntToFieldHashMap<Fraction>map = new OpenIntToFieldHashMap<>(field); + OpenIntToFieldHashMap<Fraction>map = new OpenIntToFieldHashMap<Fraction>(field); int key1 = 837989881; Fraction value1 = new Fraction(1); map.put(key1, value1); http://git-wip-us.apache.org/repos/asf/commons-math/blob/6df150da/src/test/java/org/apache/commons/math4/util/PairTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/util/PairTest.java b/src/test/java/org/apache/commons/math4/util/PairTest.java index ba6798e..904c93c 100644 --- a/src/test/java/org/apache/commons/math4/util/PairTest.java +++ b/src/test/java/org/apache/commons/math4/util/PairTest.java @@ -25,7 +25,7 @@ public class PairTest { @Test public void testAccessor() { final Pair<Integer, Double> p - = new Pair<>(new Integer(1), new Double(2)); + = new Pair<Integer, Double>(new Integer(1), new Double(2)); Assert.assertEquals(new Integer(1), p.getKey()); Assert.assertEquals(2, p.getValue().doubleValue(), Math.ulp(1d)); } @@ -33,7 +33,7 @@ public class PairTest { @Test public void testAccessor2() { final Pair<Integer, Double> p - = new Pair<>(new Integer(1), new Double(2)); + = new Pair<Integer, Double>(new Integer(1), new Double(2)); // Check that both APIs refer to the same data. @@ -43,19 +43,19 @@ public class PairTest { @Test public void testEquals() { - Pair<Integer, Double> p1 = new Pair<>(null, null); + Pair<Integer, Double> p1 = new Pair<Integer, Double>(null, null); Assert.assertFalse(p1.equals(null)); - Pair<Integer, Double> p2 = new Pair<>(null, null); + Pair<Integer, Double> p2 = new Pair<Integer, Double>(null, null); Assert.assertTrue(p1.equals(p2)); - p1 = new Pair<>(new Integer(1), new Double(2)); + p1 = new Pair<Integer, Double>(new Integer(1), new Double(2)); Assert.assertFalse(p1.equals(p2)); - p2 = new Pair<>(new Integer(1), new Double(2)); + p2 = new Pair<Integer, Double>(new Integer(1), new Double(2)); Assert.assertTrue(p1.equals(p2)); - Pair<Integer, Float> p3 = new Pair<>(new Integer(1), new Float(2)); + Pair<Integer, Float> p3 = new Pair<Integer, Float>(new Integer(1), new Float(2)); Assert.assertFalse(p1.equals(p3)); } @@ -64,8 +64,8 @@ public class PairTest { final MyInteger m1 = new MyInteger(1); final MyInteger m2 = new MyInteger(1); - final Pair<MyInteger, MyInteger> p1 = new Pair<>(m1, m1); - final Pair<MyInteger, MyInteger> p2 = new Pair<>(m2, m2); + final Pair<MyInteger, MyInteger> p1 = new Pair<MyInteger, MyInteger>(m1, m1); + final Pair<MyInteger, MyInteger> p2 = new Pair<MyInteger, MyInteger>(m2, m2); // Same contents, same hash code. Assert.assertTrue(p1.hashCode() == p2.hashCode()); @@ -76,15 +76,15 @@ public class PairTest { @Test public void testToString() { - Assert.assertEquals("[null, null]", new Pair<>(null, null).toString()); - Assert.assertEquals("[foo, 3]", new Pair<>("foo", 3).toString()); + Assert.assertEquals("[null, null]", new Pair<Object, Object>(null, null).toString()); + Assert.assertEquals("[foo, 3]", new Pair<String, Integer>("foo", 3).toString()); } @Test public void testCreate() { final Pair<String, Integer> p1 = Pair.create("foo", 3); Assert.assertNotNull(p1); - final Pair<String, Integer> p2 = new Pair<>("foo", 3); + final Pair<String, Integer> p2 = new Pair<String, Integer>("foo", 3); Assert.assertEquals(p2, p1); }