|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.analysis.integration.UnivariateRealIntegratorImpl
public abstract class UnivariateRealIntegratorImpl
Provide a default implementation for several generic functions.
| Field Summary | |
|---|---|
protected double |
absoluteAccuracy
Maximum absolute error. |
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 |
evaluations
The functions evaluation count. |
protected UnivariateRealFunction |
function
Function to integrate. |
protected Incrementor |
iterations
The iteration count. |
protected double |
max
Upper bound for the interval. |
protected double |
min
Lower bound for the interval. |
protected int |
minimalIterationCount
minimum number of iterations |
protected double |
relativeAccuracy
Maximum relative error. |
| Constructor Summary | |
|---|---|
protected |
UnivariateRealIntegratorImpl(double relativeAccuracy,
double absoluteAccuracy)
Construct an integrator with given accuracies. |
protected |
UnivariateRealIntegratorImpl(double relativeAccuracy,
double absoluteAccuracy,
int minimalIterationCount,
int maximalIterationCount)
Construct an integrator with given accuracies and iteration counts. |
protected |
UnivariateRealIntegratorImpl(int minimalIterationCount,
int maximalIterationCount)
Construct an integrator with given iteration counts. |
| Method Summary | |
|---|---|
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. |
int |
getMaximalIterationCount()
Get the upper limit for the number of iterations. |
int |
getMinimalIterationCount()
Get the min limit for the number of iterations. |
double |
getRelativeAccuracy()
Get the actual relative accuracy. |
double |
integrate(int maxEval,
UnivariateRealFunction f,
double lower,
double upper)
Integrate the function in the given interval. |
protected void |
setup(int maxEval,
UnivariateRealFunction f,
double lower,
double upper)
Prepare for computation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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 double absoluteAccuracy
protected double relativeAccuracy
protected int minimalIterationCount
protected Incrementor iterations
protected Incrementor evaluations
protected UnivariateRealFunction function
protected double min
protected double max
| Constructor Detail |
|---|
protected UnivariateRealIntegratorImpl(double relativeAccuracy,
double absoluteAccuracy,
int minimalIterationCount,
int maximalIterationCount)
throws NotStrictlyPositiveException,
NumberIsTooSmallException
The meanings of the various parameters are:
MathUtils.SAFE_MIN.
relativeAccuracy - relative accuracy of the resultabsoluteAccuracy - absolute accuracy of the resultminimalIterationCount - minimum number of iterationsmaximalIterationCount - maximum number of iterations
NotStrictlyPositiveException - if minimal number of iterations
is not strictly positive
NumberIsTooSmallException - if maximal number of iterations
is lesser than or equal to the minimal number of iterations
protected UnivariateRealIntegratorImpl(double relativeAccuracy,
double absoluteAccuracy)
relativeAccuracy - relative accuracy of the resultabsoluteAccuracy - absolute accuracy of the result
protected UnivariateRealIntegratorImpl(int minimalIterationCount,
int maximalIterationCount)
throws NotStrictlyPositiveException,
NumberIsTooSmallException
minimalIterationCount - minimum number of iterationsmaximalIterationCount - maximum number of iterations
NotStrictlyPositiveException - if minimal number of iterations
is not strictly positive
NumberIsTooSmallException - if maximal number of iterations
is lesser than or equal to the minimal number of iterations| Method Detail |
|---|
public double getRelativeAccuracy()
getRelativeAccuracy in interface UnivariateRealIntegratorpublic double getAbsoluteAccuracy()
getAbsoluteAccuracy in interface UnivariateRealIntegratorpublic int getMinimalIterationCount()
getMinimalIterationCount in interface UnivariateRealIntegratorpublic int getMaximalIterationCount()
getMaximalIterationCount in interface UnivariateRealIntegratorpublic int getEvaluations()
getEvaluations in interface UnivariateRealIntegratorpublic int getIterations()
getIterations in interface UnivariateRealIntegrator
protected double computeObjectiveValue(double point)
throws TooManyEvaluationsException
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,
UnivariateRealFunction f,
double lower,
double upper)
throws NullArgumentException,
MathIllegalArgumentException
solve methods.
maxEval - Maximum number of evaluations.f - the integrand functionlower - the min bound for the intervalupper - the upper bound for the interval
NullArgumentException - if f is null.
MathIllegalArgumentException - if min >= max.
public double integrate(int maxEval,
UnivariateRealFunction f,
double lower,
double upper)
throws TooManyEvaluationsException,
MaxCountExceededException,
MathIllegalArgumentException,
NullArgumentException
integrate in interface UnivariateRealIntegratormaxEval - Maximum number of evaluations.f - the integrand functionlower - the min bound for the intervalupper - the upper bound for the interval
TooManyEvaluationsException - if the maximum number of function
evaluations is exceeded.
MaxCountExceededException - if the maximum iteration count is exceeded
or the integrator detects convergence problems otherwise
MathIllegalArgumentException - if min > max or the endpoints do not
satisfy the requirements specified by the integrator
NullArgumentException - if f is null.
protected abstract double doIntegrate()
throws TooManyEvaluationsException,
MaxCountExceededException
TooManyEvaluationsException - if the maximal number of evaluations
is exceeded.
MaxCountExceededException - if the maximum iteration count is exceeded
or the integrator detects convergence problems otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||