Author: erans Date: Mon Jan 24 09:48:39 2011 New Revision: 1062707 URL: http://svn.apache.org/viewvc?rev=1062707&view=rev Log: MATH-500 Temporarily moved "ConvergingAlgorithm" and "ConvergingAlgorithmImpl" to package "analysis.integration". See MATH-501. Added: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithm.java - copied, changed from r1062690, commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithm.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithmImpl.java - copied, changed from r1062690, commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithmImpl.java Removed: commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithm.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithmImpl.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithm.java (from r1062690, commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithm.java) URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithm.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithm.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithm.java&r1=1062690&r2=1062707&rev=1062707&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithm.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithm.java Mon Jan 24 09:48:39 2011 @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.commons.math; +package org.apache.commons.math.analysis.integration; /** Copied: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithmImpl.java (from r1062690, commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithmImpl.java) URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithmImpl.java?p2=commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithmImpl.java&p1=commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithmImpl.java&r1=1062690&r2=1062707&rev=1062707&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/ConvergingAlgorithmImpl.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/ConvergingAlgorithmImpl.java Mon Jan 24 09:48:39 2011 @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.commons.math; +package org.apache.commons.math.analysis.integration; import org.apache.commons.math.exception.MaxCountExceededException; @@ -29,60 +29,21 @@ import org.apache.commons.math.exception */ @Deprecated public abstract class ConvergingAlgorithmImpl implements ConvergingAlgorithm { - /** Maximum absolute error. */ protected double absoluteAccuracy; - /** Maximum relative error. */ protected double relativeAccuracy; - /** Maximum number of iterations. */ protected int maximalIterationCount; - /** Default maximum absolute error. */ protected double defaultAbsoluteAccuracy; - /** Default maximum relative error. */ protected double defaultRelativeAccuracy; - /** Default maximum number of iterations. */ protected int defaultMaximalIterationCount; - /** The last iteration count. */ protected int iterationCount; - /** - * Construct an algorithm with given iteration count and accuracy. - * - * @param defaultAbsoluteAccuracy maximum absolute error - * @param defaultMaximalIterationCount maximum number of iterations - * @throws IllegalArgumentException if f is null or the - * defaultAbsoluteAccuracy is not valid - * @deprecated in 2.2. Derived classes should use the "setter" methods - * in order to assign meaningful values to all the instances variables. - */ - @Deprecated - protected ConvergingAlgorithmImpl(final int defaultMaximalIterationCount, - final double defaultAbsoluteAccuracy) { - this.defaultAbsoluteAccuracy = defaultAbsoluteAccuracy; - this.defaultRelativeAccuracy = 1.0e-14; - this.absoluteAccuracy = defaultAbsoluteAccuracy; - this.relativeAccuracy = defaultRelativeAccuracy; - this.defaultMaximalIterationCount = defaultMaximalIterationCount; - this.maximalIterationCount = defaultMaximalIterationCount; - this.iterationCount = 0; - } - - /** - * Default constructor. - * - * @since 2.2 - * @deprecated in 2.2 (to be removed as soon as the single non-default one - * has been removed). - */ - @Deprecated - protected ConvergingAlgorithmImpl() {} - /** {@inheritDoc} */ public int getIterationCount() { return iterationCount; Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java?rev=1062707&r1=1062706&r2=1062707&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegrator.java Mon Jan 24 09:48:39 2011 @@ -17,7 +17,6 @@ package org.apache.commons.math.analysis.integration; import org.apache.commons.math.ConvergenceException; -import org.apache.commons.math.ConvergingAlgorithm; import org.apache.commons.math.exception.MathUserException; import org.apache.commons.math.analysis.UnivariateRealFunction; @@ -62,25 +61,6 @@ public interface UnivariateRealIntegrato /** * Integrate the function in the given interval. * - * @param min the lower bound for the interval - * @param max the upper bound for the interval - * @return the value of integral - * @throws ConvergenceException if the maximum iteration count is exceeded - * or the integrator detects convergence problems otherwise - * @throws MathUserException if an error occurs evaluating the - * function - * @throws IllegalArgumentException if min > max or the endpoints do not - * satisfy the requirements specified by the integrator - * @deprecated replaced by {@link #integrate(UnivariateRealFunction, double, double)} - * since 2.0 - */ - @Deprecated - double integrate(double min, double max) - throws ConvergenceException, MathUserException, IllegalArgumentException; - - /** - * Integrate the function in the given interval. - * * @param f the integrand function * @param min the lower bound for the interval * @param max the upper bound for the interval @@ -102,5 +82,4 @@ public interface UnivariateRealIntegrato * because no result was yet computed or the last attempt failed */ double getResult() throws IllegalStateException; - } Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java?rev=1062707&r1=1062706&r2=1062707&view=diff ============================================================================== --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java Mon Jan 24 09:48:39 2011 @@ -16,7 +16,6 @@ */ package org.apache.commons.math.analysis.integration; -import org.apache.commons.math.ConvergingAlgorithmImpl; import org.apache.commons.math.MathRuntimeException; import org.apache.commons.math.analysis.UnivariateRealFunction; import org.apache.commons.math.exception.util.LocalizedFormats; @@ -30,43 +29,40 @@ import org.apache.commons.math.exception */ public abstract class UnivariateRealIntegratorImpl extends ConvergingAlgorithmImpl implements UnivariateRealIntegrator { - /** Serializable version identifier. */ private static final long serialVersionUID = 6248808456637441533L; - /** minimum number of iterations */ protected int minimalIterationCount; - /** default minimum number of iterations */ protected int defaultMinimalIterationCount; - /** indicates whether an integral has been computed */ protected boolean resultComputed = false; - /** the last computed integral */ protected double result; - /** The integrand functione. * @deprecated as of 2.0 the integrand function is passed as an argument * to the {@link #integrate(UnivariateRealFunction, double, double)}method. */ @Deprecated protected UnivariateRealFunction f; - /** - * Construct an integrator with given iteration count and accuracy. - * - * @param f the integrand function - * @param defaultMaximalIterationCount maximum number of iterations - * @throws IllegalArgumentException if f is null or the iteration - * limits are not valid - * @deprecated as of 2.0 the integrand function is passed as an argument - * to the {@link #integrate(UnivariateRealFunction, double, double)}method. - */ + /** + * Construct an integrator with given iteration count and accuracy. + * + * @param f the integrand function + * @param defaultMaximalIterationCount maximum number of iterations + * @throws IllegalArgumentException if f is null or the iteration + * limits are not valid + * @deprecated as of 2.0 the integrand function is passed as an argument + * to the {@link #integrate(UnivariateRealFunction, double, double)}method. + */ @Deprecated protected UnivariateRealIntegratorImpl(final UnivariateRealFunction f, final int defaultMaximalIterationCount) throws IllegalArgumentException { - super(defaultMaximalIterationCount, 1.0e-15); + + setMaximalIterationCount(defaultMaximalIterationCount); + setAbsoluteAccuracy(1.0e-15); + if (f == null) { throw new NullArgumentException(LocalizedFormats.FUNCTION); } @@ -90,8 +86,9 @@ public abstract class UnivariateRealInte */ protected UnivariateRealIntegratorImpl(final int defaultMaximalIterationCount) throws IllegalArgumentException { - super(defaultMaximalIterationCount, 1.0e-15); + setMaximalIterationCount(defaultMaximalIterationCount); + setAbsoluteAccuracy(1.0e-15); // parameters that are problem specific setRelativeAccuracy(1.0e-6); this.defaultMinimalIterationCount = 3;