Fix compilation problems with java 1.5: remove @Override tags for interfaces, fix problem with cast, remove unneeded type parameters in test methods. Additionally, added @Override tags for implemented abstract methods as suggested by eclipse, small typo fixes.

This commit is contained in:
Thomas Neidhart 2015-12-29 20:47:31 +01:00
parent df1ce13f97
commit 56a6287761
41 changed files with 30 additions and 75 deletions

View File

@ -124,7 +124,6 @@ public class MicrosphereProjectionInterpolator
* @throws DimensionMismatchException if the space dimension of the * @throws DimensionMismatchException if the space dimension of the
* given samples does not match the space dimension of the microsphere. * given samples does not match the space dimension of the microsphere.
*/ */
@Override
public MultivariateFunction interpolate(final double[][] xval, public MultivariateFunction interpolate(final double[][] xval,
final double[] yval) final double[] yval)
throws DimensionMismatchException, throws DimensionMismatchException,
@ -153,7 +152,6 @@ public class MicrosphereProjectionInterpolator
return new MultivariateFunction() { return new MultivariateFunction() {
/** {inheritDoc} */ /** {inheritDoc} */
@Override
public double value(double[] point) { public double value(double[] point) {
return m.value(point, return m.value(point,
xval, xval,

View File

@ -108,7 +108,6 @@ public class PolynomialsUtils {
/** Fixed recurrence coefficients. */ /** Fixed recurrence coefficients. */
private final BigFraction[] coeffs = { BigFraction.ZERO, BigFraction.TWO, BigFraction.ONE }; private final BigFraction[] coeffs = { BigFraction.ZERO, BigFraction.TWO, BigFraction.ONE };
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public BigFraction[] generate(int k) { public BigFraction[] generate(int k) {
return coeffs; return coeffs;
} }
@ -134,7 +133,6 @@ public class PolynomialsUtils {
return buildPolynomial(degree, HERMITE_COEFFICIENTS, return buildPolynomial(degree, HERMITE_COEFFICIENTS,
new RecurrenceCoefficientsGenerator() { new RecurrenceCoefficientsGenerator() {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public BigFraction[] generate(int k) { public BigFraction[] generate(int k) {
return new BigFraction[] { return new BigFraction[] {
BigFraction.ZERO, BigFraction.ZERO,
@ -162,7 +160,6 @@ public class PolynomialsUtils {
return buildPolynomial(degree, LAGUERRE_COEFFICIENTS, return buildPolynomial(degree, LAGUERRE_COEFFICIENTS,
new RecurrenceCoefficientsGenerator() { new RecurrenceCoefficientsGenerator() {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public BigFraction[] generate(int k) { public BigFraction[] generate(int k) {
final int kP1 = k + 1; final int kP1 = k + 1;
return new BigFraction[] { return new BigFraction[] {
@ -191,7 +188,6 @@ public class PolynomialsUtils {
return buildPolynomial(degree, LEGENDRE_COEFFICIENTS, return buildPolynomial(degree, LEGENDRE_COEFFICIENTS,
new RecurrenceCoefficientsGenerator() { new RecurrenceCoefficientsGenerator() {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public BigFraction[] generate(int k) { public BigFraction[] generate(int k) {
final int kP1 = k + 1; final int kP1 = k + 1;
return new BigFraction[] { return new BigFraction[] {
@ -243,7 +239,6 @@ public class PolynomialsUtils {
return buildPolynomial(degree, JACOBI_COEFFICIENTS.get(key), return buildPolynomial(degree, JACOBI_COEFFICIENTS.get(key),
new RecurrenceCoefficientsGenerator() { new RecurrenceCoefficientsGenerator() {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public BigFraction[] generate(int k) { public BigFraction[] generate(int k) {
k++; k++;
final int kvw = k + v + w; final int kvw = k + v + w;

View File

@ -138,7 +138,6 @@ public class BracketingNthOrderBrentSolverDFP extends FieldBracketingNthOrderBre
RealFieldUnivariateFunction<Dfp> fieldF = new RealFieldUnivariateFunction<Dfp>() { RealFieldUnivariateFunction<Dfp> fieldF = new RealFieldUnivariateFunction<Dfp>() {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public Dfp value(final Dfp x) { public Dfp value(final Dfp x) {
return f.value(x); return f.value(x);
} }

View File

@ -137,6 +137,7 @@ public class ZipfDistribution extends AbstractIntegerDistribution {
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public double logProbability(int x) { public double logProbability(int x) {
if (x <= 0 || x > numberOfElements) { if (x <= 0 || x > numberOfElements) {
return Double.NEGATIVE_INFINITY; return Double.NEGATIVE_INFINITY;
@ -277,6 +278,7 @@ public class ZipfDistribution extends AbstractIntegerDistribution {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
public int sample() { public int sample() {
if (sampler == null) { if (sampler == null) {
sampler = new ZipfRejectionInversionSampler(numberOfElements, exponent); sampler = new ZipfRejectionInversionSampler(numberOfElements, exponent);

View File

@ -228,6 +228,7 @@ public class LeastSquaresFactory {
return new LeastSquaresAdapter(problem) { return new LeastSquaresAdapter(problem) {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public Evaluation evaluate(final RealVector point) { public Evaluation evaluate(final RealVector point) {
counter.incrementCount(); counter.incrementCount();
return super.evaluate(point); return super.evaluate(point);

View File

@ -517,7 +517,6 @@ public class BigFraction
* @return a {@link BigFraction} instance with the resulting values. * @return a {@link BigFraction} instance with the resulting values.
* @throws NullArgumentException if the {@link BigFraction} is {@code null}. * @throws NullArgumentException if the {@link BigFraction} is {@code null}.
*/ */
@Override
public BigFraction add(final BigFraction fraction) { public BigFraction add(final BigFraction fraction) {
if (fraction == null) { if (fraction == null) {
throw new NullArgumentException(LocalizedFormats.FRACTION); throw new NullArgumentException(LocalizedFormats.FRACTION);
@ -613,7 +612,6 @@ public class BigFraction
* than {@code object}, 0 if they are equal. * than {@code object}, 0 if they are equal.
* @see java.lang.Comparable#compareTo(java.lang.Object) * @see java.lang.Comparable#compareTo(java.lang.Object)
*/ */
@Override
public int compareTo(final BigFraction object) { public int compareTo(final BigFraction object) {
int lhsSigNum = numerator.signum(); int lhsSigNum = numerator.signum();
int rhsSigNum = object.numerator.signum(); int rhsSigNum = object.numerator.signum();
@ -693,7 +691,6 @@ public class BigFraction
* @throws NullArgumentException if the {@code fraction} is {@code null}. * @throws NullArgumentException if the {@code fraction} is {@code null}.
* @throws MathArithmeticException if the fraction to divide by is zero * @throws MathArithmeticException if the fraction to divide by is zero
*/ */
@Override
public BigFraction divide(final BigFraction fraction) { public BigFraction divide(final BigFraction fraction) {
if (fraction == null) { if (fraction == null) {
throw new NullArgumentException(LocalizedFormats.FRACTION); throw new NullArgumentException(LocalizedFormats.FRACTION);
@ -921,7 +918,6 @@ public class BigFraction
* the {@code int} to multiply by. * the {@code int} to multiply by.
* @return a {@link BigFraction} instance with the resulting values. * @return a {@link BigFraction} instance with the resulting values.
*/ */
@Override
public BigFraction multiply(final int i) { public BigFraction multiply(final int i) {
if (i == 0 || numerator.signum() == 0) { if (i == 0 || numerator.signum() == 0) {
return ZERO; return ZERO;
@ -958,7 +954,6 @@ public class BigFraction
* @return a {@link BigFraction} instance with the resulting values. * @return a {@link BigFraction} instance with the resulting values.
* @throws NullArgumentException if {@code fraction} is {@code null}. * @throws NullArgumentException if {@code fraction} is {@code null}.
*/ */
@Override
public BigFraction multiply(final BigFraction fraction) { public BigFraction multiply(final BigFraction fraction) {
if (fraction == null) { if (fraction == null) {
throw new NullArgumentException(LocalizedFormats.FRACTION); throw new NullArgumentException(LocalizedFormats.FRACTION);
@ -979,7 +974,6 @@ public class BigFraction
* *
* @return the negation of this fraction. * @return the negation of this fraction.
*/ */
@Override
public BigFraction negate() { public BigFraction negate() {
return new BigFraction(numerator.negate(), denominator); return new BigFraction(numerator.negate(), denominator);
} }
@ -1096,7 +1090,6 @@ public class BigFraction
* *
* @return the reciprocal fraction. * @return the reciprocal fraction.
*/ */
@Override
public BigFraction reciprocal() { public BigFraction reciprocal() {
return new BigFraction(denominator, numerator); return new BigFraction(denominator, numerator);
} }
@ -1179,7 +1172,6 @@ public class BigFraction
* @return a {@link BigFraction} instance with the resulting values * @return a {@link BigFraction} instance with the resulting values
* @throws NullArgumentException if the {@code fraction} is {@code null}. * @throws NullArgumentException if the {@code fraction} is {@code null}.
*/ */
@Override
public BigFraction subtract(final BigFraction fraction) { public BigFraction subtract(final BigFraction fraction) {
if (fraction == null) { if (fraction == null) {
throw new NullArgumentException(LocalizedFormats.FRACTION); throw new NullArgumentException(LocalizedFormats.FRACTION);
@ -1227,7 +1219,6 @@ public class BigFraction
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public BigFractionField getField() { public BigFractionField getField() {
return BigFractionField.getInstance(); return BigFractionField.getInstance();
} }

View File

@ -48,7 +48,7 @@ public class RegionFactory<S extends Space> {
* @param hyperplanes collection of bounding hyperplanes * @param hyperplanes collection of bounding hyperplanes
* @return a new convex region, or null if the collection is empty * @return a new convex region, or null if the collection is empty
*/ */
public Region<S> buildConvex(@SuppressWarnings("unchecked") final Hyperplane<S> ... hyperplanes) { public Region<S> buildConvex(final Hyperplane<S> ... hyperplanes) {
if ((hyperplanes == null) || (hyperplanes.length == 0)) { if ((hyperplanes == null) || (hyperplanes.length == 0)) {
return null; return null;
} }

View File

@ -298,7 +298,6 @@ public class MapUtils {
static final Comparator<PairNeuronDouble> COMPARATOR static final Comparator<PairNeuronDouble> COMPARATOR
= new Comparator<PairNeuronDouble>() { = new Comparator<PairNeuronDouble>() {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public int compare(PairNeuronDouble o1, public int compare(PairNeuronDouble o1,
PairNeuronDouble o2) { PairNeuronDouble o2) {
return Double.compare(o1.value, o2.value); return Double.compare(o1.value, o2.value);

View File

@ -92,7 +92,6 @@ public class KohonenUpdateAction implements UpdateAction {
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
public void update(Network net, public void update(Network net,
double[] features) { double[] features) {
final long numCalls = numberOfCalls.incrementAndGet() - 1; final long numCalls = numberOfCalls.incrementAndGet() - 1;

View File

@ -40,7 +40,6 @@ public class QuantizationError implements MapDataVisualization {
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public double[][] computeImage(NeuronSquareMesh2D map, public double[][] computeImage(NeuronSquareMesh2D map,
Iterable<double[]> data) { Iterable<double[]> data) {
final int nR = map.getNumberOfRows(); final int nR = map.getNumberOfRows();

View File

@ -95,7 +95,6 @@ public abstract class AdamsFieldIntegrator<T extends RealFieldElement<T>> extend
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public abstract FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations, public abstract FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
final FieldODEState<T> initialState, final FieldODEState<T> initialState,
final T finalTime) final T finalTime)

View File

@ -115,6 +115,7 @@ class AdamsFieldStepInterpolator<T extends RealFieldElement<T>> extends Abstract
* @param newMapper equations mapper for the all equations * @param newMapper equations mapper for the all equations
* @return a new instance * @return a new instance
*/ */
@Override
protected AdamsFieldStepInterpolator<T> create(boolean newForward, protected AdamsFieldStepInterpolator<T> create(boolean newForward,
FieldODEStateAndDerivative<T> newGlobalPreviousState, FieldODEStateAndDerivative<T> newGlobalPreviousState,
FieldODEStateAndDerivative<T> newGlobalCurrentState, FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -189,6 +189,7 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
* @return Nordsieck transformer for the specified field and number of steps * @return Nordsieck transformer for the specified field and number of steps
* @param <T> the type of the field elements * @param <T> the type of the field elements
*/ */
@SuppressWarnings("unchecked")
public static <T extends RealFieldElement<T>> AdamsNordsieckFieldTransformer<T> public static <T extends RealFieldElement<T>> AdamsNordsieckFieldTransformer<T>
getInstance(final Field<T> field, final int nSteps) { getInstance(final Field<T> field, final int nSteps) {
synchronized(CACHE) { synchronized(CACHE) {
@ -199,13 +200,13 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
AdamsNordsieckFieldTransformer<? extends RealFieldElement<?>>>(); AdamsNordsieckFieldTransformer<? extends RealFieldElement<?>>>();
CACHE.put(nSteps, map); CACHE.put(nSteps, map);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("rawtypes") // use rawtype to avoid compilation problems with java 1.5
AdamsNordsieckFieldTransformer<T> t = (AdamsNordsieckFieldTransformer<T>) map.get(field); AdamsNordsieckFieldTransformer t = map.get(field);
if (t == null) { if (t == null) {
t = new AdamsNordsieckFieldTransformer<T>(field, nSteps); t = new AdamsNordsieckFieldTransformer<T>(field, nSteps);
map.put(field, t); map.put(field, (AdamsNordsieckFieldTransformer<T>) t);
} }
return t; return (AdamsNordsieckFieldTransformer<T>) t;
} }
} }

View File

@ -62,7 +62,6 @@ public class ClassicalRungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
final T[] c = MathArrays.buildArray(getField(), 3); final T[] c = MathArrays.buildArray(getField(), 3);
c[0] = getField().getOne().multiply(0.5); c[0] = getField().getOne().multiply(0.5);
@ -72,7 +71,6 @@ public class ClassicalRungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
final T[][] a = MathArrays.buildArray(getField(), 3, -1); final T[][] a = MathArrays.buildArray(getField(), 3, -1);
for (int i = 0; i < a.length; ++i) { for (int i = 0; i < a.length; ++i) {
@ -88,7 +86,6 @@ public class ClassicalRungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T[] b = MathArrays.buildArray(getField(), 4); final T[] b = MathArrays.buildArray(getField(), 4);
b[0] = fraction(1, 6); b[0] = fraction(1, 6);

View File

@ -82,6 +82,7 @@ class ClassicalRungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected ClassicalRungeKuttaFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected ClassicalRungeKuttaFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -130,7 +130,6 @@ public class DormandPrince54FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
final T[] c = MathArrays.buildArray(getField(), 6); final T[] c = MathArrays.buildArray(getField(), 6);
c[0] = fraction(1, 5); c[0] = fraction(1, 5);
@ -143,7 +142,6 @@ public class DormandPrince54FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
final T[][] a = MathArrays.buildArray(getField(), 6, -1); final T[][] a = MathArrays.buildArray(getField(), 6, -1);
for (int i = 0; i < a.length; ++i) { for (int i = 0; i < a.length; ++i) {
@ -174,7 +172,6 @@ public class DormandPrince54FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T[] b = MathArrays.buildArray(getField(), 7); final T[] b = MathArrays.buildArray(getField(), 7);
b[0] = fraction( 35, 384); b[0] = fraction( 35, 384);

View File

@ -107,6 +107,7 @@ class DormandPrince54FieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected DormandPrince54FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected DormandPrince54FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -191,7 +191,6 @@ public class DormandPrince853FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
final T sqrt6 = getField().getOne().multiply(6).sqrt(); final T sqrt6 = getField().getOne().multiply(6).sqrt();
@ -218,7 +217,6 @@ public class DormandPrince853FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
final T sqrt6 = getField().getOne().multiply(6).sqrt(); final T sqrt6 = getField().getOne().multiply(6).sqrt();
@ -371,7 +369,6 @@ public class DormandPrince853FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T[] b = MathArrays.buildArray(getField(), 16); final T[] b = MathArrays.buildArray(getField(), 16);
b[ 0] = fraction(104257, 1920240); b[ 0] = fraction(104257, 1920240);

View File

@ -188,6 +188,7 @@ class DormandPrince853FieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected DormandPrince853FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected DormandPrince853FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -213,7 +213,6 @@ public abstract class EmbeddedRungeKuttaFieldIntegrator<T extends RealFieldEleme
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations, public FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
final FieldODEState<T> initialState, final T finalTime) final FieldODEState<T> initialState, final T finalTime)
throws NumberIsTooSmallException, DimensionMismatchException, throws NumberIsTooSmallException, DimensionMismatchException,

View File

@ -64,19 +64,16 @@ public class EulerFieldIntegrator<T extends RealFieldElement<T>> extends RungeKu
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
return MathArrays.buildArray(getField(), 0); return MathArrays.buildArray(getField(), 0);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
return MathArrays.buildArray(getField(), 0, 0); return MathArrays.buildArray(getField(), 0, 0);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T[] b = MathArrays.buildArray(getField(), 1); final T[] b = MathArrays.buildArray(getField(), 1);
b[0] = getField().getOne(); b[0] = getField().getOne();

View File

@ -72,6 +72,7 @@ class EulerFieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected EulerFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected EulerFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -62,7 +62,6 @@ public class GillFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
final T[] c = MathArrays.buildArray(getField(), 3); final T[] c = MathArrays.buildArray(getField(), 3);
c[0] = fraction(1, 2); c[0] = fraction(1, 2);
@ -72,7 +71,6 @@ public class GillFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
final T two = getField().getZero().add(2); final T two = getField().getZero().add(2);
@ -92,7 +90,6 @@ public class GillFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T two = getField().getZero().add(2); final T two = getField().getZero().add(2);

View File

@ -90,6 +90,7 @@ class GillFieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected GillFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected GillFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -105,7 +105,6 @@ public class HighamHall54FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
final T[] c = MathArrays.buildArray(getField(), 6); final T[] c = MathArrays.buildArray(getField(), 6);
c[0] = fraction(2, 9); c[0] = fraction(2, 9);
@ -118,7 +117,6 @@ public class HighamHall54FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
final T[][] a = MathArrays.buildArray(getField(), 6, -1); final T[][] a = MathArrays.buildArray(getField(), 6, -1);
for (int i = 0; i < a.length; ++i) { for (int i = 0; i < a.length; ++i) {
@ -149,7 +147,6 @@ public class HighamHall54FieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T[] b = MathArrays.buildArray(getField(), 7); final T[] b = MathArrays.buildArray(getField(), 7);
b[0] = fraction( 1, 12); b[0] = fraction( 1, 12);

View File

@ -58,6 +58,7 @@ class HighamHall54FieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected HighamHall54FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected HighamHall54FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -71,7 +71,6 @@ public class LutherFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
final T q = getField().getZero().add(21).sqrt(); final T q = getField().getZero().add(21).sqrt();
final T[] c = MathArrays.buildArray(getField(), 6); final T[] c = MathArrays.buildArray(getField(), 6);
@ -85,7 +84,6 @@ public class LutherFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
final T q = getField().getZero().add(21).sqrt(); final T q = getField().getZero().add(21).sqrt();
final T[][] a = MathArrays.buildArray(getField(), 6, -1); final T[][] a = MathArrays.buildArray(getField(), 6, -1);
@ -117,7 +115,6 @@ public class LutherFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T[] b = MathArrays.buildArray(getField(), 7); final T[] b = MathArrays.buildArray(getField(), 7);

View File

@ -118,6 +118,7 @@ class LutherFieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected LutherFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected LutherFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -59,7 +59,6 @@ public class MidpointFieldIntegrator<T extends RealFieldElement<T>> extends Rung
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
final T[] c = MathArrays.buildArray(getField(), 1); final T[] c = MathArrays.buildArray(getField(), 1);
c[0] = getField().getOne().multiply(0.5); c[0] = getField().getOne().multiply(0.5);
@ -67,7 +66,6 @@ public class MidpointFieldIntegrator<T extends RealFieldElement<T>> extends Rung
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
final T[][] a = MathArrays.buildArray(getField(), 1, 1); final T[][] a = MathArrays.buildArray(getField(), 1, 1);
a[0][0] = fraction(1, 2); a[0][0] = fraction(1, 2);
@ -75,7 +73,6 @@ public class MidpointFieldIntegrator<T extends RealFieldElement<T>> extends Rung
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T[] b = MathArrays.buildArray(getField(), 2); final T[] b = MathArrays.buildArray(getField(), 2);
b[0] = getField().getZero(); b[0] = getField().getZero();

View File

@ -74,6 +74,7 @@ class MidpointFieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected MidpointFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected MidpointFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -111,7 +111,6 @@ public abstract class RungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
FieldEquationsMapper<T> mapper); FieldEquationsMapper<T> mapper);
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations, public FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
final FieldODEState<T> initialState, final T finalTime) final FieldODEState<T> initialState, final T finalTime)
throws NumberIsTooSmallException, DimensionMismatchException, throws NumberIsTooSmallException, DimensionMismatchException,

View File

@ -69,6 +69,7 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected RungeKuttaFieldStepInterpolator<T> create(boolean newForward, protected RungeKuttaFieldStepInterpolator<T> create(boolean newForward,
FieldODEStateAndDerivative<T> newGlobalPreviousState, FieldODEStateAndDerivative<T> newGlobalPreviousState,
FieldODEStateAndDerivative<T> newGlobalCurrentState, FieldODEStateAndDerivative<T> newGlobalCurrentState,
@ -103,7 +104,6 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
* @param coefficients coefficients to apply to the method staged derivatives * @param coefficients coefficients to apply to the method staged derivatives
* @return combined state * @return combined state
*/ */
@SafeVarargs
protected final T[] previousStateLinearCombination(final T ... coefficients) { protected final T[] previousStateLinearCombination(final T ... coefficients) {
return combine(getPreviousState().getState(), return combine(getPreviousState().getState(),
coefficients); coefficients);
@ -113,7 +113,6 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
* @param coefficients coefficients to apply to the method staged derivatives * @param coefficients coefficients to apply to the method staged derivatives
* @return combined state * @return combined state
*/ */
@SuppressWarnings("unchecked")
protected T[] currentStateLinearCombination(final T ... coefficients) { protected T[] currentStateLinearCombination(final T ... coefficients) {
return combine(getCurrentState().getState(), return combine(getCurrentState().getState(),
coefficients); coefficients);
@ -123,7 +122,6 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
* @param coefficients coefficients to apply to the method staged derivatives * @param coefficients coefficients to apply to the method staged derivatives
* @return combined state * @return combined state
*/ */
@SuppressWarnings("unchecked")
protected T[] derivativeLinearCombination(final T ... coefficients) { protected T[] derivativeLinearCombination(final T ... coefficients) {
return combine(MathArrays.buildArray(field, yDotK[0].length), coefficients); return combine(MathArrays.buildArray(field, yDotK[0].length), coefficients);
} }
@ -131,9 +129,8 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
/** Linearly combine arrays. /** Linearly combine arrays.
* @param a array to add to * @param a array to add to
* @param coefficients coefficients to apply to the method staged derivatives * @param coefficients coefficients to apply to the method staged derivatives
* @return a itself, as a conveniency for fluent API * @return a itself, as a convenience for fluent API
*/ */
@SuppressWarnings("unchecked")
private T[] combine(final T[] a, final T ... coefficients) { private T[] combine(final T[] a, final T ... coefficients) {
for (int i = 0; i < a.length; ++i) { for (int i = 0; i < a.length; ++i) {
for (int k = 0; k < coefficients.length; ++k) { for (int k = 0; k < coefficients.length; ++k) {

View File

@ -61,7 +61,6 @@ public class ThreeEighthesFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getC() { public T[] getC() {
final T[] c = MathArrays.buildArray(getField(), 3); final T[] c = MathArrays.buildArray(getField(), 3);
c[0] = fraction(1, 3); c[0] = fraction(1, 3);
@ -71,7 +70,6 @@ public class ThreeEighthesFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[][] getA() { public T[][] getA() {
final T[][] a = MathArrays.buildArray(getField(), 3, -1); final T[][] a = MathArrays.buildArray(getField(), 3, -1);
for (int i = 0; i < a.length; ++i) { for (int i = 0; i < a.length; ++i) {
@ -87,7 +85,6 @@ public class ThreeEighthesFieldIntegrator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public T[] getB() { public T[] getB() {
final T[] b = MathArrays.buildArray(getField(), 4); final T[] b = MathArrays.buildArray(getField(), 4);
b[0] = fraction(1, 8); b[0] = fraction(1, 8);

View File

@ -84,6 +84,7 @@ class ThreeEighthesFieldStepInterpolator<T extends RealFieldElement<T>>
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
protected ThreeEighthesFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK, protected ThreeEighthesFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
final FieldODEStateAndDerivative<T> newGlobalPreviousState, final FieldODEStateAndDerivative<T> newGlobalPreviousState,
final FieldODEStateAndDerivative<T> newGlobalCurrentState, final FieldODEStateAndDerivative<T> newGlobalCurrentState,

View File

@ -108,7 +108,6 @@ public class IntegerSequence {
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public Iterator<Integer> iterator() { public Iterator<Integer> iterator() {
return Incrementor.create() return Incrementor.create()
.withStart(start) .withStart(start)
@ -130,7 +129,6 @@ public class IntegerSequence {
private static final MaxCountExceededCallback CALLBACK private static final MaxCountExceededCallback CALLBACK
= new MaxCountExceededCallback() { = new MaxCountExceededCallback() {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public void trigger(int max) throws MaxCountExceededException { public void trigger(int max) throws MaxCountExceededException {
throw new MaxCountExceededException(max); throw new MaxCountExceededException(max);
} }
@ -328,7 +326,7 @@ public class IntegerSequence {
* {@link MaxCountExceededCallback#trigger(int) trigger} method of the * {@link MaxCountExceededCallback#trigger(int) trigger} method of the
* callback object passed to the * callback object passed to the
* {@link #withCallback(MaxCountExceededCallback)} method. * {@link #withCallback(MaxCountExceededCallback)} method.
* If not explictly set, a default callback is used that will throw * If not explicitly set, a default callback is used that will throw
* a {@code MaxCountExceededException}. * a {@code MaxCountExceededException}.
* *
* @throws MaxCountExceededException at counter exhaustion, unless a * @throws MaxCountExceededException at counter exhaustion, unless a
@ -341,13 +339,11 @@ public class IntegerSequence {
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public boolean hasNext() { public boolean hasNext() {
return canIncrement(0); return canIncrement(0);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public Integer next() { public Integer next() {
final int value = count; final int value = count;
increment(); increment();
@ -359,7 +355,6 @@ public class IntegerSequence {
* *
* @throws MathUnsupportedOperationException * @throws MathUnsupportedOperationException
*/ */
@Override
public void remove() { public void remove() {
throw new MathUnsupportedOperationException(); throw new MathUnsupportedOperationException();
} }

View File

@ -62,7 +62,6 @@ public class IterationManager {
final Incrementor.MaxCountExceededCallback callBack) { final Incrementor.MaxCountExceededCallback callBack) {
this(maxIterations, new IntegerSequence.Incrementor.MaxCountExceededCallback() { this(maxIterations, new IntegerSequence.Incrementor.MaxCountExceededCallback() {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override
public void trigger(final int maximalCount) throws MaxCountExceededException { public void trigger(final int maximalCount) throws MaxCountExceededException {
callBack.trigger(maximalCount); callBack.trigger(maximalCount);
} }

View File

@ -34,7 +34,6 @@ public final class MicrosphereProjectionInterpolatorTest {
@Test @Test
public void testLinearFunction2D() { public void testLinearFunction2D() {
MultivariateFunction f = new MultivariateFunction() { MultivariateFunction f = new MultivariateFunction() {
@Override
public double value(double[] x) { public double value(double[] x) {
if (x.length != 2) { if (x.length != 2) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();

View File

@ -171,7 +171,7 @@ public class ZipfDistributionTest extends IntegerDistributionAbstractTest {
public void testSamplerHelper1() { public void testSamplerHelper1() {
final double tol = 1e-12; final double tol = 1e-12;
final double[] testValues = { final double[] testValues = {
Math.nextUp(-1.), -1e-1, -1e-2, -1e-3, -1e-4, -1e-5, -1e-6, -1e-7, -1e-8, FastMath.nextUp(-1.), -1e-1, -1e-2, -1e-3, -1e-4, -1e-5, -1e-6, -1e-7, -1e-8,
-1e-9, -1e-10, -1e-11, 0., 1e-11, 1e-10, 1e-9, 1e-8, 1e-7, 1e-6, -1e-9, -1e-10, -1e-11, 0., 1e-11, 1e-10, 1e-9, 1e-8, 1e-7, 1e-6,
1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1e0 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1e0
}; };

View File

@ -460,8 +460,8 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
@Test @Test
public abstract void testPartialDerivatives(); public abstract void testPartialDerivatives();
protected <T extends RealFieldElement<T>> void doTestPartialDerivatives(final double epsilonY, protected void doTestPartialDerivatives(final double epsilonY,
final double[] epsilonPartials) { final double[] epsilonPartials) {
// parameters indices // parameters indices
final int parameters = 5; final int parameters = 5;
@ -496,7 +496,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
} }
// check derivatives // check derivatives
final double[][] derivatives = sinCos.getDerivatives(t.getReal()); final double[][] derivatives = sinCos.getDerivatives(t.getReal());
for (int i = 0; i < sinCos.getDimension(); ++i) { for (int i = 0; i < sinCos.getDimension(); ++i) {
for (int parameter = 0; parameter < parameters; ++parameter) { for (int parameter = 0; parameter < parameters; ++parameter) {
Assert.assertEquals(derivatives[i][parameter], dYdP(result.getState()[i], parameter), epsilonPartials[parameter]); Assert.assertEquals(derivatives[i][parameter], dYdP(result.getState()[i], parameter), epsilonPartials[parameter]);

View File

@ -522,8 +522,8 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
@Test @Test
public abstract void testPartialDerivatives(); public abstract void testPartialDerivatives();
protected <T extends RealFieldElement<T>> void doTestPartialDerivatives(final double epsilonY, protected void doTestPartialDerivatives(final double epsilonY,
final double[] epsilonPartials) { final double[] epsilonPartials) {
// parameters indices // parameters indices
final int parameters = 5; final int parameters = 5;
@ -556,7 +556,7 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
} }
// check derivatives // check derivatives
final double[][] derivatives = sinCos.getDerivatives(t.getReal()); final double[][] derivatives = sinCos.getDerivatives(t.getReal());
for (int i = 0; i < sinCos.getDimension(); ++i) { for (int i = 0; i < sinCos.getDimension(); ++i) {
for (int parameter = 0; parameter < parameters; ++parameter) { for (int parameter = 0; parameter < parameters; ++parameter) {
Assert.assertEquals(derivatives[i][parameter], Assert.assertEquals(derivatives[i][parameter],

View File

@ -24,6 +24,7 @@ import org.apache.commons.math3.util.Decimal64Field;
public class EulerFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest { public class EulerFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest {
@Override
protected <T extends RealFieldElement<T>> RungeKuttaFieldIntegrator<T> protected <T extends RealFieldElement<T>> RungeKuttaFieldIntegrator<T>
createIntegrator(Field<T> field, T step) { createIntegrator(Field<T> field, T step) {
return new EulerFieldIntegrator<T>(field, step); return new EulerFieldIntegrator<T>(field, step);