Class Policy


  • final class Policy
    extends java.lang.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:
    Policies: Controlling Precision, Error Handling etc
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Policy DEFAULT
      Default policy.
      private double eps
      Epsilon value for relative error.
      private int maxIterations
      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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static Policy getDefault()
      Gets the default.
      (package private) double getEps()
      Gets the epsilon value for relative error.
      (package private) int getMaxIterations()
      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 Detail

      • 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 Detail

      • 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 Detail

      • 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