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:
parent
df1ce13f97
commit
56a6287761
|
@ -124,7 +124,6 @@ public class MicrosphereProjectionInterpolator
|
|||
* @throws DimensionMismatchException if the space dimension of the
|
||||
* given samples does not match the space dimension of the microsphere.
|
||||
*/
|
||||
@Override
|
||||
public MultivariateFunction interpolate(final double[][] xval,
|
||||
final double[] yval)
|
||||
throws DimensionMismatchException,
|
||||
|
@ -153,7 +152,6 @@ public class MicrosphereProjectionInterpolator
|
|||
|
||||
return new MultivariateFunction() {
|
||||
/** {inheritDoc} */
|
||||
@Override
|
||||
public double value(double[] point) {
|
||||
return m.value(point,
|
||||
xval,
|
||||
|
|
|
@ -108,7 +108,6 @@ public class PolynomialsUtils {
|
|||
/** Fixed recurrence coefficients. */
|
||||
private final BigFraction[] coeffs = { BigFraction.ZERO, BigFraction.TWO, BigFraction.ONE };
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public BigFraction[] generate(int k) {
|
||||
return coeffs;
|
||||
}
|
||||
|
@ -134,7 +133,6 @@ public class PolynomialsUtils {
|
|||
return buildPolynomial(degree, HERMITE_COEFFICIENTS,
|
||||
new RecurrenceCoefficientsGenerator() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public BigFraction[] generate(int k) {
|
||||
return new BigFraction[] {
|
||||
BigFraction.ZERO,
|
||||
|
@ -162,7 +160,6 @@ public class PolynomialsUtils {
|
|||
return buildPolynomial(degree, LAGUERRE_COEFFICIENTS,
|
||||
new RecurrenceCoefficientsGenerator() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public BigFraction[] generate(int k) {
|
||||
final int kP1 = k + 1;
|
||||
return new BigFraction[] {
|
||||
|
@ -191,7 +188,6 @@ public class PolynomialsUtils {
|
|||
return buildPolynomial(degree, LEGENDRE_COEFFICIENTS,
|
||||
new RecurrenceCoefficientsGenerator() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public BigFraction[] generate(int k) {
|
||||
final int kP1 = k + 1;
|
||||
return new BigFraction[] {
|
||||
|
@ -243,7 +239,6 @@ public class PolynomialsUtils {
|
|||
return buildPolynomial(degree, JACOBI_COEFFICIENTS.get(key),
|
||||
new RecurrenceCoefficientsGenerator() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public BigFraction[] generate(int k) {
|
||||
k++;
|
||||
final int kvw = k + v + w;
|
||||
|
|
|
@ -138,7 +138,6 @@ public class BracketingNthOrderBrentSolverDFP extends FieldBracketingNthOrderBre
|
|||
RealFieldUnivariateFunction<Dfp> fieldF = new RealFieldUnivariateFunction<Dfp>() {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Dfp value(final Dfp x) {
|
||||
return f.value(x);
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ public class ZipfDistribution extends AbstractIntegerDistribution {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double logProbability(int x) {
|
||||
if (x <= 0 || x > numberOfElements) {
|
||||
return Double.NEGATIVE_INFINITY;
|
||||
|
@ -277,6 +278,7 @@ public class ZipfDistribution extends AbstractIntegerDistribution {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public int sample() {
|
||||
if (sampler == null) {
|
||||
sampler = new ZipfRejectionInversionSampler(numberOfElements, exponent);
|
||||
|
|
|
@ -228,6 +228,7 @@ public class LeastSquaresFactory {
|
|||
return new LeastSquaresAdapter(problem) {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Evaluation evaluate(final RealVector point) {
|
||||
counter.incrementCount();
|
||||
return super.evaluate(point);
|
||||
|
|
|
@ -517,7 +517,6 @@ public class BigFraction
|
|||
* @return a {@link BigFraction} instance with the resulting values.
|
||||
* @throws NullArgumentException if the {@link BigFraction} is {@code null}.
|
||||
*/
|
||||
@Override
|
||||
public BigFraction add(final BigFraction fraction) {
|
||||
if (fraction == null) {
|
||||
throw new NullArgumentException(LocalizedFormats.FRACTION);
|
||||
|
@ -613,7 +612,6 @@ public class BigFraction
|
|||
* than {@code object}, 0 if they are equal.
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(final BigFraction object) {
|
||||
int lhsSigNum = numerator.signum();
|
||||
int rhsSigNum = object.numerator.signum();
|
||||
|
@ -693,7 +691,6 @@ public class BigFraction
|
|||
* @throws NullArgumentException if the {@code fraction} is {@code null}.
|
||||
* @throws MathArithmeticException if the fraction to divide by is zero
|
||||
*/
|
||||
@Override
|
||||
public BigFraction divide(final BigFraction fraction) {
|
||||
if (fraction == null) {
|
||||
throw new NullArgumentException(LocalizedFormats.FRACTION);
|
||||
|
@ -921,7 +918,6 @@ public class BigFraction
|
|||
* the {@code int} to multiply by.
|
||||
* @return a {@link BigFraction} instance with the resulting values.
|
||||
*/
|
||||
@Override
|
||||
public BigFraction multiply(final int i) {
|
||||
if (i == 0 || numerator.signum() == 0) {
|
||||
return ZERO;
|
||||
|
@ -958,7 +954,6 @@ public class BigFraction
|
|||
* @return a {@link BigFraction} instance with the resulting values.
|
||||
* @throws NullArgumentException if {@code fraction} is {@code null}.
|
||||
*/
|
||||
@Override
|
||||
public BigFraction multiply(final BigFraction fraction) {
|
||||
if (fraction == null) {
|
||||
throw new NullArgumentException(LocalizedFormats.FRACTION);
|
||||
|
@ -979,7 +974,6 @@ public class BigFraction
|
|||
*
|
||||
* @return the negation of this fraction.
|
||||
*/
|
||||
@Override
|
||||
public BigFraction negate() {
|
||||
return new BigFraction(numerator.negate(), denominator);
|
||||
}
|
||||
|
@ -1096,7 +1090,6 @@ public class BigFraction
|
|||
*
|
||||
* @return the reciprocal fraction.
|
||||
*/
|
||||
@Override
|
||||
public BigFraction reciprocal() {
|
||||
return new BigFraction(denominator, numerator);
|
||||
}
|
||||
|
@ -1179,7 +1172,6 @@ public class BigFraction
|
|||
* @return a {@link BigFraction} instance with the resulting values
|
||||
* @throws NullArgumentException if the {@code fraction} is {@code null}.
|
||||
*/
|
||||
@Override
|
||||
public BigFraction subtract(final BigFraction fraction) {
|
||||
if (fraction == null) {
|
||||
throw new NullArgumentException(LocalizedFormats.FRACTION);
|
||||
|
@ -1227,7 +1219,6 @@ public class BigFraction
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public BigFractionField getField() {
|
||||
return BigFractionField.getInstance();
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class RegionFactory<S extends Space> {
|
|||
* @param hyperplanes collection of bounding hyperplanes
|
||||
* @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)) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -298,7 +298,6 @@ public class MapUtils {
|
|||
static final Comparator<PairNeuronDouble> COMPARATOR
|
||||
= new Comparator<PairNeuronDouble>() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public int compare(PairNeuronDouble o1,
|
||||
PairNeuronDouble o2) {
|
||||
return Double.compare(o1.value, o2.value);
|
||||
|
|
|
@ -92,7 +92,6 @@ public class KohonenUpdateAction implements UpdateAction {
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void update(Network net,
|
||||
double[] features) {
|
||||
final long numCalls = numberOfCalls.incrementAndGet() - 1;
|
||||
|
|
|
@ -40,7 +40,6 @@ public class QuantizationError implements MapDataVisualization {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public double[][] computeImage(NeuronSquareMesh2D map,
|
||||
Iterable<double[]> data) {
|
||||
final int nR = map.getNumberOfRows();
|
||||
|
|
|
@ -95,7 +95,6 @@ public abstract class AdamsFieldIntegrator<T extends RealFieldElement<T>> extend
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public abstract FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
|
||||
final FieldODEState<T> initialState,
|
||||
final T finalTime)
|
||||
|
|
|
@ -115,6 +115,7 @@ class AdamsFieldStepInterpolator<T extends RealFieldElement<T>> extends Abstract
|
|||
* @param newMapper equations mapper for the all equations
|
||||
* @return a new instance
|
||||
*/
|
||||
@Override
|
||||
protected AdamsFieldStepInterpolator<T> create(boolean newForward,
|
||||
FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -189,6 +189,7 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
|
|||
* @return Nordsieck transformer for the specified field and number of steps
|
||||
* @param <T> the type of the field elements
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends RealFieldElement<T>> AdamsNordsieckFieldTransformer<T>
|
||||
getInstance(final Field<T> field, final int nSteps) {
|
||||
synchronized(CACHE) {
|
||||
|
@ -199,13 +200,13 @@ public class AdamsNordsieckFieldTransformer<T extends RealFieldElement<T>> {
|
|||
AdamsNordsieckFieldTransformer<? extends RealFieldElement<?>>>();
|
||||
CACHE.put(nSteps, map);
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
AdamsNordsieckFieldTransformer<T> t = (AdamsNordsieckFieldTransformer<T>) map.get(field);
|
||||
@SuppressWarnings("rawtypes") // use rawtype to avoid compilation problems with java 1.5
|
||||
AdamsNordsieckFieldTransformer t = map.get(field);
|
||||
if (t == null) {
|
||||
t = new AdamsNordsieckFieldTransformer<T>(field, nSteps);
|
||||
map.put(field, t);
|
||||
map.put(field, (AdamsNordsieckFieldTransformer<T>) t);
|
||||
}
|
||||
return t;
|
||||
return (AdamsNordsieckFieldTransformer<T>) t;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ public class ClassicalRungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
final T[] c = MathArrays.buildArray(getField(), 3);
|
||||
c[0] = getField().getOne().multiply(0.5);
|
||||
|
@ -72,7 +71,6 @@ public class ClassicalRungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
final T[][] a = MathArrays.buildArray(getField(), 3, -1);
|
||||
for (int i = 0; i < a.length; ++i) {
|
||||
|
@ -88,7 +86,6 @@ public class ClassicalRungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
final T[] b = MathArrays.buildArray(getField(), 4);
|
||||
b[0] = fraction(1, 6);
|
||||
|
|
|
@ -82,6 +82,7 @@ class ClassicalRungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected ClassicalRungeKuttaFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -130,7 +130,6 @@ public class DormandPrince54FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
final T[] c = MathArrays.buildArray(getField(), 6);
|
||||
c[0] = fraction(1, 5);
|
||||
|
@ -143,7 +142,6 @@ public class DormandPrince54FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
final T[][] a = MathArrays.buildArray(getField(), 6, -1);
|
||||
for (int i = 0; i < a.length; ++i) {
|
||||
|
@ -174,7 +172,6 @@ public class DormandPrince54FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
final T[] b = MathArrays.buildArray(getField(), 7);
|
||||
b[0] = fraction( 35, 384);
|
||||
|
|
|
@ -107,6 +107,7 @@ class DormandPrince54FieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected DormandPrince54FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -191,7 +191,6 @@ public class DormandPrince853FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
|
||||
final T sqrt6 = getField().getOne().multiply(6).sqrt();
|
||||
|
@ -218,7 +217,6 @@ public class DormandPrince853FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
|
||||
final T sqrt6 = getField().getOne().multiply(6).sqrt();
|
||||
|
@ -371,7 +369,6 @@ public class DormandPrince853FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
final T[] b = MathArrays.buildArray(getField(), 16);
|
||||
b[ 0] = fraction(104257, 1920240);
|
||||
|
|
|
@ -188,6 +188,7 @@ class DormandPrince853FieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected DormandPrince853FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -213,7 +213,6 @@ public abstract class EmbeddedRungeKuttaFieldIntegrator<T extends RealFieldEleme
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
|
||||
final FieldODEState<T> initialState, final T finalTime)
|
||||
throws NumberIsTooSmallException, DimensionMismatchException,
|
||||
|
|
|
@ -64,19 +64,16 @@ public class EulerFieldIntegrator<T extends RealFieldElement<T>> extends RungeKu
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
return MathArrays.buildArray(getField(), 0);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
return MathArrays.buildArray(getField(), 0, 0);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
final T[] b = MathArrays.buildArray(getField(), 1);
|
||||
b[0] = getField().getOne();
|
||||
|
|
|
@ -72,6 +72,7 @@ class EulerFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected EulerFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -62,7 +62,6 @@ public class GillFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
final T[] c = MathArrays.buildArray(getField(), 3);
|
||||
c[0] = fraction(1, 2);
|
||||
|
@ -72,7 +71,6 @@ public class GillFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
|
||||
final T two = getField().getZero().add(2);
|
||||
|
@ -92,7 +90,6 @@ public class GillFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
|
||||
final T two = getField().getZero().add(2);
|
||||
|
|
|
@ -90,6 +90,7 @@ class GillFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected GillFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -105,7 +105,6 @@ public class HighamHall54FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
final T[] c = MathArrays.buildArray(getField(), 6);
|
||||
c[0] = fraction(2, 9);
|
||||
|
@ -118,7 +117,6 @@ public class HighamHall54FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
final T[][] a = MathArrays.buildArray(getField(), 6, -1);
|
||||
for (int i = 0; i < a.length; ++i) {
|
||||
|
@ -149,7 +147,6 @@ public class HighamHall54FieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
final T[] b = MathArrays.buildArray(getField(), 7);
|
||||
b[0] = fraction( 1, 12);
|
||||
|
|
|
@ -58,6 +58,7 @@ class HighamHall54FieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected HighamHall54FieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -71,7 +71,6 @@ public class LutherFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
final T q = getField().getZero().add(21).sqrt();
|
||||
final T[] c = MathArrays.buildArray(getField(), 6);
|
||||
|
@ -85,7 +84,6 @@ public class LutherFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
final T q = getField().getZero().add(21).sqrt();
|
||||
final T[][] a = MathArrays.buildArray(getField(), 6, -1);
|
||||
|
@ -117,7 +115,6 @@ public class LutherFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
|
||||
final T[] b = MathArrays.buildArray(getField(), 7);
|
||||
|
|
|
@ -118,6 +118,7 @@ class LutherFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected LutherFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -59,7 +59,6 @@ public class MidpointFieldIntegrator<T extends RealFieldElement<T>> extends Rung
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
final T[] c = MathArrays.buildArray(getField(), 1);
|
||||
c[0] = getField().getOne().multiply(0.5);
|
||||
|
@ -67,7 +66,6 @@ public class MidpointFieldIntegrator<T extends RealFieldElement<T>> extends Rung
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
final T[][] a = MathArrays.buildArray(getField(), 1, 1);
|
||||
a[0][0] = fraction(1, 2);
|
||||
|
@ -75,7 +73,6 @@ public class MidpointFieldIntegrator<T extends RealFieldElement<T>> extends Rung
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
final T[] b = MathArrays.buildArray(getField(), 2);
|
||||
b[0] = getField().getZero();
|
||||
|
|
|
@ -74,6 +74,7 @@ class MidpointFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected MidpointFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -111,7 +111,6 @@ public abstract class RungeKuttaFieldIntegrator<T extends RealFieldElement<T>>
|
|||
FieldEquationsMapper<T> mapper);
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public FieldODEStateAndDerivative<T> integrate(final FieldExpandableODE<T> equations,
|
||||
final FieldODEState<T> initialState, final T finalTime)
|
||||
throws NumberIsTooSmallException, DimensionMismatchException,
|
||||
|
|
|
@ -69,6 +69,7 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected RungeKuttaFieldStepInterpolator<T> create(boolean newForward,
|
||||
FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
@ -103,7 +104,6 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
* @param coefficients coefficients to apply to the method staged derivatives
|
||||
* @return combined state
|
||||
*/
|
||||
@SafeVarargs
|
||||
protected final T[] previousStateLinearCombination(final T ... coefficients) {
|
||||
return combine(getPreviousState().getState(),
|
||||
coefficients);
|
||||
|
@ -113,7 +113,6 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
* @param coefficients coefficients to apply to the method staged derivatives
|
||||
* @return combined state
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected T[] currentStateLinearCombination(final T ... coefficients) {
|
||||
return combine(getCurrentState().getState(),
|
||||
coefficients);
|
||||
|
@ -123,7 +122,6 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
* @param coefficients coefficients to apply to the method staged derivatives
|
||||
* @return combined state
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected T[] derivativeLinearCombination(final T ... coefficients) {
|
||||
return combine(MathArrays.buildArray(field, yDotK[0].length), coefficients);
|
||||
}
|
||||
|
@ -131,9 +129,8 @@ abstract class RungeKuttaFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
/** Linearly combine arrays.
|
||||
* @param a array to add to
|
||||
* @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) {
|
||||
for (int i = 0; i < a.length; ++i) {
|
||||
for (int k = 0; k < coefficients.length; ++k) {
|
||||
|
|
|
@ -61,7 +61,6 @@ public class ThreeEighthesFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getC() {
|
||||
final T[] c = MathArrays.buildArray(getField(), 3);
|
||||
c[0] = fraction(1, 3);
|
||||
|
@ -71,7 +70,6 @@ public class ThreeEighthesFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[][] getA() {
|
||||
final T[][] a = MathArrays.buildArray(getField(), 3, -1);
|
||||
for (int i = 0; i < a.length; ++i) {
|
||||
|
@ -87,7 +85,6 @@ public class ThreeEighthesFieldIntegrator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public T[] getB() {
|
||||
final T[] b = MathArrays.buildArray(getField(), 4);
|
||||
b[0] = fraction(1, 8);
|
||||
|
|
|
@ -84,6 +84,7 @@ class ThreeEighthesFieldStepInterpolator<T extends RealFieldElement<T>>
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
protected ThreeEighthesFieldStepInterpolator<T> create(final Field<T> newField, final boolean newForward, final T[][] newYDotK,
|
||||
final FieldODEStateAndDerivative<T> newGlobalPreviousState,
|
||||
final FieldODEStateAndDerivative<T> newGlobalCurrentState,
|
||||
|
|
|
@ -108,7 +108,6 @@ public class IntegerSequence {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Iterator<Integer> iterator() {
|
||||
return Incrementor.create()
|
||||
.withStart(start)
|
||||
|
@ -130,7 +129,6 @@ public class IntegerSequence {
|
|||
private static final MaxCountExceededCallback CALLBACK
|
||||
= new MaxCountExceededCallback() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void trigger(int max) throws MaxCountExceededException {
|
||||
throw new MaxCountExceededException(max);
|
||||
}
|
||||
|
@ -328,7 +326,7 @@ public class IntegerSequence {
|
|||
* {@link MaxCountExceededCallback#trigger(int) trigger} method of the
|
||||
* callback object passed to the
|
||||
* {@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}.
|
||||
*
|
||||
* @throws MaxCountExceededException at counter exhaustion, unless a
|
||||
|
@ -341,13 +339,11 @@ public class IntegerSequence {
|
|||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return canIncrement(0);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Integer next() {
|
||||
final int value = count;
|
||||
increment();
|
||||
|
@ -359,7 +355,6 @@ public class IntegerSequence {
|
|||
*
|
||||
* @throws MathUnsupportedOperationException
|
||||
*/
|
||||
@Override
|
||||
public void remove() {
|
||||
throw new MathUnsupportedOperationException();
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@ public class IterationManager {
|
|||
final Incrementor.MaxCountExceededCallback callBack) {
|
||||
this(maxIterations, new IntegerSequence.Incrementor.MaxCountExceededCallback() {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void trigger(final int maximalCount) throws MaxCountExceededException {
|
||||
callBack.trigger(maximalCount);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ public final class MicrosphereProjectionInterpolatorTest {
|
|||
@Test
|
||||
public void testLinearFunction2D() {
|
||||
MultivariateFunction f = new MultivariateFunction() {
|
||||
@Override
|
||||
public double value(double[] x) {
|
||||
if (x.length != 2) {
|
||||
throw new IllegalArgumentException();
|
||||
|
|
|
@ -171,7 +171,7 @@ public class ZipfDistributionTest extends IntegerDistributionAbstractTest {
|
|||
public void testSamplerHelper1() {
|
||||
final double tol = 1e-12;
|
||||
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-5, 1e-4, 1e-3, 1e-2, 1e-1, 1e0
|
||||
};
|
||||
|
|
|
@ -460,7 +460,7 @@ public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest {
|
|||
@Test
|
||||
public abstract void testPartialDerivatives();
|
||||
|
||||
protected <T extends RealFieldElement<T>> void doTestPartialDerivatives(final double epsilonY,
|
||||
protected void doTestPartialDerivatives(final double epsilonY,
|
||||
final double[] epsilonPartials) {
|
||||
|
||||
// parameters indices
|
||||
|
|
|
@ -522,7 +522,7 @@ public abstract class AbstractRungeKuttaFieldIntegratorTest {
|
|||
@Test
|
||||
public abstract void testPartialDerivatives();
|
||||
|
||||
protected <T extends RealFieldElement<T>> void doTestPartialDerivatives(final double epsilonY,
|
||||
protected void doTestPartialDerivatives(final double epsilonY,
|
||||
final double[] epsilonPartials) {
|
||||
|
||||
// parameters indices
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.apache.commons.math3.util.Decimal64Field;
|
|||
|
||||
public class EulerFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest {
|
||||
|
||||
@Override
|
||||
protected <T extends RealFieldElement<T>> RungeKuttaFieldIntegrator<T>
|
||||
createIntegrator(Field<T> field, T step) {
|
||||
return new EulerFieldIntegrator<T>(field, step);
|
||||
|
|
Loading…
Reference in New Issue