Package org.apache.commons.numbers.gamma
Class Policy
java.lang.Object
org.apache.commons.numbers.gamma.Policy
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
FieldsModifier and TypeFieldDescriptionprivate 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 -
Method Summary
-
Field Details
-
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 epsEpsilon value for relative error. -
maxIterations
private final int maxIterationsThe maximum number of iterations permitted in a series evaluation.
-
-
Constructor Details
-
Policy
Policy(double eps, int maxIterations) Instantiates a new policy.- Parameters:
eps
- the epsmaxIterations
- the maximum number of iterations permitted in a series evaluation
-
-
Method Details
-
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
-