commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject [27/50] [abbrv] [math] Fixed syntax incompatible with Java 5.
Date Wed, 06 Jan 2016 13:50:43 GMT
Fixed syntax incompatible with Java 5.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/27732156
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/27732156
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/27732156

Branch: refs/heads/master
Commit: 277321564dd18c68fce97594652d5aea50ff221c
Parents: 7a1c10a
Author: Luc Maisonobe <luc@apache.org>
Authored: Wed Jan 6 12:41:40 2016 +0100
Committer: Luc Maisonobe <luc@apache.org>
Committed: Wed Jan 6 12:41:40 2016 +0100

----------------------------------------------------------------------
 .../commons/math4/ode/FieldExpandableODE.java       |  2 +-
 ...stractEmbeddedRungeKuttaFieldIntegratorTest.java | 16 ++++++++--------
 .../AbstractRungeKuttaFieldIntegratorTest.java      | 14 +++++++-------
 ...AbstractRungeKuttaFieldStepInterpolatorTest.java |  6 +++---
 .../ode/sampling/StepInterpolatorTestUtils.java     |  2 +-
 5 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/27732156/src/main/java/org/apache/commons/math4/ode/FieldExpandableODE.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/ode/FieldExpandableODE.java b/src/main/java/org/apache/commons/math4/ode/FieldExpandableODE.java
index 882f93c..2a8d6c0 100644
--- a/src/main/java/org/apache/commons/math4/ode/FieldExpandableODE.java
+++ b/src/main/java/org/apache/commons/math4/ode/FieldExpandableODE.java
@@ -92,7 +92,7 @@ public class FieldExpandableODE<T extends RealFieldElement<T>>
{
     public int addSecondaryEquations(final FieldSecondaryEquations<T> secondary) {
 
         components.add(secondary);
-        mapper = new FieldEquationsMapper<>(mapper, secondary.getDimension());
+        mapper = new FieldEquationsMapper<T>(mapper, secondary.getDimension());
 
         return components.size() - 1;
 

http://git-wip-us.apache.org/repos/asf/commons-math/blob/27732156/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java
b/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java
index 3f2b0be..26a7364 100644
--- a/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java
+++ b/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java
@@ -151,7 +151,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
         EmbeddedRungeKuttaFieldIntegrator<T> integrator = createIntegrator(field, 0.0,
1.0, 1.0e-10, 1.0e-10);
 
         try  {
-            integrator.integrate(new FieldExpandableODE<>(equations),
+            integrator.integrate(new FieldExpandableODE<T>(equations),
                                  new FieldODEState<T>(field.getOne().negate(),
                                                       MathArrays.buildArray(field, 1)),
                                  field.getZero());
@@ -161,7 +161,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
           }
 
           try  {
-              integrator.integrate(new FieldExpandableODE<>(equations),
+              integrator.integrate(new FieldExpandableODE<T>(equations),
                                    new FieldODEState<T>(field.getZero(),
                                                         MathArrays.buildArray(field, 1)),
                                    field.getOne());
@@ -191,7 +191,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
                                                               vecAbsoluteTolerance, vecRelativeTolerance);
         TestFieldProblemHandler<T> handler = new TestFieldProblemHandler<T>(pb,
integ);
         integ.addStepHandler(handler);
-        integ.integrate(new FieldExpandableODE<>(pb), pb.getInitialState(), pb.getFinalTime());
+        integ.integrate(new FieldExpandableODE<T>(pb), pb.getInitialState(), pb.getFinalTime());
         Assert.fail("an exception should have been thrown");
 
     }
@@ -352,7 +352,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
             EmbeddedRungeKuttaFieldIntegrator<T> integrator = createIntegrator(field,
0,
                                                                                pb.getFinalTime().subtract(pb.getInitialState().getTime()).getReal(),
                                                                                new double[4],
new double[4]);
-            integrator.integrate(new FieldExpandableODE<>(pb),
+            integrator.integrate(new FieldExpandableODE<T>(pb),
                                  new FieldODEState<T>(pb.getInitialState().getTime(),
                                                       MathArrays.buildArray(field, 6)),
                                  pb.getFinalTime());
@@ -364,7 +364,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
                             createIntegrator(field, 0,
                                              pb.getFinalTime().subtract(pb.getInitialState().getTime()).getReal(),
                                              new double[2], new double[4]);
-            integrator.integrate(new FieldExpandableODE<>(pb), pb.getInitialState(),
pb.getFinalTime());
+            integrator.integrate(new FieldExpandableODE<T>(pb), pb.getInitialState(),
pb.getFinalTime());
             Assert.fail("an exception should have been thrown");
         } catch(DimensionMismatchException ie) {
         }
@@ -373,7 +373,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
                             createIntegrator(field, 0,
                                              pb.getFinalTime().subtract(pb.getInitialState().getTime()).getReal(),
                                              new double[4], new double[4]);
-            integrator.integrate(new FieldExpandableODE<>(pb), pb.getInitialState(),
pb.getInitialState().getTime());
+            integrator.integrate(new FieldExpandableODE<T>(pb), pb.getInitialState(),
pb.getInitialState().getTime());
             Assert.fail("an exception should have been thrown");
         } catch(NumberIsTooSmallException ie) {
         }
@@ -401,7 +401,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
                                                                       scalRelativeTolerance);
         TestFieldProblemHandler<T> handler = new TestFieldProblemHandler<T>(pb,
integ);
         integ.addStepHandler(handler);
-        integ.integrate(new FieldExpandableODE<>(pb), pb.getInitialState(), pb.getFinalTime());
+        integ.integrate(new FieldExpandableODE<T>(pb), pb.getInitialState(), pb.getFinalTime());
 
         Assert.assertEquals(0, handler.getLastError().getReal(),         espilonLast);
         Assert.assertEquals(0, handler.getMaximalValueError().getReal(), epsilonMaxValue);
@@ -424,7 +424,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
         FieldFirstOrderIntegrator<T> integ = createIntegrator(field, minStep, maxStep,
                                                               vecAbsoluteTolerance, vecRelativeTolerance);
         integ.addStepHandler(new KeplerHandler<T>(pb, epsilon));
-        integ.integrate(new FieldExpandableODE<>(pb), pb.getInitialState(), pb.getFinalTime());
+        integ.integrate(new FieldExpandableODE<T>(pb), pb.getInitialState(), pb.getFinalTime());
     }
 
     private static class KeplerHandler<T extends RealFieldElement<T>> implements
