| java.lang.Object org.apache.commons.math.analysis.UnivariateRealSolverImpl org.apache.commons.math.analysis.SecantSolver
SecantSolver | public class SecantSolver extends UnivariateRealSolverImpl implements Serializable(Code) | | Implements a modified version of the
secant method
for approximating a zero of a real univariate function.
The algorithm is modified to maintain bracketing of a root by successive
approximations. Because of forced bracketing, convergence may be slower than
the unrestricted secant algorithm. However, this implementation should in
general outperform the
regula falsi method.
The function is assumed to be continuous but not necessarily smooth.
version: $Revision: 348519 $ $Date: 2005-11-23 12:12:18 -0700 (Wed, 23 Nov 2005) $ |
Method Summary | |
public double | solve(double min, double max, double initial) Find a zero in the given interval. | public double | solve(double min, double max) Find a zero in the given interval.
Parameters: min - the lower bound for the interval. Parameters: max - the upper bound for the interval. |
SecantSolver | public SecantSolver(UnivariateRealFunction f)(Code) | | Construct a solver for the given function.
Parameters: f - function to solve. |
solve | public double solve(double min, double max, double initial) throws ConvergenceException, FunctionEvaluationException(Code) | | Find a zero in the given interval.
Parameters: min - the lower bound for the interval Parameters: max - the upper bound for the interval Parameters: initial - the start value to use (ignored) the value where the function is zero throws: ConvergenceException - if the maximum iteration count is exceeded throws: FunctionEvaluationException - if an error occurs evaluating thefunction throws: IllegalArgumentException - if min is not less than max or thesigns of the values of the function at the endpoints are not opposites |
Methods inherited from org.apache.commons.math.analysis.UnivariateRealSolverImpl | final protected void clearResult()(Code)(Java Doc) public double getAbsoluteAccuracy()(Code)(Java Doc) public double getFunctionValueAccuracy()(Code)(Java Doc) public int getIterationCount()(Code)(Java Doc) public int getMaximalIterationCount()(Code)(Java Doc) public double getRelativeAccuracy()(Code)(Java Doc) public double getResult()(Code)(Java Doc) protected boolean isBracketing(double lower, double upper, UnivariateRealFunction f) throws FunctionEvaluationException(Code)(Java Doc) protected boolean isSequence(double start, double mid, double end)(Code)(Java Doc) public void resetAbsoluteAccuracy()(Code)(Java Doc) public void resetFunctionValueAccuracy()(Code)(Java Doc) public void resetMaximalIterationCount()(Code)(Java Doc) public void resetRelativeAccuracy()(Code)(Java Doc) public void setAbsoluteAccuracy(double accuracy)(Code)(Java Doc) public void setFunctionValueAccuracy(double accuracy)(Code)(Java Doc) public void setMaximalIterationCount(int count)(Code)(Java Doc) public void setRelativeAccuracy(double accuracy)(Code)(Java Doc) final protected void setResult(double result, int iterationCount)(Code)(Java Doc) protected void verifyBracketing(double lower, double upper, UnivariateRealFunction f) throws FunctionEvaluationException(Code)(Java Doc) protected void verifyInterval(double lower, double upper)(Code)(Java Doc) protected void verifySequence(double lower, double initial, double upper)(Code)(Java Doc)
|
|
|