Top Description Methods
org.apache.commons.math3.analysis.solvers

public Interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>

Known Direct Implementers
org.apache.commons.math3.analysis.solvers.FieldBracketingNthOrderBrentSolver
Type Parameters
<T>
the type of the field elements
Imports
org.apache.commons.math3.RealFieldElement, org.apache.commons.math3.analysis.RealFieldUnivariateFunction

Interface for (univariate real) root-finding algorithms that maintain a bracketed solution. There are several advantages to having such root-finding algorithms:

For backwards compatibility, all root-finding algorithms must have ANY_SIDE as default for the allowed solutions.

Since
3.6
See Also
AllowedSolution

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the absolute accuracy.
getAbsoluteAccuracy
()

Get the absolute accuracy of the solver.

public int

Returns:

the number of evaluations of the objective function.
getEvaluations
()

Get the number of evaluations of the objective function.

public T

Returns:

the function value accuracy.
getFunctionValueAccuracy
()

Get the function value accuracy of the solver.

public int

Returns:

the maximum number of function evaluations.
getMaxEvaluations
()

Get the maximum number of function evaluations.

public T

Returns:

the relative accuracy.
getRelativeAccuracy
()

Get the relative accuracy of the solver.

public T

Returns:

A value where the function is zero.
solve
(int
Maximum number of evaluations.
maxEval
,
RealFieldUnivariateFunction<T>
Function to solve.
f
,
T
Lower bound for the interval.
min
,
T
Upper bound for the interval.
max
,
AllowedSolution
The kind of solutions that the root-finding algorithm may accept as solutions.
allowedSolution
)

Solve for a zero in the given interval.

public T

Returns:

A value where the function is zero.
solve
(int
Maximum number of evaluations.
maxEval
,
RealFieldUnivariateFunction<T>
Function to solve.
f
,
T
Lower bound for the interval.
min
,
T
Upper bound for the interval.
max
,
T
Start value to use.
startValue
,
AllowedSolution
The kind of solutions that the root-finding algorithm may accept as solutions.
allowedSolution
)

Solve for a zero in the given interval, start at startValue.

Method Detail

getAbsoluteAccuracyback to summary
public T getAbsoluteAccuracy()

Get the absolute accuracy of the solver. Solutions returned by the solver should be accurate to this tolerance, i.e., if ε is the absolute accuracy of the solver and v is a value returned by one of the solve methods, then a root of the function should exist somewhere in the interval (v - ε, v + ε).

Returns:T

the absolute accuracy.

getEvaluationsback to summary
public int getEvaluations()

Get the number of evaluations of the objective function. The number of evaluations corresponds to the last call to the optimize method. It is 0 if the method has not been called yet.

Returns:int

the number of evaluations of the objective function.

getFunctionValueAccuracyback to summary
public T getFunctionValueAccuracy()

Get the function value accuracy of the solver. If v is a value returned by the solver for a function f, then by contract, |f(v)| should be less than or equal to the function value accuracy configured for the solver.

Returns:T

the function value accuracy.

getMaxEvaluationsback to summary
public int getMaxEvaluations()

Get the maximum number of function evaluations.

Returns:int

the maximum number of function evaluations.

getRelativeAccuracyback to summary
public T getRelativeAccuracy()

Get the relative accuracy of the solver. The contract for relative accuracy is the same as getAbsoluteAccuracy(), but using relative, rather than absolute error. If ρ is the relative accuracy configured for a solver and v is a value returned, then a root of the function should exist somewhere in the interval (v - ρ v, v + ρ v).

Returns:T

the relative accuracy.

solveback to summary
public T solve(int maxEval, RealFieldUnivariateFunction<T> f, T min, T max, AllowedSolution allowedSolution)

Solve for a zero in the given interval. A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

Parameters
maxEval:int

Maximum number of evaluations.

f:RealFieldUnivariateFunction<T>

Function to solve.

min:T

Lower bound for the interval.

max:T

Upper bound for the interval.

allowedSolution:AllowedSolution

The kind of solutions that the root-finding algorithm may accept as solutions.

Returns:T

A value where the function is zero.

Exceptions
MathIllegalArgumentException:
if the arguments do not satisfy the requirements specified by the solver.
TooManyEvaluationsException:
if the allowed number of evaluations is exceeded.
solveback to summary
public T solve(int maxEval, RealFieldUnivariateFunction<T> f, T min, T max, T startValue, AllowedSolution allowedSolution)

Solve for a zero in the given interval, start at startValue. A solver may require that the interval brackets a single zero root. Solvers that do require bracketing should be able to handle the case where one of the endpoints is itself a root.

Parameters
maxEval:int

Maximum number of evaluations.

f:RealFieldUnivariateFunction<T>

Function to solve.

min:T

Lower bound for the interval.

max:T

Upper bound for the interval.

startValue:T

Start value to use.

allowedSolution:AllowedSolution

The kind of solutions that the root-finding algorithm may accept as solutions.

Returns:T

A value where the function is zero.

Exceptions
MathIllegalArgumentException:
if the arguments do not satisfy the requirements specified by the solver.
TooManyEvaluationsException:
if the allowed number of evaluations is exceeded.