T - the type of the field elementsBracketedRealFieldUnivariateSolver<T>public class FieldBracketingNthOrderBrentSolver<T extends RealFieldElement<T>> extends Object implements BracketedRealFieldUnivariateSolver<T>
The changes with respect to the original Brent algorithm are:
AllowedSolutionThe given interval must bracket the root.
BracketedRealFieldUnivariateSolver.Interval<T extends RealFieldElement<T>>| Constructor | Description |
|---|---|
FieldBracketingNthOrderBrentSolver(T relativeAccuracy,
T absoluteAccuracy,
T functionValueAccuracy,
int maximalOrder) |
Construct a solver.
|
| Modifier and Type | Method | Description |
|---|---|---|
T |
getAbsoluteAccuracy() |
Get the absolute accuracy.
|
int |
getEvaluations() |
Get the number of evaluations of the objective function.
|
T |
getFunctionValueAccuracy() |
Get the function accuracy.
|
int |
getMaxEvaluations() |
Get the maximal number of function evaluations.
|
int |
getMaximalOrder() |
Get the maximal order.
|
T |
getRelativeAccuracy() |
Get the relative accuracy.
|
T |
solve(int maxEval,
RealFieldUnivariateFunction<T> f,
T min,
T max,
AllowedSolution allowedSolution) |
Solve for a zero in the given interval.
|
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. |
BracketedRealFieldUnivariateSolver.Interval<T> |
solveInterval(int maxEval,
RealFieldUnivariateFunction<T> f,
T min,
T max,
T startValue) |
Solve for a zero in the given interval and return a tolerance interval surrounding
the root.
|
solveIntervalpublic FieldBracketingNthOrderBrentSolver(T relativeAccuracy, T absoluteAccuracy, T functionValueAccuracy, int maximalOrder) throws MathIllegalArgumentException
relativeAccuracy - Relative accuracy.absoluteAccuracy - Absolute accuracy.functionValueAccuracy - Function value accuracy.maximalOrder - maximal order.MathIllegalArgumentException - if maximal order is lower than 2public int getMaximalOrder()
public int getMaxEvaluations()
getMaxEvaluations in interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>public int getEvaluations()
optimize method. It is 0 if the method has not been
called yet.getEvaluations in interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>public T getAbsoluteAccuracy()
getAbsoluteAccuracy in interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>public T getRelativeAccuracy()
getRelativeAccuracy in interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>public T getFunctionValueAccuracy()
getFunctionValueAccuracy in interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>public T solve(int maxEval, RealFieldUnivariateFunction<T> f, T min, T max, AllowedSolution allowedSolution) throws MathIllegalArgumentException, NullArgumentException
solve in interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>maxEval - Maximum number of evaluations.f - Function to solve.min - Lower bound for the interval.max - Upper bound for the interval.allowedSolution - The kind of solutions that the root-finding algorithm may
accept as solutions.NullArgumentException - if f is null.MathIllegalArgumentException - if root cannot be bracketedpublic T solve(int maxEval, RealFieldUnivariateFunction<T> f, T min, T max, T startValue, AllowedSolution allowedSolution) throws MathIllegalArgumentException, NullArgumentException
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.solve in interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>maxEval - Maximum number of evaluations.f - Function to solve.min - Lower bound for the interval.max - Upper bound for the interval.startValue - Start value to use.allowedSolution - The kind of solutions that the root-finding algorithm may
accept as solutions.NullArgumentException - if f is null.MathIllegalArgumentException - if root cannot be bracketedpublic BracketedRealFieldUnivariateSolver.Interval<T> solveInterval(int maxEval, RealFieldUnivariateFunction<T> f, T min, T max, T startValue) throws MathIllegalArgumentException, MathIllegalStateException
It is required that the starting interval brackets a root.
solveInterval in interface BracketedRealFieldUnivariateSolver<T extends RealFieldElement<T>>maxEval - Maximum number of evaluations.f - Function to solve.min - Lower bound for the interval. f(min) != 0.0.max - Upper bound for the interval. f(max) != 0.0.startValue - start value to use.absolute
accuracy + max(ta, tb) * relative accuracy) or (
max(|f(ta)|, |f(tb)|) <= BracketedRealFieldUnivariateSolver.getFunctionValueAccuracy()) or numbers in the
field between ta and tb. The width of the interval (tb - ta) may be zero.MathIllegalArgumentException - if the arguments do not satisfy the
requirements specified by the solver.MathIllegalStateException - if the allowed number of evaluations is
exceeded.Copyright © 2016–2018 Hipparchus.org. All rights reserved.