public class SecantSolver extends AbstractUnivariateSolver
Implementation based on the following article: M. Dowell and P. Jarratt, A modified regula falsi method for computing the root of an equation, BIT Numerical Mathematics, volume 11, number 2, pages 168-174, Springer, 1971.
Note that since release 3.0 this class implements the actual
Secant algorithm, and not a modified one. As such, the 3.0 version
is not backwards compatible with previous versions. To use an algorithm
similar to the pre-3.0 releases, use the
Illinois algorithm or the
Pegasus algorithm.
| Modifier and Type | Field and Description |
|---|---|
protected static double |
DEFAULT_ABSOLUTE_ACCURACY
Default absolute accuracy.
|
| Constructor and Description |
|---|
SecantSolver()
Construct a solver with default accuracy (1e-6).
|
SecantSolver(double absoluteAccuracy)
Construct a solver.
|
SecantSolver(double relativeAccuracy,
double absoluteAccuracy)
Construct a solver.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
doSolve()
Method for implementing actual optimization algorithms in derived
classes.
|
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMaxEvaluations, getMin, getRelativeAccuracy, getStartValue, incrementEvaluationCount, isBracketing, isSequence, setup, solve, solve, solve, verifyBracketing, verifyInterval, verifySequenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMaxEvaluations, getRelativeAccuracy, solve, solve, solveprotected static final double DEFAULT_ABSOLUTE_ACCURACY
public SecantSolver()
public SecantSolver(double absoluteAccuracy)
absoluteAccuracy - absolute accuracypublic SecantSolver(double relativeAccuracy,
double absoluteAccuracy)
relativeAccuracy - relative accuracyabsoluteAccuracy - absolute accuracyprotected final double doSolve()
throws TooManyEvaluationsException,
NoBracketingException
doSolve in class BaseAbstractUnivariateSolver<UnivariateFunction>TooManyEvaluationsException - if the maximal number of evaluations
is exceeded.NoBracketingException - if the initial search interval does not bracket
a root and the solver requires it.Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.