Package org.hipparchus.analysis.solvers
Class BisectionSolver
java.lang.Object
org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver<UnivariateFunction>
org.hipparchus.analysis.solvers.AbstractUnivariateSolver
org.hipparchus.analysis.solvers.BisectionSolver
- All Implemented Interfaces:
BaseUnivariateSolver<UnivariateFunction>
,UnivariateSolver
Implements the
bisection algorithm for finding zeros of univariate real functions.
The function should be continuous but not necessarily smooth.
-
Constructor Summary
ConstructorDescriptionConstruct a solver with default accuracy (1e-6).BisectionSolver
(double absoluteAccuracy) Construct a solver.BisectionSolver
(double relativeAccuracy, double absoluteAccuracy) Construct a solver. -
Method Summary
Modifier and TypeMethodDescriptionprotected double
doSolve()
Method for implementing actual optimization algorithms in derived classes.Methods inherited from class org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver
computeObjectiveValue, getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getMax, getMin, getRelativeAccuracy, getStartValue, incrementEvaluationCount, isBracketing, isSequence, setup, solve, solve, solve, verifyBracketing, verifyInterval, verifySequence
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hipparchus.analysis.solvers.BaseUnivariateSolver
getAbsoluteAccuracy, getEvaluations, getFunctionValueAccuracy, getRelativeAccuracy, solve, solve, solve
-
Constructor Details
-
BisectionSolver
public BisectionSolver()Construct a solver with default accuracy (1e-6). -
BisectionSolver
public BisectionSolver(double absoluteAccuracy) Construct a solver.- Parameters:
absoluteAccuracy
- Absolute accuracy.
-
BisectionSolver
public BisectionSolver(double relativeAccuracy, double absoluteAccuracy) Construct a solver.- Parameters:
relativeAccuracy
- Relative accuracy.absoluteAccuracy
- Absolute accuracy.
-
-
Method Details
-
doSolve
Method for implementing actual optimization algorithms in derived classes.- Specified by:
doSolve
in classBaseAbstractUnivariateSolver<UnivariateFunction>
- Returns:
- the root.
- Throws:
MathIllegalStateException
- if the maximal number of evaluations is exceeded.
-