Class TrapezoidIntegrator
- java.lang.Object
-
- org.hipparchus.analysis.integration.BaseAbstractUnivariateIntegrator
-
- org.hipparchus.analysis.integration.TrapezoidIntegrator
-
- All Implemented Interfaces:
UnivariateIntegrator
public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator
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.
-
-
Field Summary
Fields Modifier and Type Field Description static int
TRAPEZOID_MAX_ITERATIONS_COUNT
Maximum number of iterations for trapezoid.-
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
Constructors Constructor Description TrapezoidIntegrator()
Construct a trapezoid integrator with default settings.TrapezoidIntegrator(double relativeAccuracy, double absoluteAccuracy, int minimalIterationCount, int maximalIterationCount)
Build a trapezoid integrator with given accuracies and iterations counts.TrapezoidIntegrator(int minimalIterationCount, int maximalIterationCount)
Build a trapezoid integrator with given iteration counts.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
doIntegrate()
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 Detail
-
TRAPEZOID_MAX_ITERATIONS_COUNT
public static final int TRAPEZOID_MAX_ITERATIONS_COUNT
Maximum number of iterations for trapezoid.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TrapezoidIntegrator
public TrapezoidIntegrator(double relativeAccuracy, double absoluteAccuracy, int minimalIterationCount, int maximalIterationCount) throws MathIllegalArgumentException
Build a trapezoid 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 toTRAPEZOID_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 thanTRAPEZOID_MAX_ITERATIONS_COUNT
-
TrapezoidIntegrator
public TrapezoidIntegrator(int minimalIterationCount, int maximalIterationCount) throws MathIllegalArgumentException
Build a trapezoid integrator with given iteration counts.- Parameters:
minimalIterationCount
- minimum number of iterationsmaximalIterationCount
- maximum number of iterations (must be less than or equal toTRAPEZOID_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 thanTRAPEZOID_MAX_ITERATIONS_COUNT
-
TrapezoidIntegrator
public TrapezoidIntegrator()
Construct a trapezoid integrator with default settings. (max iteration count set toTRAPEZOID_MAX_ITERATIONS_COUNT
)
-
-
Method Detail
-
doIntegrate
protected double doIntegrate() throws MathIllegalArgumentException, MathIllegalStateException
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.MathIllegalArgumentException
-
-