Class SimpsonIntegrator
java.lang.Object
org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator
org.hipparchus.analysis.integration.SimpsonIntegrator
- All Implemented Interfaces:
UnivariateIntegrator
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.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Maximal number of iterations for Simpson.Fields inherited from class org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator
DEFAULT_ABSOLUTE_ACCURACY, DEFAULT_MAX_ITERATIONS_COUNT, DEFAULT_MIN_ITERATIONS_COUNT, DEFAULT_RELATIVE_ACCURACY, iterations
-
Constructor Summary
ConstructorDescriptionConstruct an integrator with default settings.SimpsonIntegrator
(double relativeAccuracy, double absoluteAccuracy, int minimalIterationCount, int maximalIterationCount) Build a Simpson integrator with given accuracies and iterations counts.SimpsonIntegrator
(int minimalIterationCount, int maximalIterationCount) Build a Simpson integrator with given iteration counts. -
Method Summary
Modifier and TypeMethodDescriptionprotected double
Method for implementing actual integration algorithms in derived classes.Methods inherited from class org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getIterations, getMax, getMaximalIterationCount, getMin, getMinimalIterationCount, getRelativeAccuracy, integrate, setup
-
Field Details
-
SIMPSON_MAX_ITERATIONS_COUNT
public static final int SIMPSON_MAX_ITERATIONS_COUNTMaximal number of iterations for Simpson.- See Also:
-
-
Constructor Details
-
SimpsonIntegrator
public SimpsonIntegrator(double relativeAccuracy, double absoluteAccuracy, int minimalIterationCount, int maximalIterationCount) throws MathIllegalArgumentException Build a Simpson integrator with given accuracies and iterations counts.- Parameters:
relativeAccuracy
- relative accuracy of the resultabsoluteAccuracy
- absolute accuracy of the resultminimalIterationCount
- minimum number of iterationsmaximalIterationCount
- maximum number of iterations (must be less than or equal toSIMPSON_MAX_ITERATIONS_COUNT
)- Throws:
MathIllegalArgumentException
- if minimal number of iterations is not strictly positiveMathIllegalArgumentException
- if maximal number of iterations is lesser than or equal to the minimal number of iterationsMathIllegalArgumentException
- if maximal number of iterations is greater thanSIMPSON_MAX_ITERATIONS_COUNT
-
SimpsonIntegrator
public SimpsonIntegrator(int minimalIterationCount, int maximalIterationCount) throws MathIllegalArgumentException Build a Simpson integrator with given iteration counts.- Parameters:
minimalIterationCount
- minimum number of iterationsmaximalIterationCount
- maximum number of iterations (must be less than or equal toSIMPSON_MAX_ITERATIONS_COUNT
)- Throws:
MathIllegalArgumentException
- if minimal number of iterations is not strictly positiveMathIllegalArgumentException
- if maximal number of iterations is lesser than or equal to the minimal number of iterationsMathIllegalArgumentException
- if maximal number of iterations is greater thanSIMPSON_MAX_ITERATIONS_COUNT
-
SimpsonIntegrator
public SimpsonIntegrator()Construct an integrator with default settings. (max iteration count set toSIMPSON_MAX_ITERATIONS_COUNT
)
-
-
Method Details
-
doIntegrate
Method for implementing actual integration algorithms in derived classes.- Specified by:
doIntegrate
in classBaseAbstractUnivariateIntegrator
- Returns:
- the root.
- Throws:
MathIllegalStateException
- if the maximal number of evaluations is exceeded.
-