The changes with respect to the original Brent algorithm are:
AllowedSolutionThe given interval must bracket the root.
| Modifier and Type | Field and Description |
|---|---|
| private final T | absoluteAccuracy
Absolute accuracy. |
| private IntegerSequence. | evaluations
Evaluations counter. |
| private final Field | field
Field to which the elements belong. |
| private final T | functionValueAccuracy
Function value accuracy. |
| private static final int | MAXIMAL_AGING
Maximal aging triggering an attempt to balance the bracketing interval. |
| private final int | maximalOrder
Maximal order. |
| private final T | relativeAccuracy
Relative accuracy. |
| Access | Constructor and Description |
|---|---|
| public | FieldBracketingNthOrderBrentSolver(final T
Relative accuracy. relativeAccuracy, final T Absolute accuracy. absoluteAccuracy, final T Function value accuracy. functionValueAccuracy, final int maximal order. maximalOrder)Construct a solver. |
| Modifier and Type | Method and Description |
|---|---|
| public T | Returns: absolute accuracyImplements org. Get the absolute accuracy. |
| public int | Returns: the number of evaluations of the objective function.Implements org. Get the number of evaluations of the objective function. |
| public T | Returns: function accuracyImplements org. Get the function accuracy. |
| public int | Returns: the maximal number of function evaluations.Implements org. Get the maximal number of function evaluations. |
| public int | |
| public T | Returns: relative accuracyImplements org. Get the relative accuracy. |
| private T | Returns: guessed root (will be a NaN if two points share the same y)target value for y targetY, final T[] reference points abscissas for interpolation,
note that this array is modified during computation x, final T[] reference points ordinates for interpolation y, final int start index of the points to consider (inclusive) start, final int end index of the points to consider (exclusive) end)Guess an x value by nth order inverse polynomial interpolation. |
| public T | Returns: a value where the function is zero.Maximum number of evaluations. maxEval, final RealFieldUnivariateFunction<T> Function to solve. f, final T Lower bound for the interval. min, final T Upper bound for the interval. max, final AllowedSolution The kind of solutions that the root-finding algorithm may
accept as solutions. allowedSolution)Implements org. Solve for a zero in the given interval. |
| public T | Returns: a value where the function is zero.Maximum number of evaluations. maxEval, final RealFieldUnivariateFunction<T> Function to solve. f, final T Lower bound for the interval. min, final T Upper bound for the interval. max, final T Start value to use. startValue, final AllowedSolution The kind of solutions that the root-finding algorithm may
accept as solutions. allowedSolution)Implements org. Solve for a zero in the given interval, start at |
| absoluteAccuracy | back to summary |
|---|---|
| private final T absoluteAccuracy Absolute accuracy. | |
| evaluations | back to summary |
|---|---|
| private IntegerSequence. Evaluations counter. | |
| field | back to summary |
|---|---|
| private final Field<T> field Field to which the elements belong. | |
| functionValueAccuracy | back to summary |
|---|---|
| private final T functionValueAccuracy Function value accuracy. | |
| MAXIMAL_AGING | back to summary |
|---|---|
| private static final int MAXIMAL_AGING Maximal aging triggering an attempt to balance the bracketing interval. | |
| maximalOrder | back to summary |
|---|---|
| private final int maximalOrder Maximal order. | |
| relativeAccuracy | back to summary |
|---|---|
| private final T relativeAccuracy Relative accuracy. | |
| FieldBracketingNthOrderBrentSolver | back to summary |
|---|---|
| public FieldBracketingNthOrderBrentSolver(final T relativeAccuracy, final T absoluteAccuracy, final T functionValueAccuracy, final int maximalOrder) throws NumberIsTooSmallException Construct a solver.
| |
| getAbsoluteAccuracy | back to summary |
|---|---|
| public T getAbsoluteAccuracy() Implements org. Get the absolute accuracy.
| |
| getEvaluations | back to summary |
|---|---|
| public int getEvaluations() Implements org. Get the number of evaluations of the objective function.
The number of evaluations corresponds to the last call to the
| |
| getFunctionValueAccuracy | back to summary |
|---|---|
| public T getFunctionValueAccuracy() Implements org. Get the function accuracy.
| |
| getMaxEvaluations | back to summary |
|---|---|
| public int getMaxEvaluations() Implements org. Get the maximal number of function evaluations.
| |
| getMaximalOrder | back to summary |
|---|---|
| public int getMaximalOrder() Get the maximal order.
| |
| getRelativeAccuracy | back to summary |
|---|---|
| public T getRelativeAccuracy() Implements org. Get the relative accuracy.
| |
| guessX | back to summary |
|---|---|
| private T guessX(final T targetY, final T[] x, final T[] y, final int start, final int end) Guess an x value by nth order inverse polynomial interpolation. The x value is guessed by evaluating polynomial Q(y) at y = targetY, where Q is built such that for all considered points (xi, yi), Q(yi) = xi.
| |
| solve | back to summary |
|---|---|
| public T solve(final int maxEval, final RealFieldUnivariateFunction<T> f, final T min, final T max, final AllowedSolution allowedSolution) throws NullArgumentException, NoBracketingException Implements org. 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.
| |
| solve | back to summary |
|---|---|
| public T solve(final int maxEval, final RealFieldUnivariateFunction<T> f, final T min, final T max, final T startValue, final AllowedSolution allowedSolution) throws NullArgumentException, NoBracketingException Implements org. Solve for a zero in the given interval, start at
| |