|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.analysis.UnivariateRealSolverImpl
Provide a default implementation for several functions useful to generic solvers.
Field Summary | |
protected double |
absoluteAccuracy
Maximum absolute error. |
protected double |
defaultAbsoluteAccuracy
Default maximum absolute error. |
protected double |
defaultFunctionValueAccuracy
Default maximum error of function. |
protected int |
defaultMaximalIterationCount
Default maximum number of iterations. |
protected double |
defaultRelativeAccuracy
Default maximum relative error. |
protected UnivariateRealFunction |
f
The function to solve. |
protected double |
functionValueAccuracy
Maximum error of function. |
protected int |
iterationCount
The last iteration count. |
protected int |
maximalIterationCount
Maximum number of iterations. |
protected double |
relativeAccuracy
Maximum relative error. |
protected double |
result
The last computed root. |
protected boolean |
resultComputed
Indicates where a root has been computed. |
Constructor Summary | |
protected |
UnivariateRealSolverImpl(UnivariateRealFunction f,
int defaultMaximalIterationCount,
double defaultAbsoluteAccuracy)
Construct a solver with given iteration count and accuracy. |
Method Summary | |
protected void |
clearResult()
Convenience function for implementations. |
double |
getAbsoluteAccuracy()
Get the actual absolute accuracy. |
double |
getFunctionValueAccuracy()
Get the actual function value accuracy. |
int |
getIterationCount()
Access the last iteration count. |
int |
getMaximalIterationCount()
Get the upper limit for the number of iterations. |
double |
getRelativeAccuracy()
Get the actual relative accuracy. |
double |
getResult()
Access the last computed root. |
void |
resetAbsoluteAccuracy()
Reset the absolute accuracy to the default. |
void |
resetFunctionValueAccuracy()
Reset the actual function accuracy to the default. |
void |
resetMaximalIterationCount()
Reset the upper limit for the number of iterations to the default. |
void |
resetRelativeAccuracy()
Reset the relative accuracy to the default. |
void |
setAbsoluteAccuracy(double accuracy)
Set the absolute accuracy. |
void |
setFunctionValueAccuracy(double accuracy)
Set the function value accuracy. |
void |
setMaximalIterationCount(int count)
Set the upper 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. |
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.UnivariateRealSolver |
solve, solve |
Field Detail |
protected double absoluteAccuracy
protected double relativeAccuracy
protected double functionValueAccuracy
protected int maximalIterationCount
protected double defaultAbsoluteAccuracy
protected double defaultRelativeAccuracy
protected double defaultFunctionValueAccuracy
protected int defaultMaximalIterationCount
protected boolean resultComputed
protected double result
protected int iterationCount
protected UnivariateRealFunction f
Constructor Detail |
protected UnivariateRealSolverImpl(UnivariateRealFunction f, int defaultMaximalIterationCount, double defaultAbsoluteAccuracy)
f
- the function to solve.defaultAbsoluteAccuracy
- maximum absolue error.defaultMaximalIterationCount
- maximum number of iterations.Method Detail |
public double getResult() throws MathException
getResult
in interface UnivariateRealSolver
MathException
- if no root has been computed.public int getIterationCount() throws MathException
getIterationCount
in interface UnivariateRealSolver
MathException
- if no root 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 setAbsoluteAccuracy(double accuracy) throws MathException
setAbsoluteAccuracy
in interface UnivariateRealSolver
accuracy
- the accuracy.
MathException
- if the accuracy can't be achieved by the solver or
is otherwise deemed unreasonable.public double getAbsoluteAccuracy()
getAbsoluteAccuracy
in interface UnivariateRealSolver
public void resetAbsoluteAccuracy()
resetAbsoluteAccuracy
in interface UnivariateRealSolver
public void setMaximalIterationCount(int count)
setMaximalIterationCount
in interface UnivariateRealSolver
count
- maximum number of iterationspublic int getMaximalIterationCount()
getMaximalIterationCount
in interface UnivariateRealSolver
public void resetMaximalIterationCount()
resetMaximalIterationCount
in interface UnivariateRealSolver
UnivariateRealSolver.setMaximalIterationCount(int)
public void setRelativeAccuracy(double accuracy) throws MathException
setRelativeAccuracy
in interface UnivariateRealSolver
accuracy
- the relative accuracy.
MathException
- if the accuracy can't be achieved by the solver or
is otherwise deemed unreasonable.public double getRelativeAccuracy()
getRelativeAccuracy
in interface UnivariateRealSolver
public void resetRelativeAccuracy()
resetRelativeAccuracy
in interface UnivariateRealSolver
public void setFunctionValueAccuracy(double accuracy) throws MathException
setFunctionValueAccuracy
in interface UnivariateRealSolver
accuracy
- the accuracy.
MathException
- if the accuracy can't be achieved by the solver or
is otherwise deemed unreasonable.public double getFunctionValueAccuracy()
getFunctionValueAccuracy
in interface UnivariateRealSolver
public void resetFunctionValueAccuracy()
resetFunctionValueAccuracy
in interface UnivariateRealSolver
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |