You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2021/06/25 12:51:43 UTC
[commons-math] 01/03: Javadoc.
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git
commit cd54910edcb60f4d67fe3af3e26a5f184699dd16
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Fri Jun 25 12:12:52 2021 +0200
Javadoc.
---
.../analysis/integration/SimpsonIntegrator.java | 29 ++++++++++++++--------
.../analysis/integration/TrapezoidIntegrator.java | 17 ++++++++++---
2 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegrator.java
index 26630aa..a770a43 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/SimpsonIntegrator.java
@@ -21,12 +21,21 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
/**
* Implements <a href="http://mathworld.wolfram.com/SimpsonsRule.html">
- * Simpson's Rule</a> for integration of real univariate functions. For
- * reference, see <b>Introduction to Numerical Analysis</b>, ISBN 038795452X,
- * chapter 3.
+ * Simpson's Rule</a> for integration of real univariate functions.
+ *
+ * See <b>Introduction to Numerical Analysis</b>, ISBN 038795452X, chapter 3.
+ *
* <p>
* This implementation employs the basic trapezoid rule to calculate Simpson's
- * rule.</p>
+ * rule.
+ *
+ * <p>
+ * <em>Caveat:</em> At each iteration, the algorithm refines the estimation by
+ * evaluating the function twice as many times as in the previous iteration;
+ * When specifying a {@link #integrate(int,UnivariateFunction,double,double)
+ * maximum number of function evaluations}, the caller must ensure that it
+ * is compatible with the {@link #SimpsonIntegrator(int,int) requested minimal
+ * number of iterations}.
*
* @since 1.2
*/
@@ -39,9 +48,9 @@ public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator {
* 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})
+ * @param minimalIterationCount Minimum number of iterations.
+ * @param maximalIterationCount Maximum number of iterations.
+ * It must be less than or equal to {@link #SIMPSON_MAX_ITERATIONS_COUNT}.
* @exception org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException if minimal number of iterations
* is not strictly positive
* @exception org.apache.commons.math4.legacy.exception.NumberIsTooSmallException if maximal number of iterations
@@ -62,9 +71,9 @@ public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator {
/**
* 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})
+ * @param minimalIterationCount Minimum number of iterations.
+ * @param maximalIterationCount Maximum number of iterations.
+ * It must be less than or equal to {@link #SIMPSON_MAX_ITERATIONS_COUNT}.
* @exception org.apache.commons.math4.legacy.exception.NotStrictlyPositiveException if minimal number of iterations
* is not strictly positive
* @exception org.apache.commons.math4.legacy.exception.NumberIsTooSmallException if maximal number of iterations
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/TrapezoidIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/TrapezoidIntegrator.java
index ed1176f..8a1f5da 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/TrapezoidIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/TrapezoidIntegrator.java
@@ -21,11 +21,20 @@ import org.apache.commons.math4.legacy.core.jdkmath.AccurateMath;
/**
* Implements the <a href="http://mathworld.wolfram.com/TrapezoidalRule.html">
- * Trapezoid Rule</a> for integration of real univariate functions. For
- * reference, see <b>Introduction to Numerical Analysis</b>, ISBN 038795452X,
- * chapter 3.
+ * Trapezoid Rule</a> for integration of real univariate functions.
+ *
+ * See <b>Introduction to Numerical Analysis</b>, ISBN 038795452X, chapter 3.
+ *
+ * <p>
+ * The function should be integrable.
+ *
* <p>
- * The function should be integrable.</p>
+ * <em>Caveat:</em> At each iteration, the algorithm refines the estimation by
+ * evaluating the function twice as many times as in the previous iteration;
+ * When specifying a {@link #integrate(int,UnivariateFunction,double,double)
+ * maximum number of function evaluations}, the caller must ensure that it
+ * is compatible with the {@link #TrapezoidIntegrator(int,int) requested
+ * minimal number of iterations}.
*
* @since 1.2
*/