diff --git a/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java b/src/main/java/org/apache/commons/math/analysis/integration/BaseAbstractUnivariateIntegrator.java similarity index 96% rename from src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java rename to src/main/java/org/apache/commons/math/analysis/integration/BaseAbstractUnivariateIntegrator.java index eb708c831..d4fa43a1c 100644 --- a/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java +++ b/src/main/java/org/apache/commons/math/analysis/integration/BaseAbstractUnivariateIntegrator.java @@ -33,7 +33,7 @@ import org.apache.commons.math.util.MathUtils; * @version $Id$ * @since 1.2 */ -public abstract class UnivariateRealIntegratorImpl implements UnivariateRealIntegrator { +public abstract class BaseAbstractUnivariateIntegrator implements UnivariateIntegrator { /** Default absolute accuracy. */ public static final double DEFAULT_ABSOLUTE_ACCURACY = 1.0e-15; @@ -106,7 +106,7 @@ public abstract class UnivariateRealIntegratorImpl implements UnivariateRealInte * @exception NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations */ - protected UnivariateRealIntegratorImpl(final double relativeAccuracy, + protected BaseAbstractUnivariateIntegrator(final double relativeAccuracy, final double absoluteAccuracy, final int minimalIterationCount, final int maximalIterationCount) @@ -137,7 +137,7 @@ public abstract class UnivariateRealIntegratorImpl implements UnivariateRealInte * @param relativeAccuracy relative accuracy of the result * @param absoluteAccuracy absolute accuracy of the result */ - protected UnivariateRealIntegratorImpl(final double relativeAccuracy, + protected BaseAbstractUnivariateIntegrator(final double relativeAccuracy, final double absoluteAccuracy) { this(relativeAccuracy, absoluteAccuracy, DEFAULT_MIN_ITERATIONS_COUNT, DEFAULT_MAX_ITERATIONS_COUNT); @@ -152,7 +152,7 @@ public abstract class UnivariateRealIntegratorImpl implements UnivariateRealInte * @exception NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations */ - protected UnivariateRealIntegratorImpl(final int minimalIterationCount, + protected BaseAbstractUnivariateIntegrator(final int minimalIterationCount, final int maximalIterationCount) throws NotStrictlyPositiveException, NumberIsTooSmallException { this(DEFAULT_RELATIVE_ACCURACY, DEFAULT_ABSOLUTE_ACCURACY, diff --git a/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java b/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java index 62dc6252a..d5850e194 100644 --- a/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java +++ b/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java @@ -51,7 +51,7 @@ import org.apache.commons.math.util.FastMath; * @since 1.2 */ -public class LegendreGaussIntegrator extends UnivariateRealIntegratorImpl { +public class LegendreGaussIntegrator extends BaseAbstractUnivariateIntegrator { /** Abscissas for the 2 points method. */ private static final double[] ABSCISSAS_2 = { diff --git a/src/main/java/org/apache/commons/math/analysis/integration/RombergIntegrator.java b/src/main/java/org/apache/commons/math/analysis/integration/RombergIntegrator.java index 57c1babfc..841c2a7b9 100644 --- a/src/main/java/org/apache/commons/math/analysis/integration/RombergIntegrator.java +++ b/src/main/java/org/apache/commons/math/analysis/integration/RombergIntegrator.java @@ -36,7 +36,7 @@ import org.apache.commons.math.util.FastMath; * @version $Id$ * @since 1.2 */ -public class RombergIntegrator extends UnivariateRealIntegratorImpl { +public class RombergIntegrator extends BaseAbstractUnivariateIntegrator { /** Maximal number of iterations for Romberg. */ public static final int ROMBERG_MAX_ITERATIONS_COUNT = 32; diff --git a/src/main/java/org/apache/commons/math/analysis/integration/SimpsonIntegrator.java b/src/main/java/org/apache/commons/math/analysis/integration/SimpsonIntegrator.java index b5ddc8b8b..0bbb748a7 100644 --- a/src/main/java/org/apache/commons/math/analysis/integration/SimpsonIntegrator.java +++ b/src/main/java/org/apache/commons/math/analysis/integration/SimpsonIntegrator.java @@ -35,7 +35,7 @@ import org.apache.commons.math.util.FastMath; * @version $Id$ * @since 1.2 */ -public class SimpsonIntegrator extends UnivariateRealIntegratorImpl { +public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator { /** Maximal number of iterations for Simpson. */ public static final int SIMPSON_MAX_ITERATIONS_COUNT = 64; diff --git a/src/main/java/org/apache/commons/math/analysis/integration/TrapezoidIntegrator.java b/src/main/java/org/apache/commons/math/analysis/integration/TrapezoidIntegrator.java index 68187ccf7..3f7d817b7 100644 --- a/src/main/java/org/apache/commons/math/analysis/integration/TrapezoidIntegrator.java +++ b/src/main/java/org/apache/commons/math/analysis/integration/TrapezoidIntegrator.java @@ -34,7 +34,7 @@ import org.apache.commons.math.util.FastMath; * @version $Id$ * @since 1.2 */ -public class TrapezoidIntegrator extends UnivariateRealIntegratorImpl { +public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator { /** Maximum number of iterations for trapezoid. */ public static final int TRAPEZOID_MAX_ITERATIONS_COUNT = 64; @@ -113,7 +113,7 @@ public class TrapezoidIntegrator extends UnivariateRealIntegratorImpl { * @throws TooManyEvaluationsException if the maximal number of evaluations * is exceeded. */ - double stage(final UnivariateRealIntegratorImpl baseIntegrator, final int n) + double stage(final BaseAbstractUnivariateIntegrator baseIntegrator, final int n) throws TooManyEvaluationsException { if (n == 0) { diff --git a/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java b/src/main/java/org/apache/commons/math/analysis/integration/UnivariateIntegrator.java similarity index 98% rename from src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java rename to src/main/java/org/apache/commons/math/analysis/integration/UnivariateIntegrator.java index 3fc7593f7..1252248c4 100644 --- a/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java +++ b/src/main/java/org/apache/commons/math/analysis/integration/UnivariateIntegrator.java @@ -28,7 +28,7 @@ import org.apache.commons.math.exception.TooManyEvaluationsException; * @version $Id$ * @since 1.2 */ -public interface UnivariateRealIntegrator { +public interface UnivariateIntegrator { /** * Get the actual relative accuracy. diff --git a/src/test/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegratorTest.java b/src/test/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegratorTest.java index 0c58edba6..bd3ac0546 100644 --- a/src/test/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegratorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegratorTest.java @@ -33,7 +33,7 @@ public class LegendreGaussIntegratorTest { @Test public void testSinFunction() { UnivariateFunction f = new SinFunction(); - UnivariateRealIntegratorImpl integrator = new LegendreGaussIntegrator(5, 1.0e-14, 1.0e-10, 2, 15); + BaseAbstractUnivariateIntegrator integrator = new LegendreGaussIntegrator(5, 1.0e-14, 1.0e-10, 2, 15); double min, max, expected, result, tolerance; min = 0; max = FastMath.PI; expected = 2; @@ -52,11 +52,11 @@ public class LegendreGaussIntegratorTest { @Test public void testQuinticFunction() { UnivariateFunction f = new QuinticFunction(); - UnivariateRealIntegrator integrator = + UnivariateIntegrator integrator = new LegendreGaussIntegrator(3, - UnivariateRealIntegratorImpl.DEFAULT_RELATIVE_ACCURACY, - UnivariateRealIntegratorImpl.DEFAULT_ABSOLUTE_ACCURACY, - UnivariateRealIntegratorImpl.DEFAULT_MIN_ITERATIONS_COUNT, + BaseAbstractUnivariateIntegrator.DEFAULT_RELATIVE_ACCURACY, + BaseAbstractUnivariateIntegrator.DEFAULT_ABSOLUTE_ACCURACY, + BaseAbstractUnivariateIntegrator.DEFAULT_MIN_ITERATIONS_COUNT, 64); double min, max, expected, result; @@ -79,9 +79,9 @@ public class LegendreGaussIntegratorTest { for (int n = 2; n < 6; ++n) { LegendreGaussIntegrator integrator = new LegendreGaussIntegrator(n, - UnivariateRealIntegratorImpl.DEFAULT_RELATIVE_ACCURACY, - UnivariateRealIntegratorImpl.DEFAULT_ABSOLUTE_ACCURACY, - UnivariateRealIntegratorImpl.DEFAULT_MIN_ITERATIONS_COUNT, + BaseAbstractUnivariateIntegrator.DEFAULT_RELATIVE_ACCURACY, + BaseAbstractUnivariateIntegrator.DEFAULT_ABSOLUTE_ACCURACY, + BaseAbstractUnivariateIntegrator.DEFAULT_MIN_ITERATIONS_COUNT, 64); // an n points Gauss-Legendre integrator integrates 2n-1 degree polynoms exactly diff --git a/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java b/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java index c720e1ff9..0865dc86c 100644 --- a/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/integration/RombergIntegratorTest.java @@ -43,7 +43,7 @@ public final class RombergIntegratorTest { @Test public void testSinFunction() { UnivariateFunction f = new SinFunction(); - UnivariateRealIntegrator integrator = new RombergIntegrator(); + UnivariateIntegrator integrator = new RombergIntegrator(); double min, max, expected, result, tolerance; min = 0; max = FastMath.PI; expected = 2; @@ -67,7 +67,7 @@ public final class RombergIntegratorTest { @Test public void testQuinticFunction() { UnivariateFunction f = new QuinticFunction(); - UnivariateRealIntegrator integrator = new RombergIntegrator(); + UnivariateIntegrator integrator = new RombergIntegrator(); double min, max, expected, result, tolerance; min = 0; max = 1; expected = -1.0/48; diff --git a/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java b/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java index bbf56265a..da5256866 100644 --- a/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/integration/SimpsonIntegratorTest.java @@ -42,7 +42,7 @@ public final class SimpsonIntegratorTest { @Test public void testSinFunction() { UnivariateFunction f = new SinFunction(); - UnivariateRealIntegrator integrator = new SimpsonIntegrator(); + UnivariateIntegrator integrator = new SimpsonIntegrator(); double min, max, expected, result, tolerance; min = 0; max = FastMath.PI; expected = 2; @@ -66,7 +66,7 @@ public final class SimpsonIntegratorTest { @Test public void testQuinticFunction() { UnivariateFunction f = new QuinticFunction(); - UnivariateRealIntegrator integrator = new SimpsonIntegrator(); + UnivariateIntegrator integrator = new SimpsonIntegrator(); double min, max, expected, result, tolerance; min = 0; max = 1; expected = -1.0/48; diff --git a/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java b/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java index 22e832352..78d3f7c07 100644 --- a/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/integration/TrapezoidIntegratorTest.java @@ -42,7 +42,7 @@ public final class TrapezoidIntegratorTest { @Test public void testSinFunction() { UnivariateFunction f = new SinFunction(); - UnivariateRealIntegrator integrator = new TrapezoidIntegrator(); + UnivariateIntegrator integrator = new TrapezoidIntegrator(); double min, max, expected, result, tolerance; min = 0; max = FastMath.PI; expected = 2; @@ -66,7 +66,7 @@ public final class TrapezoidIntegratorTest { @Test public void testQuinticFunction() { UnivariateFunction f = new QuinticFunction(); - UnivariateRealIntegrator integrator = new TrapezoidIntegrator(); + UnivariateIntegrator integrator = new TrapezoidIntegrator(); double min, max, expected, result, tolerance; min = 0; max = 1; expected = -1.0/48; diff --git a/src/test/java/org/apache/commons/math/distribution/AbstractRealDistributionTest.java b/src/test/java/org/apache/commons/math/distribution/AbstractRealDistributionTest.java index 182e69ff0..a1b65659f 100644 --- a/src/test/java/org/apache/commons/math/distribution/AbstractRealDistributionTest.java +++ b/src/test/java/org/apache/commons/math/distribution/AbstractRealDistributionTest.java @@ -18,7 +18,7 @@ package org.apache.commons.math.distribution; import org.apache.commons.math.analysis.UnivariateFunction; import org.apache.commons.math.analysis.integration.RombergIntegrator; -import org.apache.commons.math.analysis.integration.UnivariateRealIntegrator; +import org.apache.commons.math.analysis.integration.UnivariateIntegrator; import org.apache.commons.math.exception.OutOfRangeException; import org.junit.Assert; import org.junit.Test; @@ -156,7 +156,7 @@ public class AbstractRealDistributionTest { return x * density(x); } }; - final UnivariateRealIntegrator integrator = new RombergIntegrator(); + final UnivariateIntegrator integrator = new RombergIntegrator(); return integrator.integrate(Integer.MAX_VALUE, f, x0, x4); } @@ -168,7 +168,7 @@ public class AbstractRealDistributionTest { return x * x * density(x); } }; - final UnivariateRealIntegrator integrator = new RombergIntegrator(); + final UnivariateIntegrator integrator = new RombergIntegrator(); final double meanX2 = integrator.integrate(Integer.MAX_VALUE, f, x0, x4); return meanX2 - meanX * meanX;