Return-Path:
- * The {@code function} package contains function objects that wrap the
- * methods contained in {@link java.lang.Math}, as well as common
- * mathematical functions such as the gaussian and sinc functions.
- *
- * The meanings of the various parameters are:
- *
- * The value of {@code x[0]} is ignored, but it must be strictly less than
- * {@code x[1]}.
- *
- * @param x Domain values where the function changes value.
- * @param y Values of the function.
- * @throws NonMonotonicSequenceException
- * if the {@code x} array is not sorted in strictly increasing order.
- * @throws NullArgumentException if {@code x} or {@code y} are {@code null}.
- * @throws NoDataException if {@code x} or {@code y} are zero-length.
- * @throws DimensionMismatchException if {@code x} and {@code y} do not
- * have the same length.
- */
- public StepFunction(double[] x,
- double[] y)
- throws NullArgumentException, NoDataException,
- DimensionMismatchException, NonMonotonicSequenceException {
- if (x == null ||
- y == null) {
- throw new NullArgumentException();
- }
- if (x.length == 0 ||
- y.length == 0) {
- throw new NoDataException();
- }
- if (y.length != x.length) {
- throw new DimensionMismatchException(y.length, x.length);
- }
- MathArrays.checkOrder(x);
-
- abscissa = MathArrays.copyOf(x);
- ordinate = MathArrays.copyOf(y);
- }
-
- /** {@inheritDoc} */
- public double value(double x) {
- int index = Arrays.binarySearch(abscissa, x);
- double fx = 0;
-
- if (index < -1) {
- // "x" is between "abscissa[-index-2]" and "abscissa[-index-1]".
- fx = ordinate[-index-2];
- } else if (index >= 0) {
- // "x" is exactly "abscissa[index]".
- fx = ordinate[index];
- } else {
- // Otherwise, "x" is smaller than the first value in "abscissa"
- // (hence the returned value should be "ordinate[0]").
- fx = ordinate[0];
- }
-
- return fx;
- }
-}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/function/Subtract.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/analysis/function/Subtract.java b/src/main/java/org/apache/commons/math3/analysis/function/Subtract.java
deleted file mode 100644
index 7b87dd6..0000000
--- a/src/main/java/org/apache/commons/math3/analysis/function/Subtract.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math3.analysis.function;
-
-import org.apache.commons.math3.analysis.BivariateFunction;
-
-/**
- * Subtract the second operand from the first.
- *
- * @since 3.0
- */
-public class Subtract implements BivariateFunction {
- /** {@inheritDoc} */
- public double value(double x, double y) {
- return x - y;
- }
-}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/function/Tan.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/analysis/function/Tan.java b/src/main/java/org/apache/commons/math3/analysis/function/Tan.java
deleted file mode 100644
index 03304b4..0000000
--- a/src/main/java/org/apache/commons/math3/analysis/function/Tan.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math3.analysis.function;
-
-import org.apache.commons.math3.analysis.FunctionUtils;
-import org.apache.commons.math3.analysis.UnivariateFunction;
-import org.apache.commons.math3.analysis.DifferentiableUnivariateFunction;
-import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;
-import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction;
-import org.apache.commons.math3.util.FastMath;
-
-/**
- * Tangent function.
- *
- * @since 3.0
- */
-public class Tan implements UnivariateDifferentiableFunction, DifferentiableUnivariateFunction {
- /** {@inheritDoc} */
- public double value(double x) {
- return FastMath.tan(x);
- }
-
- /** {@inheritDoc}
- * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
- */
- @Deprecated
- public UnivariateFunction derivative() {
- return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
- }
-
- /** {@inheritDoc}
- * @since 3.1
- */
- public DerivativeStructure value(final DerivativeStructure t) {
- return t.tan();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/function/Tanh.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/analysis/function/Tanh.java b/src/main/java/org/apache/commons/math3/analysis/function/Tanh.java
deleted file mode 100644
index 6c7ef0d..0000000
--- a/src/main/java/org/apache/commons/math3/analysis/function/Tanh.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math3.analysis.function;
-
-import org.apache.commons.math3.analysis.FunctionUtils;
-import org.apache.commons.math3.analysis.UnivariateFunction;
-import org.apache.commons.math3.analysis.DifferentiableUnivariateFunction;
-import org.apache.commons.math3.analysis.differentiation.DerivativeStructure;
-import org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction;
-import org.apache.commons.math3.util.FastMath;
-
-/**
- * Hyperbolic tangent function.
- *
- * @since 3.0
- */
-public class Tanh implements UnivariateDifferentiableFunction, DifferentiableUnivariateFunction {
- /** {@inheritDoc} */
- public double value(double x) {
- return FastMath.tanh(x);
- }
-
- /** {@inheritDoc}
- * @deprecated as of 3.1, replaced by {@link #value(DerivativeStructure)}
- */
- @Deprecated
- public UnivariateFunction derivative() {
- return FunctionUtils.toDifferentiableUnivariateFunction(this).derivative();
- }
-
- /** {@inheritDoc}
- * @since 3.1
- */
- public DerivativeStructure value(final DerivativeStructure t) {
- return t.tanh();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/function/Ulp.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/analysis/function/Ulp.java b/src/main/java/org/apache/commons/math3/analysis/function/Ulp.java
deleted file mode 100644
index d075a73..0000000
--- a/src/main/java/org/apache/commons/math3/analysis/function/Ulp.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.math3.analysis.function;
-
-import org.apache.commons.math3.analysis.UnivariateFunction;
-import org.apache.commons.math3.util.FastMath;
-
-/**
- * {@code ulp} function.
- *
- * @since 3.0
- */
-public class Ulp implements UnivariateFunction {
- /** {@inheritDoc} */
- public double value(double x) {
- return FastMath.ulp(x);
- }
-}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/function/package-info.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math3/analysis/function/package-info.java b/src/main/java/org/apache/commons/math3/analysis/function/package-info.java
deleted file mode 100644
index cb24544..0000000
--- a/src/main/java/org/apache/commons/math3/analysis/function/package-info.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- *
- *
- * h(x) = y[0] for all x < x[1]
- * y[1] for x[1] <= x < x[2]
- * ...
- * y[y.length - 1] for x >= x[x.length - 1]
- *
- *
- *
- * Legendre-Gauss integrators are efficient integrators that can - * accurately integrate functions with few function evaluations. A - * Legendre-Gauss integrator using an n-points quadrature formula can - * integrate 2n-1 degree polynomials exactly. - *
- *- * These integrators evaluate the function on n carefully chosen - * abscissas in each step interval (mapped to the canonical [-1,1] interval). - * The evaluation abscissas are not evenly spaced and none of them are - * at the interval endpoints. This implies the function integrated can be - * undefined at integration interval endpoints. - *
- *- * The evaluation abscissas xi are the roots of the degree n - * Legendre polynomial. The weights ai of the quadrature formula - * integrals from -1 to +1 ∫ Li2 where Li (x) = - * ∏ (x-xk)/(xi-xk) for k != i. - *
- *- * @since 1.2 - * @deprecated As of 3.1 (to be removed in 4.0). Please use - * {@link IterativeLegendreGaussIntegrator} instead. - */ -@Deprecated -public class LegendreGaussIntegrator extends BaseAbstractUnivariateIntegrator { - - /** Abscissas for the 2 points method. */ - private static final double[] ABSCISSAS_2 = { - -1.0 / FastMath.sqrt(3.0), - 1.0 / FastMath.sqrt(3.0) - }; - - /** Weights for the 2 points method. */ - private static final double[] WEIGHTS_2 = { - 1.0, - 1.0 - }; - - /** Abscissas for the 3 points method. */ - private static final double[] ABSCISSAS_3 = { - -FastMath.sqrt(0.6), - 0.0, - FastMath.sqrt(0.6) - }; - - /** Weights for the 3 points method. */ - private static final double[] WEIGHTS_3 = { - 5.0 / 9.0, - 8.0 / 9.0, - 5.0 / 9.0 - }; - - /** Abscissas for the 4 points method. */ - private static final double[] ABSCISSAS_4 = { - -FastMath.sqrt((15.0 + 2.0 * FastMath.sqrt(30.0)) / 35.0), - -FastMath.sqrt((15.0 - 2.0 * FastMath.sqrt(30.0)) / 35.0), - FastMath.sqrt((15.0 - 2.0 * FastMath.sqrt(30.0)) / 35.0), - FastMath.sqrt((15.0 + 2.0 * FastMath.sqrt(30.0)) / 35.0) - }; - - /** Weights for the 4 points method. */ - private static final double[] WEIGHTS_4 = { - (90.0 - 5.0 * FastMath.sqrt(30.0)) / 180.0, - (90.0 + 5.0 * FastMath.sqrt(30.0)) / 180.0, - (90.0 + 5.0 * FastMath.sqrt(30.0)) / 180.0, - (90.0 - 5.0 * FastMath.sqrt(30.0)) / 180.0 - }; - - /** Abscissas for the 5 points method. */ - private static final double[] ABSCISSAS_5 = { - -FastMath.sqrt((35.0 + 2.0 * FastMath.sqrt(70.0)) / 63.0), - -FastMath.sqrt((35.0 - 2.0 * FastMath.sqrt(70.0)) / 63.0), - 0.0, - FastMath.sqrt((35.0 - 2.0 * FastMath.sqrt(70.0)) / 63.0), - FastMath.sqrt((35.0 + 2.0 * FastMath.sqrt(70.0)) / 63.0) - }; - - /** Weights for the 5 points method. */ - private static final double[] WEIGHTS_5 = { - (322.0 - 13.0 * FastMath.sqrt(70.0)) / 900.0, - (322.0 + 13.0 * FastMath.sqrt(70.0)) / 900.0, - 128.0 / 225.0, - (322.0 + 13.0 * FastMath.sqrt(70.0)) / 900.0, - (322.0 - 13.0 * FastMath.sqrt(70.0)) / 900.0 - }; - - /** Abscissas for the current method. */ - private final double[] abscissas; - - /** Weights for the current method. */ - private final double[] weights; - - /** - * Build a Legendre-Gauss integrator with given accuracies and iterations counts. - * @param n number of points desired (must be between 2 and 5 inclusive) - * @param relativeAccuracy relative accuracy of the result - * @param absoluteAccuracy absolute accuracy of the result - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * @exception MathIllegalArgumentException if number of points is out of [2; 5] - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - */ - public LegendreGaussIntegrator(final int n, - final double relativeAccuracy, - final double absoluteAccuracy, - final int minimalIterationCount, - final int maximalIterationCount) - throws MathIllegalArgumentException, NotStrictlyPositiveException, NumberIsTooSmallException { - super(relativeAccuracy, absoluteAccuracy, minimalIterationCount, maximalIterationCount); - switch(n) { - case 2 : - abscissas = ABSCISSAS_2; - weights = WEIGHTS_2; - break; - case 3 : - abscissas = ABSCISSAS_3; - weights = WEIGHTS_3; - break; - case 4 : - abscissas = ABSCISSAS_4; - weights = WEIGHTS_4; - break; - case 5 : - abscissas = ABSCISSAS_5; - weights = WEIGHTS_5; - break; - default : - throw new MathIllegalArgumentException( - LocalizedFormats.N_POINTS_GAUSS_LEGENDRE_INTEGRATOR_NOT_SUPPORTED, - n, 2, 5); - } - - } - - /** - * Build a Legendre-Gauss integrator with given accuracies. - * @param n number of points desired (must be between 2 and 5 inclusive) - * @param relativeAccuracy relative accuracy of the result - * @param absoluteAccuracy absolute accuracy of the result - * @exception MathIllegalArgumentException if number of points is out of [2; 5] - */ - public LegendreGaussIntegrator(final int n, - final double relativeAccuracy, - final double absoluteAccuracy) - throws MathIllegalArgumentException { - this(n, relativeAccuracy, absoluteAccuracy, - DEFAULT_MIN_ITERATIONS_COUNT, DEFAULT_MAX_ITERATIONS_COUNT); - } - - /** - * Build a Legendre-Gauss integrator with given iteration counts. - * @param n number of points desired (must be between 2 and 5 inclusive) - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * @exception MathIllegalArgumentException if number of points is out of [2; 5] - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - */ - public LegendreGaussIntegrator(final int n, - final int minimalIterationCount, - final int maximalIterationCount) - throws MathIllegalArgumentException { - this(n, DEFAULT_RELATIVE_ACCURACY, DEFAULT_ABSOLUTE_ACCURACY, - minimalIterationCount, maximalIterationCount); - } - - /** {@inheritDoc} */ - @Override - protected double doIntegrate() - throws MathIllegalArgumentException, TooManyEvaluationsException, MaxCountExceededException { - - // compute first estimate with a single step - double oldt = stage(1); - - int n = 2; - while (true) { - - // improve integral with a larger number of steps - final double t = stage(n); - - // estimate error - final double delta = FastMath.abs(t - oldt); - final double limit = - FastMath.max(getAbsoluteAccuracy(), - getRelativeAccuracy() * (FastMath.abs(oldt) + FastMath.abs(t)) * 0.5); - - // check convergence - if ((iterations.getCount() + 1 >= getMinimalIterationCount()) && (delta <= limit)) { - return t; - } - - // prepare next iteration - double ratio = FastMath.min(4, FastMath.pow(delta / limit, 0.5 / abscissas.length)); - n = FastMath.max((int) (ratio * n), n + 1); - oldt = t; - iterations.incrementCount(); - - } - - } - - /** - * Compute the n-th stage integral. - * @param n number of steps - * @return the value of n-th stage integral - * @throws TooManyEvaluationsException if the maximum number of evaluations - * is exceeded. - */ - private double stage(final int n) - throws TooManyEvaluationsException { - - // set up the step for the current stage - final double step = (getMax() - getMin()) / n; - final double halfStep = step / 2.0; - - // integrate over all elementary steps - double midPoint = getMin() + halfStep; - double sum = 0.0; - for (int i = 0; i < n; ++i) { - for (int j = 0; j < abscissas.length; ++j) { - sum += weights[j] * computeObjectiveValue(midPoint + halfStep * abscissas[j]); - } - midPoint += step; - } - - return halfStep * sum; - - } - -} http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/integration/MidPointIntegrator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/integration/MidPointIntegrator.java b/src/main/java/org/apache/commons/math3/analysis/integration/MidPointIntegrator.java deleted file mode 100644 index aaea286..0000000 --- a/src/main/java/org/apache/commons/math3/analysis/integration/MidPointIntegrator.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math3.analysis.integration; - -import org.apache.commons.math3.exception.MathIllegalArgumentException; -import org.apache.commons.math3.exception.MaxCountExceededException; -import org.apache.commons.math3.exception.NotStrictlyPositiveException; -import org.apache.commons.math3.exception.NumberIsTooLargeException; -import org.apache.commons.math3.exception.NumberIsTooSmallException; -import org.apache.commons.math3.exception.TooManyEvaluationsException; -import org.apache.commons.math3.util.FastMath; - -/** - * Implements the - * Midpoint Rule for integration of real univariate functions. For - * reference, see Numerical Mathematics, ISBN 0387989595, - * chapter 9.2. - *
- * The function should be integrable.
- * - * @since 3.3 - */ -public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator { - - /** Maximum number of iterations for midpoint. */ - public static final int MIDPOINT_MAX_ITERATIONS_COUNT = 64; - - /** - * Build a midpoint integrator with given accuracies and iterations counts. - * @param relativeAccuracy relative accuracy of the result - * @param absoluteAccuracy absolute accuracy of the result - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * (must be less than or equal to {@link #MIDPOINT_MAX_ITERATIONS_COUNT} - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - * @exception NumberIsTooLargeException if maximal number of iterations - * is greater than {@link #MIDPOINT_MAX_ITERATIONS_COUNT} - */ - public MidPointIntegrator(final double relativeAccuracy, - final double absoluteAccuracy, - final int minimalIterationCount, - final int maximalIterationCount) - throws NotStrictlyPositiveException, NumberIsTooSmallException, NumberIsTooLargeException { - super(relativeAccuracy, absoluteAccuracy, minimalIterationCount, maximalIterationCount); - if (maximalIterationCount > MIDPOINT_MAX_ITERATIONS_COUNT) { - throw new NumberIsTooLargeException(maximalIterationCount, - MIDPOINT_MAX_ITERATIONS_COUNT, false); - } - } - - /** - * Build a midpoint integrator with given iteration counts. - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * (must be less than or equal to {@link #MIDPOINT_MAX_ITERATIONS_COUNT} - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - * @exception NumberIsTooLargeException if maximal number of iterations - * is greater than {@link #MIDPOINT_MAX_ITERATIONS_COUNT} - */ - public MidPointIntegrator(final int minimalIterationCount, - final int maximalIterationCount) - throws NotStrictlyPositiveException, NumberIsTooSmallException, NumberIsTooLargeException { - super(minimalIterationCount, maximalIterationCount); - if (maximalIterationCount > MIDPOINT_MAX_ITERATIONS_COUNT) { - throw new NumberIsTooLargeException(maximalIterationCount, - MIDPOINT_MAX_ITERATIONS_COUNT, false); - } - } - - /** - * Construct a midpoint integrator with default settings. - * (max iteration count set to {@link #MIDPOINT_MAX_ITERATIONS_COUNT}) - */ - public MidPointIntegrator() { - super(DEFAULT_MIN_ITERATIONS_COUNT, MIDPOINT_MAX_ITERATIONS_COUNT); - } - - /** - * Compute the n-th stage integral of midpoint rule. - * This function should only be called by APIintegrate()
in the package.
- * To save time it does not verify arguments - caller does.
- * - * The interval is divided equally into 2^n sections rather than an - * arbitrary m sections because this configuration can best utilize the - * already computed values.
- * - * @param n the stage of 1/2 refinement. Must be larger than 0. - * @param previousStageResult Result from the previous call to the - * {@code stage} method. - * @param min Lower bound of the integration interval. - * @param diffMaxMin Difference between the lower bound and upper bound - * of the integration interval. - * @return the value of n-th stage integral - * @throws TooManyEvaluationsException if the maximal number of evaluations - * is exceeded. - */ - private double stage(final int n, - double previousStageResult, - double min, - double diffMaxMin) - throws TooManyEvaluationsException { - - // number of new points in this stage - final long np = 1L << (n - 1); - double sum = 0; - - // spacing between adjacent new points - final double spacing = diffMaxMin / np; - - // the first new point - double x = min + 0.5 * spacing; - for (long i = 0; i < np; i++) { - sum += computeObjectiveValue(x); - x += spacing; - } - // add the new sum to previously calculated result - return 0.5 * (previousStageResult + sum * spacing); - } - - - /** {@inheritDoc} */ - @Override - protected double doIntegrate() - throws MathIllegalArgumentException, TooManyEvaluationsException, MaxCountExceededException { - - final double min = getMin(); - final double diff = getMax() - min; - final double midPoint = min + 0.5 * diff; - - double oldt = diff * computeObjectiveValue(midPoint); - - while (true) { - iterations.incrementCount(); - final int i = iterations.getCount(); - final double t = stage(i, oldt, min, diff); - if (i >= getMinimalIterationCount()) { - final double delta = FastMath.abs(t - oldt); - final double rLimit = - getRelativeAccuracy() * (FastMath.abs(oldt) + FastMath.abs(t)) * 0.5; - if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy())) { - return t; - } - } - oldt = t; - } - - } - -} http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/integration/RombergIntegrator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/integration/RombergIntegrator.java b/src/main/java/org/apache/commons/math3/analysis/integration/RombergIntegrator.java deleted file mode 100644 index 430cd6e..0000000 --- a/src/main/java/org/apache/commons/math3/analysis/integration/RombergIntegrator.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math3.analysis.integration; - -import org.apache.commons.math3.exception.MaxCountExceededException; -import org.apache.commons.math3.exception.NotStrictlyPositiveException; -import org.apache.commons.math3.exception.NumberIsTooLargeException; -import org.apache.commons.math3.exception.NumberIsTooSmallException; -import org.apache.commons.math3.exception.TooManyEvaluationsException; -import org.apache.commons.math3.util.FastMath; - -/** - * Implements the - * Romberg Algorithm for integration of real univariate functions. For - * reference, see Introduction to Numerical Analysis, ISBN 038795452X, - * chapter 3. - *- * Romberg integration employs k successive refinements of the trapezoid - * rule to remove error terms less than order O(N^(-2k)). Simpson's rule - * is a special case of k = 2.
- * - * @since 1.2 - */ -public class RombergIntegrator extends BaseAbstractUnivariateIntegrator { - - /** Maximal number of iterations for Romberg. */ - public static final int ROMBERG_MAX_ITERATIONS_COUNT = 32; - - /** - * Build a Romberg integrator with given accuracies and iterations counts. - * @param relativeAccuracy relative accuracy of the result - * @param absoluteAccuracy absolute accuracy of the result - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * (must be less than or equal to {@link #ROMBERG_MAX_ITERATIONS_COUNT}) - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - * @exception NumberIsTooLargeException if maximal number of iterations - * is greater than {@link #ROMBERG_MAX_ITERATIONS_COUNT} - */ - public RombergIntegrator(final double relativeAccuracy, - final double absoluteAccuracy, - final int minimalIterationCount, - final int maximalIterationCount) - throws NotStrictlyPositiveException, NumberIsTooSmallException, NumberIsTooLargeException { - super(relativeAccuracy, absoluteAccuracy, minimalIterationCount, maximalIterationCount); - if (maximalIterationCount > ROMBERG_MAX_ITERATIONS_COUNT) { - throw new NumberIsTooLargeException(maximalIterationCount, - ROMBERG_MAX_ITERATIONS_COUNT, false); - } - } - - /** - * Build a Romberg integrator with given iteration counts. - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * (must be less than or equal to {@link #ROMBERG_MAX_ITERATIONS_COUNT}) - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - * @exception NumberIsTooLargeException if maximal number of iterations - * is greater than {@link #ROMBERG_MAX_ITERATIONS_COUNT} - */ - public RombergIntegrator(final int minimalIterationCount, - final int maximalIterationCount) - throws NotStrictlyPositiveException, NumberIsTooSmallException, NumberIsTooLargeException { - super(minimalIterationCount, maximalIterationCount); - if (maximalIterationCount > ROMBERG_MAX_ITERATIONS_COUNT) { - throw new NumberIsTooLargeException(maximalIterationCount, - ROMBERG_MAX_ITERATIONS_COUNT, false); - } - } - - /** - * Construct a Romberg integrator with default settings - * (max iteration count set to {@link #ROMBERG_MAX_ITERATIONS_COUNT}) - */ - public RombergIntegrator() { - super(DEFAULT_MIN_ITERATIONS_COUNT, ROMBERG_MAX_ITERATIONS_COUNT); - } - - /** {@inheritDoc} */ - @Override - protected double doIntegrate() - throws TooManyEvaluationsException, MaxCountExceededException { - - final int m = iterations.getMaximalCount() + 1; - double previousRow[] = new double[m]; - double currentRow[] = new double[m]; - - TrapezoidIntegrator qtrap = new TrapezoidIntegrator(); - currentRow[0] = qtrap.stage(this, 0); - iterations.incrementCount(); - double olds = currentRow[0]; - while (true) { - - final int i = iterations.getCount(); - - // switch rows - final double[] tmpRow = previousRow; - previousRow = currentRow; - currentRow = tmpRow; - - currentRow[0] = qtrap.stage(this, i); - iterations.incrementCount(); - for (int j = 1; j <= i; j++) { - // Richardson extrapolation coefficient - final double r = (1L << (2 * j)) - 1; - final double tIJm1 = currentRow[j - 1]; - currentRow[j] = tIJm1 + (tIJm1 - previousRow[j - 1]) / r; - } - final double s = currentRow[i]; - if (i >= getMinimalIterationCount()) { - final double delta = FastMath.abs(s - olds); - final double rLimit = getRelativeAccuracy() * (FastMath.abs(olds) + FastMath.abs(s)) * 0.5; - if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy())) { - return s; - } - } - olds = s; - } - - } - -} http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/integration/SimpsonIntegrator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/integration/SimpsonIntegrator.java b/src/main/java/org/apache/commons/math3/analysis/integration/SimpsonIntegrator.java deleted file mode 100644 index b13ff5f..0000000 --- a/src/main/java/org/apache/commons/math3/analysis/integration/SimpsonIntegrator.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math3.analysis.integration; - -import org.apache.commons.math3.exception.MaxCountExceededException; -import org.apache.commons.math3.exception.NotStrictlyPositiveException; -import org.apache.commons.math3.exception.NumberIsTooLargeException; -import org.apache.commons.math3.exception.NumberIsTooSmallException; -import org.apache.commons.math3.exception.TooManyEvaluationsException; -import org.apache.commons.math3.util.FastMath; - -/** - * Implements - * Simpson's Rule for integration of real univariate functions. For - * reference, see Introduction to Numerical Analysis, ISBN 038795452X, - * chapter 3. - *- * This implementation employs the basic trapezoid rule to calculate Simpson's - * rule.
- * - * @since 1.2 - */ -public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator { - - /** Maximal number of iterations for Simpson. */ - public static final int SIMPSON_MAX_ITERATIONS_COUNT = 64; - - /** - * Build a Simpson integrator with given accuracies and iterations counts. - * @param relativeAccuracy relative accuracy of the result - * @param absoluteAccuracy absolute accuracy of the result - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * (must be less than or equal to {@link #SIMPSON_MAX_ITERATIONS_COUNT}) - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - * @exception NumberIsTooLargeException if maximal number of iterations - * is greater than {@link #SIMPSON_MAX_ITERATIONS_COUNT} - */ - public SimpsonIntegrator(final double relativeAccuracy, - final double absoluteAccuracy, - final int minimalIterationCount, - final int maximalIterationCount) - throws NotStrictlyPositiveException, NumberIsTooSmallException, NumberIsTooLargeException { - super(relativeAccuracy, absoluteAccuracy, minimalIterationCount, maximalIterationCount); - if (maximalIterationCount > SIMPSON_MAX_ITERATIONS_COUNT) { - throw new NumberIsTooLargeException(maximalIterationCount, - SIMPSON_MAX_ITERATIONS_COUNT, false); - } - } - - /** - * Build a Simpson integrator with given iteration counts. - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * (must be less than or equal to {@link #SIMPSON_MAX_ITERATIONS_COUNT}) - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - * @exception NumberIsTooLargeException if maximal number of iterations - * is greater than {@link #SIMPSON_MAX_ITERATIONS_COUNT} - */ - public SimpsonIntegrator(final int minimalIterationCount, - final int maximalIterationCount) - throws NotStrictlyPositiveException, NumberIsTooSmallException, NumberIsTooLargeException { - super(minimalIterationCount, maximalIterationCount); - if (maximalIterationCount > SIMPSON_MAX_ITERATIONS_COUNT) { - throw new NumberIsTooLargeException(maximalIterationCount, - SIMPSON_MAX_ITERATIONS_COUNT, false); - } - } - - /** - * Construct an integrator with default settings. - * (max iteration count set to {@link #SIMPSON_MAX_ITERATIONS_COUNT}) - */ - public SimpsonIntegrator() { - super(DEFAULT_MIN_ITERATIONS_COUNT, SIMPSON_MAX_ITERATIONS_COUNT); - } - - /** {@inheritDoc} */ - @Override - protected double doIntegrate() - throws TooManyEvaluationsException, MaxCountExceededException { - - TrapezoidIntegrator qtrap = new TrapezoidIntegrator(); - if (getMinimalIterationCount() == 1) { - return (4 * qtrap.stage(this, 1) - qtrap.stage(this, 0)) / 3.0; - } - - // Simpson's rule requires at least two trapezoid stages. - double olds = 0; - double oldt = qtrap.stage(this, 0); - while (true) { - final double t = qtrap.stage(this, iterations.getCount()); - iterations.incrementCount(); - final double s = (4 * t - oldt) / 3.0; - if (iterations.getCount() >= getMinimalIterationCount()) { - final double delta = FastMath.abs(s - olds); - final double rLimit = - getRelativeAccuracy() * (FastMath.abs(olds) + FastMath.abs(s)) * 0.5; - if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy())) { - return s; - } - } - olds = s; - oldt = t; - } - - } - -} http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/integration/TrapezoidIntegrator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/integration/TrapezoidIntegrator.java b/src/main/java/org/apache/commons/math3/analysis/integration/TrapezoidIntegrator.java deleted file mode 100644 index d22d12d..0000000 --- a/src/main/java/org/apache/commons/math3/analysis/integration/TrapezoidIntegrator.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math3.analysis.integration; - -import org.apache.commons.math3.exception.MathIllegalArgumentException; -import org.apache.commons.math3.exception.MaxCountExceededException; -import org.apache.commons.math3.exception.NotStrictlyPositiveException; -import org.apache.commons.math3.exception.NumberIsTooLargeException; -import org.apache.commons.math3.exception.NumberIsTooSmallException; -import org.apache.commons.math3.exception.TooManyEvaluationsException; -import org.apache.commons.math3.util.FastMath; - -/** - * Implements the - * Trapezoid Rule for integration of real univariate functions. For - * reference, see Introduction to Numerical Analysis, ISBN 038795452X, - * chapter 3. - *- * The function should be integrable.
- * - * @since 1.2 - */ -public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator { - - /** Maximum number of iterations for trapezoid. */ - public static final int TRAPEZOID_MAX_ITERATIONS_COUNT = 64; - - /** Intermediate result. */ - private double s; - - /** - * Build a trapezoid integrator with given accuracies and iterations counts. - * @param relativeAccuracy relative accuracy of the result - * @param absoluteAccuracy absolute accuracy of the result - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * (must be less than or equal to {@link #TRAPEZOID_MAX_ITERATIONS_COUNT} - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - * @exception NumberIsTooLargeException if maximal number of iterations - * is greater than {@link #TRAPEZOID_MAX_ITERATIONS_COUNT} - */ - public TrapezoidIntegrator(final double relativeAccuracy, - final double absoluteAccuracy, - final int minimalIterationCount, - final int maximalIterationCount) - throws NotStrictlyPositiveException, NumberIsTooSmallException, NumberIsTooLargeException { - super(relativeAccuracy, absoluteAccuracy, minimalIterationCount, maximalIterationCount); - if (maximalIterationCount > TRAPEZOID_MAX_ITERATIONS_COUNT) { - throw new NumberIsTooLargeException(maximalIterationCount, - TRAPEZOID_MAX_ITERATIONS_COUNT, false); - } - } - - /** - * Build a trapezoid integrator with given iteration counts. - * @param minimalIterationCount minimum number of iterations - * @param maximalIterationCount maximum number of iterations - * (must be less than or equal to {@link #TRAPEZOID_MAX_ITERATIONS_COUNT} - * @exception NotStrictlyPositiveException if minimal number of iterations - * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations - * is lesser than or equal to the minimal number of iterations - * @exception NumberIsTooLargeException if maximal number of iterations - * is greater than {@link #TRAPEZOID_MAX_ITERATIONS_COUNT} - */ - public TrapezoidIntegrator(final int minimalIterationCount, - final int maximalIterationCount) - throws NotStrictlyPositiveException, NumberIsTooSmallException, NumberIsTooLargeException { - super(minimalIterationCount, maximalIterationCount); - if (maximalIterationCount > TRAPEZOID_MAX_ITERATIONS_COUNT) { - throw new NumberIsTooLargeException(maximalIterationCount, - TRAPEZOID_MAX_ITERATIONS_COUNT, false); - } - } - - /** - * Construct a trapezoid integrator with default settings. - * (max iteration count set to {@link #TRAPEZOID_MAX_ITERATIONS_COUNT}) - */ - public TrapezoidIntegrator() { - super(DEFAULT_MIN_ITERATIONS_COUNT, TRAPEZOID_MAX_ITERATIONS_COUNT); - } - - /** - * Compute the n-th stage integral of trapezoid rule. This function - * should only be called by APIintegrate()
in the package.
- * To save time it does not verify arguments - caller does.
- * - * The interval is divided equally into 2^n sections rather than an - * arbitrary m sections because this configuration can best utilize the - * already computed values.
- * - * @param baseIntegrator integrator holding integration parameters - * @param n the stage of 1/2 refinement, n = 0 is no refinement - * @return the value of n-th stage integral - * @throws TooManyEvaluationsException if the maximal number of evaluations - * is exceeded. - */ - double stage(final BaseAbstractUnivariateIntegrator baseIntegrator, final int n) - throws TooManyEvaluationsException { - - if (n == 0) { - final double max = baseIntegrator.getMax(); - final double min = baseIntegrator.getMin(); - s = 0.5 * (max - min) * - (baseIntegrator.computeObjectiveValue(min) + - baseIntegrator.computeObjectiveValue(max)); - return s; - } else { - final long np = 1L << (n-1); // number of new points in this stage - double sum = 0; - final double max = baseIntegrator.getMax(); - final double min = baseIntegrator.getMin(); - // spacing between adjacent new points - final double spacing = (max - min) / np; - double x = min + 0.5 * spacing; // the first new point - for (long i = 0; i < np; i++) { - sum += baseIntegrator.computeObjectiveValue(x); - x += spacing; - } - // add the new sum to previously calculated result - s = 0.5 * (s + sum * spacing); - return s; - } - } - - /** {@inheritDoc} */ - @Override - protected double doIntegrate() - throws MathIllegalArgumentException, TooManyEvaluationsException, MaxCountExceededException { - - double oldt = stage(this, 0); - iterations.incrementCount(); - while (true) { - final int i = iterations.getCount(); - final double t = stage(this, i); - if (i >= getMinimalIterationCount()) { - final double delta = FastMath.abs(t - oldt); - final double rLimit = - getRelativeAccuracy() * (FastMath.abs(oldt) + FastMath.abs(t)) * 0.5; - if ((delta <= rLimit) || (delta <= getAbsoluteAccuracy())) { - return t; - } - } - oldt = t; - iterations.incrementCount(); - } - - } - -} http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/integration/UnivariateIntegrator.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/integration/UnivariateIntegrator.java b/src/main/java/org/apache/commons/math3/analysis/integration/UnivariateIntegrator.java deleted file mode 100644 index f5673fb..0000000 --- a/src/main/java/org/apache/commons/math3/analysis/integration/UnivariateIntegrator.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math3.analysis.integration; - -import org.apache.commons.math3.analysis.UnivariateFunction; -import org.apache.commons.math3.exception.MathIllegalArgumentException; -import org.apache.commons.math3.exception.MaxCountExceededException; -import org.apache.commons.math3.exception.NullArgumentException; -import org.apache.commons.math3.exception.TooManyEvaluationsException; - -/** - * Interface for univariate real integration algorithms. - * - * @since 1.2 - */ -public interface UnivariateIntegrator { - - /** - * Get the actual relative accuracy. - * @return the accuracy - */ - double getRelativeAccuracy(); - - /** - * Get the actual absolute accuracy. - * - * @return the accuracy - */ - double getAbsoluteAccuracy(); - - /** - * Get the min limit for the number of iterations. - * - * @return the actual min limit - */ - int getMinimalIterationCount(); - - /** - * Get the upper limit for the number of iterations. - * - * @return the actual upper limit - */ - int getMaximalIterationCount(); - - /** - * Integrate the function in the given interval. - * - * @param maxEval Maximum number of evaluations. - * @param f the integrand function - * @param min the min bound for the interval - * @param max the upper bound for the interval - * @return the value of integral - * @throws TooManyEvaluationsException if the maximum number of function - * evaluations is exceeded. - * @throws MaxCountExceededException if the maximum iteration count is exceeded - * or the integrator detects convergence problems otherwise - * @throws MathIllegalArgumentException if min > max or the endpoints do not - * satisfy the requirements specified by the integrator - * @throws NullArgumentException if {@code f} is {@code null}. - */ - double integrate(int maxEval, UnivariateFunction f, double min, - double max) - throws TooManyEvaluationsException, MaxCountExceededException, - MathIllegalArgumentException, NullArgumentException; - - /** - * Get the number of function evaluations of the last run of the integrator. - * @return number of function evaluations - */ - int getEvaluations(); - - /** - * Get the number of iterations of the last run of the integrator. - * @return number of iterations - */ - int getIterations(); - -} http://git-wip-us.apache.org/repos/asf/commons-math/blob/a7b4803f/src/main/java/org/apache/commons/math3/analysis/integration/gauss/BaseRuleFactory.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/math3/analysis/integration/gauss/BaseRuleFactory.java b/src/main/java/org/apache/commons/math3/analysis/integration/gauss/BaseRuleFactory.java deleted file mode 100644 index 556fa0c..0000000 --- a/src/main/java/org/apache/commons/math3/analysis/integration/gauss/BaseRuleFactory.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.math3.analysis.integration.gauss; - -import java.util.Map; -import java.util.TreeMap; -import org.apache.commons.math3.util.Pair; -import org.apache.commons.math3.exception.DimensionMismatchException; -import org.apache.commons.math3.exception.NotStrictlyPositiveException; -import org.apache.commons.math3.exception.util.LocalizedFormats; - -/** - * Base class for rules that determines the integration nodes and their - * weights. - * Subclasses must implement the {@link #computeRule(int) computeRule} method. - * - * @param