The changes with respect to the original Brent algorithm are:
AllowedSolution,The given interval must bracket the root.
| Modifier and Type | Field and Description |
|---|---|
| private AllowedSolution | allowed
The kinds of solutions that the algorithm may accept. |
| private static final double | DEFAULT_ABSOLUTE_ACCURACY
Default absolute accuracy. |
| private static final int | DEFAULT_MAXIMAL_ORDER
Default maximal order. |
| private static final int | MAXIMAL_AGING
Maximal aging triggering an attempt to balance the bracketing interval. |
| private final int | maximalOrder
Maximal order. |
| private static final double | REDUCTION_FACTOR
Reduction factor for attempts to balance the bracketing interval. |
| Access | Constructor and Description |
|---|---|
| public | BracketingNthOrderBrentSolver()
Construct a solver with default accuracy and maximal order (1e-6 and 5 respectively) |
| public | BracketingNthOrderBrentSolver(final double
Absolute accuracy. absoluteAccuracy, final int maximal order. maximalOrder)Construct a solver. |
| public | BracketingNthOrderBrentSolver(final double
Relative accuracy. relativeAccuracy, final double Absolute accuracy. absoluteAccuracy, final int maximal order. maximalOrder)Construct a solver. |
| public | BracketingNthOrderBrentSolver(final double
Relative accuracy. relativeAccuracy, final double Absolute accuracy. absoluteAccuracy, final double Function value accuracy. functionValueAccuracy, final int maximal order. maximalOrder)Construct a solver. |
| Modifier and Type | Method and Description |
|---|---|
| protected double | doSolve()
Implements abstract org. Method for implementing actual optimization algorithms in derived classes. |
| public int | |
| private double | Returns: guessed root (will be a NaN if two points share the same y)target value for y targetY, final double[] reference points abscissas for interpolation,
note that this array is modified during computation x, final double[] 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 double | solve(int
Maximum number of evaluations. maxEval, UnivariateFunction Function to solve. f, double Lower bound for the interval. min, double Upper bound for the interval. max, 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 double | solve(int
Maximum number of evaluations. maxEval, UnivariateFunction Function to solve. f, double Lower bound for the interval. min, double Upper bound for the interval. max, double Start value to use. startValue, 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 |
| allowed | back to summary |
|---|---|
| private AllowedSolution allowed The kinds of solutions that the algorithm may accept. | |
| DEFAULT_ABSOLUTE_ACCURACY | back to summary |
|---|---|
| private static final double DEFAULT_ABSOLUTE_ACCURACY Default absolute accuracy. | |
| DEFAULT_MAXIMAL_ORDER | back to summary |
|---|---|
| private static final int DEFAULT_MAXIMAL_ORDER Default maximal order. | |
| 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. | |
| REDUCTION_FACTOR | back to summary |
|---|---|
| private static final double REDUCTION_FACTOR Reduction factor for attempts to balance the bracketing interval. | |
| BracketingNthOrderBrentSolver | back to summary |
|---|---|
| public BracketingNthOrderBrentSolver() Construct a solver with default accuracy and maximal order (1e-6 and 5 respectively) | |
| BracketingNthOrderBrentSolver | back to summary |
|---|---|
| public BracketingNthOrderBrentSolver(final double absoluteAccuracy, final int maximalOrder) throws NumberIsTooSmallException Construct a solver.
| |
| BracketingNthOrderBrentSolver | back to summary |
|---|---|
| public BracketingNthOrderBrentSolver(final double relativeAccuracy, final double absoluteAccuracy, final int maximalOrder) throws NumberIsTooSmallException Construct a solver.
| |
| BracketingNthOrderBrentSolver | back to summary |
|---|---|
| public BracketingNthOrderBrentSolver(final double relativeAccuracy, final double absoluteAccuracy, final double functionValueAccuracy, final int maximalOrder) throws NumberIsTooSmallException Construct a solver.
| |
| doSolve | back to summary |
|---|---|
| protected double doSolve() throws TooManyEvaluationsException, NumberIsTooLargeException, NoBracketingException Implements abstract org. Doc from org. Method for implementing actual optimization algorithms in derived classes.
| |
| getMaximalOrder | back to summary |
|---|---|
| public int getMaximalOrder() Get the maximal order.
| |
| guessX | back to summary |
|---|---|
| private double guessX(final double targetY, final double[] x, final double[] 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 double solve(int maxEval, UnivariateFunction f, double min, double max, AllowedSolution allowedSolution) throws TooManyEvaluationsException, NumberIsTooLargeException, NoBracketingException Implements org. Doc from 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 double solve(int maxEval, UnivariateFunction f, double min, double max, double startValue, AllowedSolution allowedSolution) throws TooManyEvaluationsException, NumberIsTooLargeException, NoBracketingException Implements org. Doc from org. Solve for a zero in the given interval, start at
| |