Class Policy

java.lang.Object
org.apache.commons.numbers.gamma.Policy

final class Policy extends Object
Encapsulate the policy for function evaluation. This is a reduced implementation of the Boost boost::math::policies functionality. No settings are preserved for the error handling policy or promotion of data types for computations. This controls the convergence criteria and maximum iterations for series evaluations.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Policy
    Default policy.
    private final double
    Epsilon value for relative error.
    private final int
    The maximum number of iterations permitted in a series evaluation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Policy(double eps, int maxIterations)
    Instantiates a new policy.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static Policy
    Gets the default.
    (package private) double
    Gets the epsilon value for relative error.
    (package private) int
    Gets the maximum number of iterations permitted in a series evaluation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT

      private static final Policy DEFAULT
      Default policy. The Boost default uses 2^-52 for the epsilon. This uses 2^-53 to use an extra guard digit in the Kahan series summations. The minimum value for the Commons continued fraction epsilon is also 2^-53.
    • eps

      private final double eps
      Epsilon value for relative error.
    • maxIterations

      private final int maxIterations
      The maximum number of iterations permitted in a series evaluation.
  • Constructor Details

    • Policy

      Policy(double eps, int maxIterations)
      Instantiates a new policy.
      Parameters:
      eps - the eps
      maxIterations - the maximum number of iterations permitted in a series evaluation
  • Method Details

    • getDefault

      static Policy getDefault()
      Gets the default.
      Returns:
      the default policy
    • getEps

      double getEps()
      Gets the epsilon value for relative error.
      Returns:
      the epsilon
    • getMaxIterations

      int getMaxIterations()
      Gets the maximum number of iterations permitted in a series evaluation.
      Returns:
      max iterations