public abstract class BaseAbstractUnivariateIntegrator extends Object implements UnivariateIntegrator
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_ABSOLUTE_ACCURACY
Default absolute accuracy.
|
static int |
DEFAULT_MAX_ITERATIONS_COUNT
Default maximal iteration count.
|
static int |
DEFAULT_MIN_ITERATIONS_COUNT
Default minimal iteration count.
|
static double |
DEFAULT_RELATIVE_ACCURACY
Default relative accuracy.
|
protected Incrementor |
iterations
The iteration count.
|
Modifier | Constructor and Description |
---|---|
protected |
BaseAbstractUnivariateIntegrator(double relativeAccuracyIn,
double absoluteAccuracyIn)
Construct an integrator with given accuracies.
|
protected |
BaseAbstractUnivariateIntegrator(double relativeAccuracyIn,
double absoluteAccuracyIn,
int minimalIterationCountIn,
int maximalIterationCount)
Construct an integrator with given accuracies and iteration counts.
|
protected |
BaseAbstractUnivariateIntegrator(int minimalIterationCountIn,
int maximalIterationCount)
Construct an integrator with given iteration counts.
|
Modifier and Type | Method and Description |
---|---|
protected double |
computeObjectiveValue(double point)
Compute the objective function value.
|
protected abstract double |
doIntegrate()
Method for implementing actual integration algorithms in derived
classes.
|
double |
getAbsoluteAccuracy()
Get the actual absolute accuracy.
|
int |
getEvaluations()
Get the number of function evaluations of the last run of the integrator.
|
int |
getIterations()
Get the number of iterations of the last run of the integrator.
|
protected double |
getMax() |
int |
getMaximalIterationCount()
Get the upper limit for the number of iterations.
|
protected double |
getMin() |
int |
getMinimalIterationCount()
Get the min limit for the number of iterations.
|
double |
getRelativeAccuracy()
Get the actual relative accuracy.
|
double |
integrate(int maxEval,
UnivariateFunction f,
double lower,
double upper)
Integrate the function in the given interval.
|
protected void |
setup(int maxEval,
UnivariateFunction f,
double lower,
double upper)
Prepare for computation.
|
public static final double DEFAULT_ABSOLUTE_ACCURACY
public static final double DEFAULT_RELATIVE_ACCURACY
public static final int DEFAULT_MIN_ITERATIONS_COUNT
public static final int DEFAULT_MAX_ITERATIONS_COUNT
protected final Incrementor iterations
protected BaseAbstractUnivariateIntegrator(double relativeAccuracyIn, double absoluteAccuracyIn, int minimalIterationCountIn, int maximalIterationCount)
The meanings of the various parameters are:
Precision.SAFE_MIN
.relativeAccuracyIn
- relative accuracy of the resultabsoluteAccuracyIn
- absolute accuracy of the resultminimalIterationCountIn
- minimum number of iterationsmaximalIterationCount
- maximum number of iterationsNotStrictlyPositiveException
- if minimal number of iterations
is not strictly positiveNumberIsTooSmallException
- if maximal number of iterations
is lesser than or equal to the minimal number of iterationsprotected BaseAbstractUnivariateIntegrator(double relativeAccuracyIn, double absoluteAccuracyIn)
relativeAccuracyIn
- relative accuracy of the resultabsoluteAccuracyIn
- absolute accuracy of the resultprotected BaseAbstractUnivariateIntegrator(int minimalIterationCountIn, int maximalIterationCount)
minimalIterationCountIn
- minimum number of iterationsmaximalIterationCount
- maximum number of iterationsNotStrictlyPositiveException
- if minimal number of iterations
is not strictly positiveNumberIsTooSmallException
- if maximal number of iterations
is lesser than or equal to the minimal number of iterationspublic double getRelativeAccuracy()
getRelativeAccuracy
in interface UnivariateIntegrator
public double getAbsoluteAccuracy()
getAbsoluteAccuracy
in interface UnivariateIntegrator
public int getMinimalIterationCount()
getMinimalIterationCount
in interface UnivariateIntegrator
public int getMaximalIterationCount()
getMaximalIterationCount
in interface UnivariateIntegrator
public int getEvaluations()
getEvaluations
in interface UnivariateIntegrator
public int getIterations()
getIterations
in interface UnivariateIntegrator
protected double getMin()
protected double getMax()
protected double computeObjectiveValue(double point)
point
- Point at which the objective function must be evaluated.TooManyEvaluationsException
- if the maximal number of function
evaluations is exceeded.protected void setup(int maxEval, UnivariateFunction f, double lower, double upper)
solve
methods.maxEval
- Maximum number of evaluations.f
- the integrand functionlower
- the min bound for the intervalupper
- the upper bound for the intervalNullArgumentException
- if f
is null
.MathIllegalArgumentException
- if min >= max
.public double integrate(int maxEval, UnivariateFunction f, double lower, double upper)
integrate
in interface UnivariateIntegrator
maxEval
- Maximum number of evaluations.f
- the integrand functionlower
- the min bound for the intervalupper
- the upper bound for the intervalprotected abstract double doIntegrate()
TooManyEvaluationsException
- if the maximal number of evaluations
is exceeded.MaxCountExceededException
- if the maximum iteration count is exceeded
or the integrator detects convergence problems otherwiseCopyright © 2019 CNES. All rights reserved.