|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.analysis.UnivariateRealIntegratorImpl
public abstract class UnivariateRealIntegratorImpl
Provide a default implementation for several generic functions.
| Field Summary | |
|---|---|
protected int |
defaultMaximalIterationCount
default maximum number of iterations |
protected int |
defaultMinimalIterationCount
default minimum number of iterations |
protected double |
defaultRelativeAccuracy
default maximum relative error |
protected UnivariateRealFunction |
f
the integrand function |
protected int |
iterationCount
the last iteration count |
protected int |
maximalIterationCount
maximum number of iterations |
protected int |
minimalIterationCount
minimum number of iterations |
protected double |
relativeAccuracy
maximum relative error |
protected double |
result
the last computed integral |
protected boolean |
resultComputed
indicates whether an integral has been computed |
(package private) static long |
serialVersionUID
serializable version identifier |
| Constructor Summary | |
|---|---|
protected |
UnivariateRealIntegratorImpl(UnivariateRealFunction f,
int defaultMaximalIterationCount)
Construct an integrator with given iteration count and accuracy. |
| Method Summary | |
|---|---|
protected void |
clearResult()
Convenience function for implementations. |
int |
getIterationCount()
Access the last iteration count. |
int |
getMaximalIterationCount()
Get the upper limit for the number of iterations. |
int |
getMinimalIterationCount()
Get the lower limit for the number of iterations. |
double |
getRelativeAccuracy()
Get the actual relative accuracy. |
double |
getResult()
Access the last computed integral. |
protected boolean |
isSequence(double start,
double mid,
double end)
Returns true if the arguments form a (strictly) increasing sequence |
void |
resetMaximalIterationCount()
Reset the upper limit for the number of iterations to the default. |
void |
resetMinimalIterationCount()
Reset the lower limit for the number of iterations to the default. |
void |
resetRelativeAccuracy()
Reset the relative accuracy to the default. |
void |
setMaximalIterationCount(int count)
Set the upper limit for the number of iterations. |
void |
setMinimalIterationCount(int count)
Set the lower limit for the number of iterations. |
void |
setRelativeAccuracy(double accuracy)
Set the relative accuracy. |
protected void |
setResult(double result,
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.commons.math.analysis.UnivariateRealIntegrator |
|---|
integrate |
| Field Detail |
|---|
static final long serialVersionUID
protected double relativeAccuracy
protected int maximalIterationCount
protected int minimalIterationCount
protected double defaultRelativeAccuracy
protected int defaultMaximalIterationCount
protected int defaultMinimalIterationCount
protected boolean resultComputed
protected double result
protected int iterationCount
protected UnivariateRealFunction f
| Constructor Detail |
|---|
protected UnivariateRealIntegratorImpl(UnivariateRealFunction f,
int defaultMaximalIterationCount)
throws java.lang.IllegalArgumentException
f - the integrand functiondefaultMaximalIterationCount - maximum number of iterations
java.lang.IllegalArgumentException - if f is null or the iteration
limits are not valid| Method Detail |
|---|
public double getResult()
throws java.lang.IllegalStateException
getResult in interface UnivariateRealIntegratorjava.lang.IllegalStateException - if no integral has been computed
public int getIterationCount()
throws java.lang.IllegalStateException
getIterationCount in interface UnivariateRealIntegratorjava.lang.IllegalStateException - if no integral has been computed
protected final void setResult(double result,
int iterationCount)
result - the result to setiterationCount - the iteration count to setprotected final void clearResult()
public void setMaximalIterationCount(int count)
setMaximalIterationCount in interface UnivariateRealIntegratorcount - maximum number of iterationspublic int getMaximalIterationCount()
getMaximalIterationCount in interface UnivariateRealIntegratorpublic void resetMaximalIterationCount()
resetMaximalIterationCount in interface UnivariateRealIntegratorUnivariateRealIntegrator.setMaximalIterationCount(int)public void setMinimalIterationCount(int count)
setMinimalIterationCount in interface UnivariateRealIntegratorcount - minimum number of iterationspublic int getMinimalIterationCount()
getMinimalIterationCount in interface UnivariateRealIntegratorpublic void resetMinimalIterationCount()
resetMinimalIterationCount in interface UnivariateRealIntegratorUnivariateRealIntegrator.setMinimalIterationCount(int)public void setRelativeAccuracy(double accuracy)
setRelativeAccuracy in interface UnivariateRealIntegratoraccuracy - the relative accuracy
java.lang.IllegalArgumentException - if the accuracy can't be achieved by
the integrator or is otherwise deemed unreasonablepublic double getRelativeAccuracy()
getRelativeAccuracy in interface UnivariateRealIntegratorpublic void resetRelativeAccuracy()
resetRelativeAccuracy in interface UnivariateRealIntegratorUnivariateRealIntegrator.setRelativeAccuracy(double)
protected boolean isSequence(double start,
double mid,
double end)
start - first numbermid - second numberend - third number
protected void verifyInterval(double lower,
double upper)
throws java.lang.IllegalArgumentException
lower - lower endpointupper - upper endpoint
java.lang.IllegalArgumentException - if not interval
protected void verifyIterationCount()
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - if not valid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||