|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.ConvergingAlgorithmImpl
org.apache.commons.math.analysis.integration.UnivariateRealIntegratorImpl
public abstract class UnivariateRealIntegratorImpl
Provide a default implementation for several generic functions.
Field Summary | |
---|---|
protected int |
defaultMinimalIterationCount
default minimum number of iterations |
protected UnivariateRealFunction |
f
Deprecated. as of 2.0 the integrand function is passed as an argument to the UnivariateRealIntegrator.integrate(UnivariateRealFunction, double, double) method. |
protected int |
minimalIterationCount
minimum number of iterations |
protected double |
result
the last computed integral |
protected boolean |
resultComputed
indicates whether an integral has been computed |
Fields inherited from class org.apache.commons.math.ConvergingAlgorithmImpl |
---|
absoluteAccuracy, defaultAbsoluteAccuracy, defaultMaximalIterationCount, defaultRelativeAccuracy, iterationCount, maximalIterationCount, relativeAccuracy |
Constructor Summary | |
---|---|
protected |
UnivariateRealIntegratorImpl(int defaultMaximalIterationCount)
Construct an integrator with given iteration count and accuracy. |
protected |
UnivariateRealIntegratorImpl(UnivariateRealFunction f,
int defaultMaximalIterationCount)
Deprecated. as of 2.0 the integrand function is passed as an argument to the UnivariateRealIntegrator.integrate(UnivariateRealFunction, double, double) method. |
Method Summary | |
---|---|
protected void |
clearResult()
Convenience function for implementations. |
int |
getMinimalIterationCount()
Get the lower limit for the number of iterations. |
double |
getResult()
Access the last computed integral. |
void |
resetMinimalIterationCount()
Reset the lower limit for the number of iterations to the default. |
void |
setMinimalIterationCount(int count)
Set the lower limit for the number of iterations. |
protected void |
setResult(double newResult,
int iterationCount)
Convenience function for implementations. |
protected void |
verifyInterval(double lower,
double upper)
Verifies that the endpoints specify an interval. |
protected void |
verifyIterationCount()
Verifies that the upper and lower limits of iterations are valid. |
Methods inherited from class org.apache.commons.math.ConvergingAlgorithmImpl |
---|
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, incrementIterationsCounter, resetAbsoluteAccuracy, resetIterationsCounter, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.math.analysis.integration.UnivariateRealIntegrator |
---|
integrate, integrate |
Methods inherited from interface org.apache.commons.math.ConvergingAlgorithm |
---|
getAbsoluteAccuracy, getIterationCount, getMaximalIterationCount, getRelativeAccuracy, resetAbsoluteAccuracy, resetMaximalIterationCount, resetRelativeAccuracy, setAbsoluteAccuracy, setMaximalIterationCount, setRelativeAccuracy |
Field Detail |
---|
protected int minimalIterationCount
protected int defaultMinimalIterationCount
protected boolean resultComputed
protected double result
@Deprecated protected UnivariateRealFunction f
UnivariateRealIntegrator.integrate(UnivariateRealFunction, double, double)
method.
Constructor Detail |
---|
@Deprecated protected UnivariateRealIntegratorImpl(UnivariateRealFunction f, int defaultMaximalIterationCount) throws IllegalArgumentException
UnivariateRealIntegrator.integrate(UnivariateRealFunction, double, double)
method.
f
- the integrand functiondefaultMaximalIterationCount
- maximum number of iterations
IllegalArgumentException
- if f is null or the iteration
limits are not validprotected UnivariateRealIntegratorImpl(int defaultMaximalIterationCount) throws IllegalArgumentException
defaultMaximalIterationCount
- maximum number of iterations
IllegalArgumentException
- if f is null or the iteration
limits are not validMethod Detail |
---|
public double getResult() throws IllegalStateException
getResult
in interface UnivariateRealIntegrator
IllegalStateException
- if no integral has been computedprotected final void setResult(double newResult, int iterationCount)
newResult
- the result to setiterationCount
- the iteration count to setprotected final void clearResult()
public void setMinimalIterationCount(int count)
Minimal iteration is needed to avoid false early convergence, e.g. the sample points happen to be zeroes of the function. Users can use the default value or choose one that they see as appropriate.
A ConvergenceException
will be thrown if this number
is not met.
setMinimalIterationCount
in interface UnivariateRealIntegrator
count
- minimum number of iterationspublic int getMinimalIterationCount()
getMinimalIterationCount
in interface UnivariateRealIntegrator
public void resetMinimalIterationCount()
The default value is supplied by the implementation.
resetMinimalIterationCount
in interface UnivariateRealIntegrator
UnivariateRealIntegrator.setMinimalIterationCount(int)
protected void verifyInterval(double lower, double upper) throws IllegalArgumentException
lower
- lower endpointupper
- upper endpoint
IllegalArgumentException
- if not intervalprotected void verifyIterationCount() throws IllegalArgumentException
IllegalArgumentException
- if not valid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |