| java.lang.Object org.apache.commons.math.analysis.UnivariateRealSolverImpl
All known Subclasses: org.apache.commons.math.analysis.SecantSolver, org.apache.commons.math.analysis.BisectionSolver, org.apache.commons.math.analysis.NewtonSolver, org.apache.commons.math.analysis.BrentSolver,
UnivariateRealSolverImpl | abstract public class UnivariateRealSolverImpl implements UnivariateRealSolver,Serializable(Code) | | Provide a default implementation for several functions useful to generic
solvers.
version: $Revision: 348888 $ $Date: 2005-11-24 23:21:25 -0700 (Thu, 24 Nov 2005) $ |
Method Summary | |
final protected void | clearResult() Convenience function for implementations. | public double | getAbsoluteAccuracy() Get the actual absolute accuracy. | public double | getFunctionValueAccuracy() Get the actual function value accuracy. | public int | getIterationCount() Access the last iteration count. | public int | getMaximalIterationCount() Get the upper limit for the number of iterations. | public double | getRelativeAccuracy() Get the actual relative accuracy. | public double | getResult() Access the last computed root. | protected boolean | isBracketing(double lower, double upper, UnivariateRealFunction f) Returns true iff the function takes opposite signs at the endpoints. | protected boolean | isSequence(double start, double mid, double end) | public void | resetAbsoluteAccuracy() Reset the absolute accuracy to the default. | public void | resetFunctionValueAccuracy() Reset the actual function accuracy to the default. | public void | resetMaximalIterationCount() Reset the upper limit for the number of iterations to the default. | public void | resetRelativeAccuracy() Reset the relative accuracy to the default. | public void | setAbsoluteAccuracy(double accuracy) Set the absolute accuracy.
Parameters: accuracy - the accuracy. throws: IllegalArgumentException - if the accuracy can't be achieved bythe solver or is otherwise deemed unreasonable. | public void | setFunctionValueAccuracy(double accuracy) Set the function value accuracy.
Parameters: accuracy - the accuracy. throws: IllegalArgumentException - if the accuracy can't be achieved bythe solver or is otherwise deemed unreasonable. | public void | setMaximalIterationCount(int count) Set the upper limit for the number of iterations. | public void | setRelativeAccuracy(double accuracy) Set the relative accuracy.
Parameters: accuracy - the relative accuracy. throws: IllegalArgumentException - if the accuracy can't be achieved bythe solver or is otherwise deemed unreasonable. | final protected void | setResult(double result, int iterationCount) Convenience function for implementations. | protected void | verifyBracketing(double lower, double upper, UnivariateRealFunction f) | protected void | verifyInterval(double lower, double upper) | protected void | verifySequence(double lower, double initial, double upper) |
absoluteAccuracy | protected double absoluteAccuracy(Code) | | Maximum absolute error.
|
defaultAbsoluteAccuracy | protected double defaultAbsoluteAccuracy(Code) | | Default maximum absolute error.
|
defaultFunctionValueAccuracy | protected double defaultFunctionValueAccuracy(Code) | | Default maximum error of function.
|
defaultMaximalIterationCount | protected int defaultMaximalIterationCount(Code) | | Default maximum number of iterations.
|
defaultRelativeAccuracy | protected double defaultRelativeAccuracy(Code) | | Default maximum relative error.
|
functionValueAccuracy | protected double functionValueAccuracy(Code) | | Maximum error of function.
|
iterationCount | protected int iterationCount(Code) | | The last iteration count.
|
maximalIterationCount | protected int maximalIterationCount(Code) | | Maximum number of iterations.
|
relativeAccuracy | protected double relativeAccuracy(Code) | | Maximum relative error.
|
result | protected double result(Code) | | The last computed root.
|
resultComputed | protected boolean resultComputed(Code) | | Indicates where a root has been computed.
|
UnivariateRealSolverImpl | protected UnivariateRealSolverImpl(UnivariateRealFunction f, int defaultMaximalIterationCount, double defaultAbsoluteAccuracy)(Code) | | Construct a solver with given iteration count and accuracy.
Parameters: f - the function to solve. Parameters: defaultAbsoluteAccuracy - maximum absolute error Parameters: defaultMaximalIterationCount - maximum number of iterations throws: IllegalArgumentException - if f is null or the defaultAbsoluteAccuracy is not valid |
clearResult | final protected void clearResult()(Code) | | Convenience function for implementations.
|
getAbsoluteAccuracy | public double getAbsoluteAccuracy()(Code) | | Get the actual absolute accuracy.
the accuracy |
getFunctionValueAccuracy | public double getFunctionValueAccuracy()(Code) | | Get the actual function value accuracy.
the accuracy |
getIterationCount | public int getIterationCount()(Code) | | Access the last iteration count.
the last iteration count throws: IllegalStateException - if no root has been computed |
getMaximalIterationCount | public int getMaximalIterationCount()(Code) | | Get the upper limit for the number of iterations.
the actual upper limit |
getRelativeAccuracy | public double getRelativeAccuracy()(Code) | | Get the actual relative accuracy.
the accuracy |
getResult | public double getResult()(Code) | | Access the last computed root.
the last computed root throws: IllegalStateException - if no root has been computed |
isBracketing | protected boolean isBracketing(double lower, double upper, UnivariateRealFunction f) throws FunctionEvaluationException(Code) | | Returns true iff the function takes opposite signs at the endpoints.
Parameters: lower - the lower endpoint Parameters: upper - the upper endpoint Parameters: f - the function true if f(lower) * f(upper) < 0 throws: FunctionEvaluationException - if an error occurs evaluating the function at the endpoints |
isSequence | protected boolean isSequence(double start, double mid, double end)(Code) | | Returns true if the arguments form a (strictly) increasing sequence
Parameters: start - first number Parameters: mid - second number Parameters: end - third number true if the arguments form an increasing sequence |
resetAbsoluteAccuracy | public void resetAbsoluteAccuracy()(Code) | | Reset the absolute accuracy to the default.
|
resetFunctionValueAccuracy | public void resetFunctionValueAccuracy()(Code) | | Reset the actual function accuracy to the default.
|
resetMaximalIterationCount | public void resetMaximalIterationCount()(Code) | | Reset the upper limit for the number of iterations to the default.
|
resetRelativeAccuracy | public void resetRelativeAccuracy()(Code) | | Reset the relative accuracy to the default.
|
setAbsoluteAccuracy | public void setAbsoluteAccuracy(double accuracy)(Code) | | Set the absolute accuracy.
Parameters: accuracy - the accuracy. throws: IllegalArgumentException - if the accuracy can't be achieved bythe solver or is otherwise deemed unreasonable. |
setFunctionValueAccuracy | public void setFunctionValueAccuracy(double accuracy)(Code) | | Set the function value accuracy.
Parameters: accuracy - the accuracy. throws: IllegalArgumentException - if the accuracy can't be achieved bythe solver or is otherwise deemed unreasonable. |
setMaximalIterationCount | public void setMaximalIterationCount(int count)(Code) | | Set the upper limit for the number of iterations.
Parameters: count - maximum number of iterations |
setRelativeAccuracy | public void setRelativeAccuracy(double accuracy)(Code) | | Set the relative accuracy.
Parameters: accuracy - the relative accuracy. throws: IllegalArgumentException - if the accuracy can't be achieved bythe solver or is otherwise deemed unreasonable. |
setResult | final protected void setResult(double result, int iterationCount)(Code) | | Convenience function for implementations.
Parameters: result - the result to set Parameters: iterationCount - the iteration count to set |
verifyInterval | protected void verifyInterval(double lower, double upper)(Code) | | Verifies that the endpoints specify an interval,
throws IllegalArgumentException if not
Parameters: lower - lower endpoint Parameters: upper - upper endpoint throws: IllegalArgumentException - |
verifySequence | protected void verifySequence(double lower, double initial, double upper)(Code) | | Verifies that lower < initial < upper
throws IllegalArgumentException if not
Parameters: lower - lower endpoint Parameters: initial - initial value Parameters: upper - upper endpoint throws: IllegalArgumentException - |
|
|