Fixed syntax incompatible with Java 5.

This commit is contained in:
Luc Maisonobe 2016-01-06 12:41:40 +01:00
parent 7a1c10a162
commit 277321564d
5 changed files with 20 additions and 20 deletions

View File

@ -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;

View File

@ -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> {

View File

@ -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);
}

View File

@ -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);

View File

@ -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());
}
}