From 77f0f202524935c69621e9883eb105e7fca4ecd5 Mon Sep 17 00:00:00 2001
From: Phil Steitz
@@ -1237,7 +1236,7 @@ final double d = TestUtils.kolmogorovSmirnovStatistic(x, y); TestUtils.exactP(d, x.length, y.length, false) assuming that the non-strict form of the null hypothesis is desired. Note, however, - that exact computation for anything but very small samples takes a very long time. + that exact computation for large samples takes a long time.
From 445f091bcd93d76559279032865b26ffb46aa749 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe* Implementations of arithmetic operations handle {@code NaN} and * infinite values according to the rules for {@link java.lang.Double}, i.e. * {@link #equals} is an equivalence relation for all instances that have @@ -42,16 +42,14 @@ import org.apache.commons.math3.util.Precision; *
+ * Note that this contradicts the IEEE-754 standard for floating
* point numbers (according to which the test {@code x == x} must fail if
* {@code x} is {@code NaN}). The method
* {@link org.apache.commons.math3.util.Precision#equals(double,double,int)
* equals for primitive double} in {@link org.apache.commons.math3.util.Precision}
* conforms with IEEE-754 while this class conforms with the standard behavior
- * for Java object types.
- *
- * Implements Serializable since 2.0
+ * for Java object types.
- *
- * (a + bi) + (c + di) = (a+c) + (b+d)i
- *
- *
- * + * {@code (a + bi) + (c + di) = (a+c) + (b+d)i} + *
* If either {@code this} or {@code addend} has a {@code NaN} value in * either part, {@link #NaN} is returned; otherwise {@code Infinite} * and {@code NaN} values are returned in the parts of the result @@ -180,17 +175,17 @@ public class Complex implements FieldElement
* {@link #NaN} is returned if either the real or imaginary
* part of this Complex number equals {@code Double.NaN}.
- *
+ *
* If the imaginary part is infinite, and the real part is not * {@code NaN}, the returned value has infinite imaginary part * of the opposite sign, e.g. the conjugate of * {@code 1 + POSITIVE_INFINITY i} is {@code 1 - NEGATIVE_INFINITY i}. - * + *
* @return the conjugate of this Complex object. */ public Complex conjugate() { @@ -216,7 +211,7 @@ public class Complex implements FieldElement* {@code Infinite} and {@code NaN} values are handled according to the * following rules, applied in the order presented: *
- *
- * (a + bi)(c + di) = (ac - bd) + (ad + bc)i
- *
- *
+ * + * {@code (a + bi)(c + di) = (ac - bd) + (ad + bc)i} + *
* Returns {@link #NaN} if either {@code this} or {@code factor} has one or * more {@code NaN} parts. - *
* Returns {@link #INF} if neither {@code this} nor {@code factor} has one
* or more {@code NaN} parts and if either {@code this} or {@code factor}
* has one or more infinite parts (same result is returned regardless of
* the sign of the components).
- *
+ *
* Returns finite values in components of the result per the definitional - * formula in all remaining cases. + * formula in all remaining cases.
* * @param factor value to be multiplied by this {@code Complex}. * @return {@code this * factor}. @@ -580,7 +573,7 @@ public class Complex implements FieldElement
- *
- * (a + bi) - (c + di) = (a-c) + (b-d)i
- *
- *
+ * + * {@code (a + bi) - (c + di) = (a-c) + (b-d)i} + *
* If either {@code this} or {@code subtrahend} has a {@code NaN]} value in either part, * {@link #NaN} is returned; otherwise infinite and {@code NaN} values are * returned in the parts of the result according to the rules for @@ -641,11 +632,9 @@ public class Complex implements FieldElement
- *
- * acos(z) = -i (log(z + i (sqrt(1 - z2))))
- *
- *
+ * + * {@code acos(z) = -i (log(z + i (sqrt(1 - z2))))} + *
* Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN} or infinite. * @@ -665,13 +654,11 @@ public class Complex implements FieldElement
- *
- * asin(z) = -i (log(sqrt(1 - z2) + iz))
- *
- *
+ * + * {@code asin(z) = -i (log(sqrt(1 - z2) + iz))} + *
* Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is {@code NaN} or infinite. + * input argument is {@code NaN} or infinite.
* * @return the inverse sine of this complex number. * @since 1.2 @@ -689,13 +676,11 @@ public class Complex implements FieldElement
- *
- * atan(z) = (i/2) log((i + z)/(i - z))
- *
- *
+ * + * {@code atan(z) = (i/2) log((i + z)/(i - z))} + *
* Returns {@link Complex#NaN} if either real or imaginary part of the - * input argument is {@code NaN} or infinite. + * input argument is {@code NaN} or infinite.
* * @return the inverse tangent of this complex number * @since 1.2 @@ -712,27 +697,24 @@ public class Complex implements FieldElement
- *
- * cos(a + bi) = cos(a)cosh(b) - sin(a)sinh(b)i
- *
- *
+ * + * {@code cos(a + bi) = cos(a)cosh(b) - sin(a)sinh(b)i} + *
* where the (real) functions on the right-hand side are
* {@link FastMath#sin}, {@link FastMath#cos},
* {@link FastMath#cosh} and {@link FastMath#sinh}.
- *
+ *
* Returns {@link Complex#NaN} if either real or imaginary part of the
* input argument is {@code NaN}.
- *
+ *
* Infinite values in real or imaginary parts of the input may result in - * infinite or NaN values returned in parts of the result. + * infinite or NaN values returned in parts of the result.
** Examples: *- * cos(1 ± INFINITY i) = 1 ∓ INFINITY i + * cos(1 ± INFINITY i) = 1 \u2213 INFINITY i * cos(±INFINITY + i) = NaN + NaN i * cos(±INFINITY ± INFINITY i) = NaN + NaN i *
@@ -757,16 +739,16 @@ public class Complex implements FieldElement, Serializable { * Implements the formula: * ** where the (real) functions on the right-hand side are * {@link FastMath#sin}, {@link FastMath#cos}, * {@link FastMath#cosh} and {@link FastMath#sinh}. - *- * cosh(a + bi) = cosh(a)cos(b) + sinh(a)sin(b)i} + * cosh(a + bi) = cosh(a)cos(b) + sinh(a)sin(b)i *
*
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN}. - *
* Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result. *
+ *@@ -803,10 +785,10 @@ public class Complex implements FieldElement, Serializable { * where the (real) functions on the right-hand side are * {@link FastMath#exp}, {@link FastMath#cos}, and * {@link FastMath#sin}. - *
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN}. - *
* Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result. *
+ *@@ -845,10 +827,10 @@ public class Complex implements FieldElement, Serializable { * where ln on the right hand side is {@link FastMath#log}, * {@code |a + bi|} is the modulus, {@link Complex#abs}, and * {@code arg(a + bi) = }{@link FastMath#atan2}(b, a). - *
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN}. - *
* Infinite (or critical) values in real or imaginary parts of the input may * result in infinite or NaN values returned in parts of the result. *
+ *@@ -886,13 +868,13 @@ public class Complex implements FieldElement* where {@code exp} and {@code log} are {@link #exp} and * {@link #log}, respectively. - *, Serializable { *
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN} or infinite, or if {@code y} - * equals {@link Complex#ZERO}. + * equals {@link Complex#ZERO}.
* * @param x exponent to which this {@code Complex} is to be raised. - * @returnthis{@code x}
. + * @returnthisx
. * @throws NullArgumentException if x is {@code null}. * @since 1.2 */ @@ -927,10 +909,10 @@ public class Complex implements FieldElement, Serializable { * where the (real) functions on the right-hand side are * {@link FastMath#sin}, {@link FastMath#cos}, * {@link FastMath#cosh} and {@link FastMath#sinh}. - *
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN}. - *
+ ** Infinite values in real or imaginary parts of the input may result in * infinite or {@code NaN} values returned in parts of the result. *
@@ -967,10 +949,10 @@ public class Complex implements FieldElement, Serializable { * where the (real) functions on the right-hand side are * {@link FastMath#sin}, {@link FastMath#cos}, * {@link FastMath#cosh} and {@link FastMath#sinh}. - *
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN}. - *
+ ** Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result. *
@@ -1008,10 +990,10 @@ public class Complex implements FieldElement, Serializable { * - {@code |a + bi| = }{@link Complex#abs}(a + bi)
*- {@code sign(b) = }{@link FastMath#copySign(double,double) copySign(1d, b)} *
* Returns {@link Complex#NaN} if either real or imaginary part of the
* input argument is {@code NaN}.
- *
+ *
@@ -1053,10 +1035,10 @@ public class Complex implements FieldElement, Serializable { * number. * Computes the result directly as * {@code sqrt(ONE.subtract(z.multiply(z)))}. - *
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN}. - *
* Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result. * @@ -1080,10 +1062,10 @@ public class Complex implements FieldElement
+ *, Serializable { * where the (real) functions on the right-hand side are * {@link FastMath#sin}, {@link FastMath#cos}, {@link FastMath#cosh} and * {@link FastMath#sinh}. - *
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN}. - *
* Infinite (or critical) values in real or imaginary parts of the input may * result in infinite or NaN values returned in parts of the result. *
+ *@@ -1131,10 +1113,10 @@ public class Complex implements FieldElement, Serializable { * where the (real) functions on the right-hand side are * {@link FastMath#sin}, {@link FastMath#cos}, {@link FastMath#cosh} and * {@link FastMath#sinh}. - *
+ ** Returns {@link Complex#NaN} if either real or imaginary part of the * input argument is {@code NaN}. - *
* Infinite values in real or imaginary parts of the input may result in * infinite or NaN values returned in parts of the result. *
+ *@@ -1177,7 +1159,7 @@ public class Complex implements FieldElement, Serializable { * The value returned is between -PI (not inclusive) * and PI (inclusive), with negative values returned for numbers with * negative imaginary parts. - *
+ ** If either real or imaginary part (or both) is NaN, NaN is returned. * Infinite parts are handled as {@code Math.atan2} handles them, * essentially treating finite parts as zero in the presence of an @@ -1202,14 +1184,14 @@ public class Complex implements FieldElement
, Serializable { * for {@code k=0, 1, ..., n-1}, where {@code abs} and {@code phi} * are respectively the {@link #abs() modulus} and * {@link #getArgument() argument} of this complex number. - *
+ ** If one or both parts of this complex number is NaN, a list with just * one element, {@link #NaN} is returned. * if neither part is NaN, but at least one part is infinite, the result * is a one-element list containing {@link #INF}. * * @param n Degree of root. - * @return a List
of all {@code n}-th roots of {@code this}. + * @return a List of all {@code n}-th roots of {@code this}. * @throws NotPositiveException if {@code n <= 0}. * @since 2.0 */ diff --git a/src/main/java/org/apache/commons/math3/util/Precision.java b/src/main/java/org/apache/commons/math3/util/Precision.java index 49fd15cc0..180ad4f20 100644 --- a/src/main/java/org/apache/commons/math3/util/Precision.java +++ b/src/main/java/org/apache/commons/math3/util/Precision.java @@ -99,7 +99,8 @@ public class Precision { * @param eps the amount of error to allow when checking for equality * @return + *
- 0 if {@link #equals(double, double, double) equals(x, y, eps)}
*- < 0 if !{@link #equals(double, double, double) equals(x, y, eps)} && x < y
- *- > 0 if !{@link #equals(double, double, double) equals(x, y, eps)} && x > y
> 0 if !{@link #equals(double, double, double) equals(x, y, eps)} && x > y or + * either argument is NaN */ public static int compareTo(double x, double y, double eps) { if (equals(x, y, eps)) { @@ -117,7 +118,7 @@ public class Precision { * point numbers are considered equal. * Adapted from - * Bruce Dawson + * Bruce Dawson. Returns {@code false} if either of the arguments is NaN. * * @param x first value * @param y second value @@ -125,7 +126,8 @@ public class Precision { * values between {@code x} and {@code y}. * @return+ *
- 0 if {@link #equals(double, double, int) equals(x, y, maxUlps)}
*- < 0 if !{@link #equals(double, double, int) equals(x, y, maxUlps)} && x < y
- *- > 0 if !{@link #equals(double, double, int) equals(x, y, maxUlps)} && x > y
> 0 if !{@link #equals(double, double, int) equals(x, y, maxUlps)} && x > y + * or either argument is NaN */ public static int compareTo(final double x, final double y, final int maxUlps) { if (equals(x, y, maxUlps)) { @@ -149,7 +151,7 @@ public class Precision { } /** - * Returns true if both arguments are NaN or neither is NaN and they are + * Returns true if both arguments are NaN or they are * equal as defined by {@link #equals(float,float) equals(x, y, 1)}. * * @param x first value @@ -162,8 +164,9 @@ public class Precision { } /** - * Returns true if both arguments are equal or within the range of allowed - * error (inclusive). + * Returns true if the arguments are equal or within the range of allowed + * error (inclusive). Returns {@code false} if either of the arguments + * is NaN. * * @param x first value * @param y second value @@ -176,7 +179,7 @@ public class Precision { } /** - * Returns true if both arguments are NaN or are equal or within the range + * Returns true if the arguments are both NaN, are equal, or are within the range * of allowed error (inclusive). * * @param x first value @@ -191,14 +194,14 @@ public class Precision { } /** - * Returns true if both arguments are equal or within the range of allowed + * Returns true if the arguments are equal or within the range of allowed * error (inclusive). * Two float numbers are considered equal if there are {@code (maxUlps - 1)} * (or fewer) floating point numbers between them, i.e. two adjacent floating * point numbers are considered equal. * Adapted from - * Bruce Dawson + * Bruce Dawson. Returns {@code false} if either of the arguments is NaN. * * @param x first value * @param y second value @@ -242,7 +245,7 @@ public class Precision { } /** - * Returns true if both arguments are NaN or if they are equal as defined + * Returns true if the arguments are both NaN or if they are equal as defined * by {@link #equals(float,float,int) equals(x, y, maxUlps)}. * * @param x first value @@ -270,7 +273,7 @@ public class Precision { } /** - * Returns true if both arguments are NaN or neither is NaN and they are + * Returns true if the arguments are both NaN or they are * equal as defined by {@link #equals(double,double) equals(x, y, 1)}. * * @param x first value @@ -285,7 +288,8 @@ public class Precision { /** * Returns {@code true} if there is no double value strictly between the * arguments or the difference between them is within the range of allowed - * error (inclusive). + * error (inclusive). Returns {@code false} if either of the arguments + * is NaN. * * @param x First value. * @param y Second value. @@ -299,8 +303,9 @@ public class Precision { /** * Returns {@code true} if there is no double value strictly between the - * arguments or the relative difference between them is smaller or equal - * to the given tolerance. + * arguments or the relative difference between them is less than or equal + * to the given tolerance. Returns {@code false} if either of the arguments + * is NaN. * * @param x First value. * @param y Second value. @@ -321,7 +326,7 @@ public class Precision { } /** - * Returns true if both arguments are NaN or are equal or within the range + * Returns true if the arguments are both NaN, are equal or are within the range * of allowed error (inclusive). * * @param x first value @@ -336,7 +341,7 @@ public class Precision { } /** - * Returns true if both arguments are equal or within the range of allowed + * Returns true if the arguments are equal or within the range of allowed * error (inclusive). ** Two float numbers are considered equal if there are {@code (maxUlps - 1)} @@ -346,7 +351,7 @@ public class Precision { *
* Adapted from - * Bruce Dawson + * Bruce Dawson. Returns {@code false} if either of the arguments is NaN. *
* * @param x first value diff --git a/src/test/java/org/apache/commons/math3/complex/ComplexTest.java b/src/test/java/org/apache/commons/math3/complex/ComplexTest.java index 7cf796231..bb34a4803 100644 --- a/src/test/java/org/apache/commons/math3/complex/ComplexTest.java +++ b/src/test/java/org/apache/commons/math3/complex/ComplexTest.java @@ -564,6 +564,15 @@ public class ComplexTest { Assert.assertFalse(Complex.equals(x, y, tol2)); } + @Test + public void testFloatingPointEqualsWithAllowedDeltaNaN() { + final Complex x = new Complex(0, Double.NaN); + final Complex y = new Complex(Double.NaN, 0); + Assert.assertFalse(Complex.equals(x, Complex.ZERO, 0.1)); + Assert.assertFalse(Complex.equals(x, x, 0.1)); + Assert.assertFalse(Complex.equals(x, y, 0.1)); + } + @Test public void testFloatingPointEqualsWithRelativeTolerance() { final double tol = 1e-4; @@ -576,6 +585,15 @@ public class ComplexTest { Assert.assertTrue(Complex.equalsWithRelativeTolerance(x, y, tol)); } + @Test + public void testFloatingPointEqualsWithRelativeToleranceNaN() { + final Complex x = new Complex(0, Double.NaN); + final Complex y = new Complex(Double.NaN, 0); + Assert.assertFalse(Complex.equalsWithRelativeTolerance(x, Complex.ZERO, 0.1)); + Assert.assertFalse(Complex.equalsWithRelativeTolerance(x, x, 0.1)); + Assert.assertFalse(Complex.equalsWithRelativeTolerance(x, y, 0.1)); + } + @Test public void testEqualsTrue() { Complex x = new Complex(3.0, 4.0); From 29649959e22888a0814541acc01f9ca8d86aaa72 Mon Sep 17 00:00:00 2001 From: Luc MaisonobeDate: Sat, 2 Jan 2016 10:27:49 +0100 Subject: [PATCH 4/7] Renamed abstract test classes to match build environment filters. --- .../math3/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java | 2 +- ...ntegratorTest.java => AdamsFieldIntegratorAbstractTest.java} | 2 +- .../math3/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java | 2 +- .../nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java | 2 +- .../ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java | 2 +- .../math3/ode/nonstiff/DormandPrince54FieldIntegratorTest.java | 2 +- .../ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java | 2 +- .../math3/ode/nonstiff/DormandPrince853FieldIntegratorTest.java | 2 +- .../ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java | 2 +- ....java => EmbeddedRungeKuttaFieldIntegratorAbstractTest.java} | 2 +- .../commons/math3/ode/nonstiff/EulerFieldIntegratorTest.java | 2 +- .../math3/ode/nonstiff/EulerFieldStepInterpolatorTest.java | 2 +- .../commons/math3/ode/nonstiff/GillFieldIntegratorTest.java | 2 +- .../math3/ode/nonstiff/GillFieldStepInterpolatorTest.java | 2 +- .../math3/ode/nonstiff/HighamHall54FieldIntegratorTest.java | 2 +- .../ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java | 2 +- .../commons/math3/ode/nonstiff/LutherFieldIntegratorTest.java | 2 +- .../math3/ode/nonstiff/LutherFieldStepInterpolatorTest.java | 2 +- .../commons/math3/ode/nonstiff/MidpointFieldIntegratorTest.java | 2 +- .../math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java | 2 +- ...atorTest.java => RungeKuttaFieldIntegratorAbstractTest.java} | 2 +- ...st.java => RungeKuttaFieldStepInterpolatorAbstractTest.java} | 2 +- .../math3/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java | 2 +- .../ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) rename src/test/java/org/apache/commons/math3/ode/nonstiff/{AbstractAdamsFieldIntegratorTest.java => AdamsFieldIntegratorAbstractTest.java} (99%) rename src/test/java/org/apache/commons/math3/ode/nonstiff/{AbstractEmbeddedRungeKuttaFieldIntegratorTest.java => EmbeddedRungeKuttaFieldIntegratorAbstractTest.java} (99%) rename src/test/java/org/apache/commons/math3/ode/nonstiff/{AbstractRungeKuttaFieldIntegratorTest.java => RungeKuttaFieldIntegratorAbstractTest.java} (99%) rename src/test/java/org/apache/commons/math3/ode/nonstiff/{AbstractRungeKuttaFieldStepInterpolatorTest.java => RungeKuttaFieldStepInterpolatorAbstractTest.java} (99%) diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java index 9b7c45e33..e78a6dea6 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsBashforthFieldIntegratorTest.java @@ -26,7 +26,7 @@ import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class AdamsBashforthFieldIntegratorTest extends AbstractAdamsFieldIntegratorTest { +public class AdamsBashforthFieldIntegratorTest extends AdamsFieldIntegratorAbstractTest { protected > AdamsFieldIntegrator createIntegrator(Field field, final int nSteps, final double minStep, final double maxStep, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractAdamsFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsFieldIntegratorAbstractTest.java similarity index 99% rename from src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractAdamsFieldIntegratorTest.java rename to src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsFieldIntegratorAbstractTest.java index 74a584177..efc1b2c4f 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractAdamsFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsFieldIntegratorAbstractTest.java @@ -40,7 +40,7 @@ import org.apache.commons.math3.util.FastMath; import org.junit.Assert; import org.junit.Test; -public abstract class AbstractAdamsFieldIntegratorTest { +public abstract class AdamsFieldIntegratorAbstractTest { protected abstract > AdamsFieldIntegrator createIntegrator(Field field, final int nSteps, final double minStep, final double maxStep, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java index 2a389b408..eda33d3c6 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/AdamsMoultonFieldIntegratorTest.java @@ -26,7 +26,7 @@ import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class AdamsMoultonFieldIntegratorTest extends AbstractAdamsFieldIntegratorTest { +public class AdamsMoultonFieldIntegratorTest extends AdamsFieldIntegratorAbstractTest { protected > AdamsFieldIntegrator createIntegrator(Field field, final int nSteps, final double minStep, final double maxStep, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java index e94a0415a..b69b52b6d 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/ClassicalRungKuttaFieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class ClassicalRungKuttaFieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class ClassicalRungKuttaFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java index e1cef43d1..2fa96d56d 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/ClassicalRungeKuttaFieldIntegratorTest.java @@ -22,7 +22,7 @@ import org.apache.commons.math3.Field; import org.apache.commons.math3.RealFieldElement; import org.apache.commons.math3.util.Decimal64Field; -public class ClassicalRungeKuttaFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest { +public class ClassicalRungeKuttaFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { protected > RungeKuttaFieldIntegrator createIntegrator(Field field, T step) { diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince54FieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince54FieldIntegratorTest.java index cd3c5ad5c..5285b75d7 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince54FieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince54FieldIntegratorTest.java @@ -22,7 +22,7 @@ import org.apache.commons.math3.Field; import org.apache.commons.math3.RealFieldElement; import org.apache.commons.math3.util.Decimal64Field; -public class DormandPrince54FieldIntegratorTest extends AbstractEmbeddedRungeKuttaFieldIntegratorTest { +public class DormandPrince54FieldIntegratorTest extends EmbeddedRungeKuttaFieldIntegratorAbstractTest { protected > EmbeddedRungeKuttaFieldIntegrator createIntegrator(Field field, final double minStep, final double maxStep, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java index a01976ed5..792b21c04 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince54FieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class DormandPrince54FieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class DormandPrince54FieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince853FieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince853FieldIntegratorTest.java index 1edc8a486..80f2d969a 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince853FieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince853FieldIntegratorTest.java @@ -22,7 +22,7 @@ import org.apache.commons.math3.Field; import org.apache.commons.math3.RealFieldElement; import org.apache.commons.math3.util.Decimal64Field; -public class DormandPrince853FieldIntegratorTest extends AbstractEmbeddedRungeKuttaFieldIntegratorTest { +public class DormandPrince853FieldIntegratorTest extends EmbeddedRungeKuttaFieldIntegratorAbstractTest { protected > EmbeddedRungeKuttaFieldIntegrator createIntegrator(Field field, final double minStep, final double maxStep, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java index 2fca2bd4e..d9e4ea1fa 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/DormandPrince853FieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class DormandPrince853FieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class DormandPrince853FieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/EmbeddedRungeKuttaFieldIntegratorAbstractTest.java similarity index 99% rename from src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java rename to src/test/java/org/apache/commons/math3/ode/nonstiff/EmbeddedRungeKuttaFieldIntegratorAbstractTest.java index 97458d092..cb5797a84 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractEmbeddedRungeKuttaFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/EmbeddedRungeKuttaFieldIntegratorAbstractTest.java @@ -44,7 +44,7 @@ import org.apache.commons.math3.util.MathArrays; import org.junit.Assert; import org.junit.Test; -public abstract class AbstractEmbeddedRungeKuttaFieldIntegratorTest { +public abstract class EmbeddedRungeKuttaFieldIntegratorAbstractTest { protected abstract > EmbeddedRungeKuttaFieldIntegrator createIntegrator(Field field, final double minStep, final double maxStep, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/EulerFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/EulerFieldIntegratorTest.java index b3a84882c..68b66f843 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/EulerFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/EulerFieldIntegratorTest.java @@ -22,7 +22,7 @@ import org.apache.commons.math3.Field; import org.apache.commons.math3.RealFieldElement; import org.apache.commons.math3.util.Decimal64Field; -public class EulerFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest { +public class EulerFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { @Override protected > RungeKuttaFieldIntegrator diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/EulerFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/EulerFieldStepInterpolatorTest.java index 2725d9104..bc93b4bf7 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/EulerFieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/EulerFieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class EulerFieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class EulerFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/GillFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/GillFieldIntegratorTest.java index 943703a07..9f9935b09 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/GillFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/GillFieldIntegratorTest.java @@ -22,7 +22,7 @@ import org.apache.commons.math3.Field; import org.apache.commons.math3.RealFieldElement; import org.apache.commons.math3.util.Decimal64Field; -public class GillFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest { +public class GillFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { protected > RungeKuttaFieldIntegrator createIntegrator(Field field, T step) { diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/GillFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/GillFieldStepInterpolatorTest.java index 446a3e471..78e9e6d47 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/GillFieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/GillFieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class GillFieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class GillFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/HighamHall54FieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/HighamHall54FieldIntegratorTest.java index 3069bd0fa..19dc348e9 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/HighamHall54FieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/HighamHall54FieldIntegratorTest.java @@ -22,7 +22,7 @@ import org.apache.commons.math3.Field; import org.apache.commons.math3.RealFieldElement; import org.apache.commons.math3.util.Decimal64Field; -public class HighamHall54FieldIntegratorTest extends AbstractEmbeddedRungeKuttaFieldIntegratorTest { +public class HighamHall54FieldIntegratorTest extends EmbeddedRungeKuttaFieldIntegratorAbstractTest { protected > EmbeddedRungeKuttaFieldIntegrator createIntegrator(Field field, final double minStep, final double maxStep, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java index 2487c2605..df3ab48c4 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/HighamHall54FieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class HighamHall54FieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class HighamHall54FieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/LutherFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/LutherFieldIntegratorTest.java index 2307280c9..f6599bb82 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/LutherFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/LutherFieldIntegratorTest.java @@ -26,7 +26,7 @@ import org.apache.commons.math3.exception.NoBracketingException; import org.apache.commons.math3.exception.NumberIsTooSmallException; import org.apache.commons.math3.util.Decimal64Field; -public class LutherFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest { +public class LutherFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { protected > RungeKuttaFieldIntegrator createIntegrator(Field field, T step) { diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/LutherFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/LutherFieldStepInterpolatorTest.java index f7ad82916..4d4c418a2 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/LutherFieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/LutherFieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class LutherFieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class LutherFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldIntegratorTest.java index 3a6b02ca3..e8c68053c 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldIntegratorTest.java @@ -22,7 +22,7 @@ import org.apache.commons.math3.Field; import org.apache.commons.math3.RealFieldElement; import org.apache.commons.math3.util.Decimal64Field; -public class MidpointFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest { +public class MidpointFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { protected > RungeKuttaFieldIntegrator createIntegrator(Field field, T step) { diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java index 66400456e..b3de00ecd 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/MidpointFieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class MidpointFieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class MidpointFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/RungeKuttaFieldIntegratorAbstractTest.java similarity index 99% rename from src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java rename to src/test/java/org/apache/commons/math3/ode/nonstiff/RungeKuttaFieldIntegratorAbstractTest.java index 35cc13d07..518690a3e 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractRungeKuttaFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/RungeKuttaFieldIntegratorAbstractTest.java @@ -49,7 +49,7 @@ import org.apache.commons.math3.util.MathArrays; import org.junit.Assert; import org.junit.Test; -public abstract class AbstractRungeKuttaFieldIntegratorTest { +public abstract class RungeKuttaFieldIntegratorAbstractTest { protected abstract > RungeKuttaFieldIntegrator createIntegrator(Field field, T step); diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractRungeKuttaFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/RungeKuttaFieldStepInterpolatorAbstractTest.java similarity index 99% rename from src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractRungeKuttaFieldStepInterpolatorTest.java rename to src/test/java/org/apache/commons/math3/ode/nonstiff/RungeKuttaFieldStepInterpolatorAbstractTest.java index b5c7ff0b5..601e7b0c1 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/AbstractRungeKuttaFieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/RungeKuttaFieldStepInterpolatorAbstractTest.java @@ -33,7 +33,7 @@ import org.apache.commons.math3.util.MathArrays; import org.junit.Assert; import org.junit.Test; -public abstract class AbstractRungeKuttaFieldStepInterpolatorTest { +public abstract class RungeKuttaFieldStepInterpolatorAbstractTest { protected abstract > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java index 700661d5a..971dac83d 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/ThreeEighthesFieldIntegratorTest.java @@ -22,7 +22,7 @@ import org.apache.commons.math3.Field; import org.apache.commons.math3.RealFieldElement; import org.apache.commons.math3.util.Decimal64Field; -public class ThreeEighthesFieldIntegratorTest extends AbstractRungeKuttaFieldIntegratorTest { +public class ThreeEighthesFieldIntegratorTest extends RungeKuttaFieldIntegratorAbstractTest { protected > RungeKuttaFieldIntegrator createIntegrator(Field field, T step) { diff --git a/src/test/java/org/apache/commons/math3/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java b/src/test/java/org/apache/commons/math3/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java index f1a2d28aa..f326a2bf8 100644 --- a/src/test/java/org/apache/commons/math3/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math3/ode/nonstiff/ThreeEighthesFieldStepInterpolatorTest.java @@ -25,7 +25,7 @@ import org.apache.commons.math3.ode.FieldODEStateAndDerivative; import org.apache.commons.math3.util.Decimal64Field; import org.junit.Test; -public class ThreeEighthesFieldStepInterpolatorTest extends AbstractRungeKuttaFieldStepInterpolatorTest { +public class ThreeEighthesFieldStepInterpolatorTest extends RungeKuttaFieldStepInterpolatorAbstractTest { protected > RungeKuttaFieldStepInterpolator createInterpolator(Field field, boolean forward, T[][] yDotK, From 68194a3bf5496966ecfdfe1161ae91744782f670 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Sat, 2 Jan 2016 10:25:49 -0700 Subject: [PATCH 5/7] Fixed ant build. --- build.xml | 23 +++++++++++++++++------ test-jar.xml | 50 ++++++++++++++++---------------------------------- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/build.xml b/build.xml index 89cc43376..3e973173c 100644 --- a/build.xml +++ b/build.xml @@ -30,12 +30,12 @@ + - - - - + + + @@ -50,7 +50,7 @@ - + @@ -111,6 +111,7 @@ @@ -121,6 +122,7 @@ + + @@ -343,9 +345,10 @@ + depends="check-availability" unless="skip.download"> + @@ -360,6 +363,14 @@ usetimestamp="true" ignoreerrors="true" src="http://repo1.maven.org/maven2/junit/junit/${junit.version}/junit-${junit.version}.jar"/> + ++ diff --git a/test-jar.xml b/test-jar.xml index c6e12ec25..e5a20a52d 100644 --- a/test-jar.xml +++ b/test-jar.xml @@ -21,25 +21,23 @@ Compiles and runs unit tests against distribution jar(s). Use .antrc or the command line to control the jdk used to execute this build file. - Assumes that the distribution jar to be tested is in the base directory. - Use the "jardir" property to specify the path to the directory containing - the jar. Any other jars in this directory will also be added to the - classpath. + Assumes that the distribution jar to be tested is in the basedir/lib, along + with any dependent jars (junit, hamcrest). Use the "libdir" property to specify + the path to the directory containing these jars. The default target, "test," executes clean as a dependency. -->+ + + - From e206688654f171f8757911cd904771bb6200b492 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe- + - - + + + - - +@@ -58,24 +56,17 @@ Java library path: ${java.library.path} =========================================================================== - - - - -- -- - + - - + - + @@ -88,14 +79,7 @@ - -- ================================= WARNING ================================ - Junit isn't present in your ${ANT_HOME}/lib directory. Tests not executed. - ========================================================================== - -+ @@ -106,12 +90,10 @@ -- - - + + +- Date: Sat, 2 Jan 2016 19:44:30 +0100 Subject: [PATCH 6/7] Spurious @Override. --- .../org/apache/commons/math3/random/BitsStreamGenerator.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java b/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java index 9f7cb56d9..7a8aef5c8 100644 --- a/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java +++ b/src/main/java/org/apache/commons/math3/random/BitsStreamGenerator.java @@ -187,7 +187,6 @@ public abstract class BitsStreamGenerator * * @param bytes Array in which to put the generated bytes. Cannot be {@code null}. */ - @Override public void nextBytes(byte[] bytes) { nextBytesFill(bytes, 0, bytes.length); } From 775bde7a4df691bd5890475d0398a31411508f81 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Sat, 2 Jan 2016 19:46:33 +0100 Subject: [PATCH 7/7] Enlarged test tolerance as test did not pass with Java 5. --- .../distribution/EnumeratedIntegerDistributionTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java b/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java index 85aa5afbd..427718766 100644 --- a/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java +++ b/src/test/java/org/apache/commons/math3/distribution/EnumeratedIntegerDistributionTest.java @@ -22,6 +22,7 @@ import org.apache.commons.math3.exception.NotANumberException; import org.apache.commons.math3.exception.NotFiniteNumberException; import org.apache.commons.math3.exception.NotPositiveException; import org.apache.commons.math3.util.FastMath; +import org.apache.commons.math3.util.Precision; import org.junit.Assert; import org.junit.Test; @@ -173,7 +174,7 @@ public class EnumeratedIntegerDistributionTest { public void testCreateFromIntegers() { final int[] data = new int[] {0, 1, 1, 2, 2, 2}; EnumeratedIntegerDistribution distribution = new EnumeratedIntegerDistribution(data); - Assert.assertEquals(0.5, distribution.probability(2), 0); - Assert.assertEquals(0.5, distribution.cumulativeProbability(1), 0); + Assert.assertEquals(0.5, distribution.probability(2), Precision.EPSILON); + Assert.assertEquals(0.5, distribution.cumulativeProbability(1), Precision.EPSILON); } }