Class BracketingNthOrderBrentSolver

All Implemented Interfaces:
BaseUnivariateSolver<UnivariateFunction>, BracketedUnivariateSolver<UnivariateFunction>, UnivariateSolver

public class BracketingNthOrderBrentSolver extends AbstractUnivariateSolver implements BracketedUnivariateSolver<UnivariateFunction>
This class implements a modification of the Brent algorithm.

The changes with respect to the original Brent algorithm are:

  • the returned value is chosen in the current interval according to user specified AllowedSolution,
  • the maximal order for the invert polynomial root search is user-specified instead of being invert quadratic only

The given interval must bracket the root.

  • Field Details

    • DEFAULT_ABSOLUTE_ACCURACY

      private static final double DEFAULT_ABSOLUTE_ACCURACY
      Default absolute accuracy.
      See Also:
    • DEFAULT_MAXIMAL_ORDER

      private static final int DEFAULT_MAXIMAL_ORDER
      Default maximal order.
      See Also:
    • MAXIMAL_AGING

      private static final int MAXIMAL_AGING
      Maximal aging triggering an attempt to balance the bracketing interval.
      See Also:
    • REDUCTION_FACTOR

      private static final double REDUCTION_FACTOR
      Reduction factor for attempts to balance the bracketing interval.
      See Also:
    • maximalOrder

      private final int maximalOrder
      Maximal order.
    • allowed

      private AllowedSolution allowed
      The kinds of solutions that the algorithm may accept.
  • Constructor Details

    • BracketingNthOrderBrentSolver

      public BracketingNthOrderBrentSolver()
      Construct a solver with default accuracy and maximal order (1e-6 and 5 respectively)
    • BracketingNthOrderBrentSolver

      public BracketingNthOrderBrentSolver(double absoluteAccuracy, int maximalOrder) throws NumberIsTooSmallException
      Construct a solver.
      Parameters:
      absoluteAccuracy - Absolute accuracy.
      maximalOrder - maximal order.
      Throws:
      NumberIsTooSmallException - if maximal order is lower than 2
    • BracketingNthOrderBrentSolver

      public BracketingNthOrderBrentSolver(double relativeAccuracy, double absoluteAccuracy, int maximalOrder) throws NumberIsTooSmallException
      Construct a solver.
      Parameters:
      relativeAccuracy - Relative accuracy.
      absoluteAccuracy - Absolute accuracy.
      maximalOrder - maximal order.
      Throws:
      NumberIsTooSmallException - if maximal order is lower than 2
    • BracketingNthOrderBrentSolver

      public BracketingNthOrderBrentSolver(double relativeAccuracy, double absoluteAccuracy, double functionValueAccuracy, int maximalOrder) throws NumberIsTooSmallException
      Construct a solver.
      Parameters:
      relativeAccuracy - Relative accuracy.
      absoluteAccuracy - Absolute accuracy.
      functionValueAccuracy - Function value accuracy.
      maximalOrder - maximal order.
      Throws:
      NumberIsTooSmallException - if maximal order is lower than 2
  • Method Details