FieldStepHandler<T> {

http://git-wip-us.apache.org/repos/asf/commons-math/blob/27732156/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java
b/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java
index cc66cd1..80d6251 100644
--- a/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java
+++ b/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java
@@ -201,7 +201,7 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
         RungeKuttaFieldIntegrator<T> integrator = createIntegrator(field, field.getZero().add(0.01));
         try  {
             TestFieldProblem1<T> pb = new TestFieldProblem1<T>(field);
-            integrator.integrate(new FieldExpandableODE<>(pb),
+            integrator.integrate(new FieldExpandableODE<T>(pb),
                                  new FieldODEState<T>(field.getZero(), MathArrays.buildArray(field,
pb.getDimension() + 10)),
                                  field.getOne());
             Assert.fail("an exception should have been thrown");
@@ -209,7 +209,7 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
         }
         try  {
             TestFieldProblem1<T> pb = new TestFieldProblem1<T>(field);
-            integrator.integrate(new FieldExpandableODE<>(pb),
+            integrator.integrate(new FieldExpandableODE<T>(pb),
                                  new FieldODEState<T>(field.getZero(), MathArrays.buildArray(field,
pb.getDimension())),
                                  field.getZero());
             Assert.fail("an exception should have been thrown");
@@ -349,7 +349,7 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
         RungeKuttaFieldIntegrator<T> integ = createIntegrator(field, step);
         TestFieldProblemHandler<T> handler = new TestFieldProblemHandler<T>(pb,
integ);
         integ.addStepHandler(handler);
-        integ.integrate(new FieldExpandableODE<>(pb), pb.getInitialState(), pb.getFinalTime());
+        integ.integrate(new FieldExpandableODE<T>(pb), pb.getInitialState(), pb.getFinalTime());
 
         Assert.assertEquals(0, handler.getLastError().getReal(),         espilonLast);
         Assert.assertEquals(0, handler.getMaximalValueError().getReal(), epsilonMaxValue);
@@ -370,7 +370,7 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
 
         RungeKuttaFieldIntegrator<T> integ = createIntegrator(field, step);
         integ.addStepHandler(new KeplerHandler<T>(pb, expectedMaxError, epsilon));
-        integ.integrate(new FieldExpandableODE<>(pb), pb.getInitialState(), pb.getFinalTime());
+        integ.integrate(new FieldExpandableODE<T>(pb), pb.getInitialState(), pb.getFinalTime());
     }
 
     private static class KeplerHandler<T extends RealFieldElement<T>> implements
FieldStepHandler<T> {
@@ -488,7 +488,7 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
 
         };
 
-        integ.integrate(new FieldExpandableODE<>(equations), new FieldODEState<T>(t0,
y0), t);
+        integ.integrate(new FieldExpandableODE<T>(equations), new FieldODEState<T>(t0,
y0), t);
 
     }
 
@@ -502,8 +502,8 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
                                                                       field.getZero().add(2.0));
       RungeKuttaFieldIntegrator<T> integ = createIntegrator(field, field.getZero().add(0.3));
       integ.addEventHandler(stepProblem, 1.0, 1.0e-12, 1000);
-      FieldODEStateAndDerivative<T> result = integ.integrate(new FieldExpandableODE<>(stepProblem),
-                                                             new FieldODEState<>(field.getZero(),
MathArrays.buildArray(field, 1)),
+      FieldODEStateAndDerivative<T> result = integ.integrate(new FieldExpandableODE<T>(stepProblem),
+                                                             new FieldODEState<T>(field.getZero(),
MathArrays.buildArray(field, 1)),
                                                              field.getZero().add(10.0));
       Assert.assertEquals(8.0, result.getState()[0].getReal(), epsilon);
     }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/27732156/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldStepInterpolatorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldStepInterpolatorTest.java
b/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldStepInterpolatorTest.java
index 64e91a2..4716b81 100644
--- a/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldStepInterpolatorTest.java
+++ b/src/test/java/org/apache/commons/math4/ode/nonstiff/AbstractRungeKuttaFieldStepInterpolatorTest.java
@@ -46,7 +46,7 @@ public abstract class AbstractRungeKuttaFieldStepInterpolatorTest {
     protected <T extends RealFieldElement<T>> void doInterpolationAtBounds(final
Field<T> field, double epsilon) {
 
         RungeKuttaFieldStepInterpolator<T> interpolator = setUpInterpolator(field,
-                                                                            new SinCos<>(field),
+                                                                            new SinCos<T>(field),
                                                                             0.0, new double[]
{ 0.0, 1.0 }, 0.125);
 
         Assert.assertEquals(0.0, interpolator.getPreviousState().getTime().getReal(), 1.0e-15);
@@ -71,7 +71,7 @@ public abstract class AbstractRungeKuttaFieldStepInterpolatorTest {
                                                                          double epsilonSin,
double epsilonCos) {
 
         RungeKuttaFieldStepInterpolator<T> interpolator = setUpInterpolator(field,
-                                                                            new SinCos<>(field),
+                                                                            new SinCos<T>(field),
                                                                             0.0, new double[]
{ 0.0, 1.0 }, 0.0125);
 
         int n = 100;
@@ -97,7 +97,7 @@ public abstract class AbstractRungeKuttaFieldStepInterpolatorTest {
                                                                                      double
epsilonSin, double epsilonCos,
                                                                                      double
epsilonSinDot, double epsilonCosDot) {
 
-        FieldFirstOrderDifferentialEquations<T> eqn = new SinCos<>(field);
+        FieldFirstOrderDifferentialEquations<T> eqn = new SinCos<T>(field);
         RungeKuttaFieldStepInterpolator<T> fieldInterpolator =
                         setUpInterpolator(field, eqn, 0.0, new double[] { 0.0, 1.0 }, 0.125);
         RungeKuttaStepInterpolator regularInterpolator = convertInterpolator(fieldInterpolator,
eqn);

http://git-wip-us.apache.org/repos/asf/commons-math/blob/27732156/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 98d799c..9798b9d 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());
 
     }
 }


Mime
View raw message