Package org.apache.commons.numbers.gamma
Class Policy
- java.lang.Object
-
- org.apache.commons.numbers.gamma.Policy
-
final class Policy extends java.lang.ObjectEncapsulate the policy for function evaluation. This is a reduced implementation of the Boostboost::math::policiesfunctionality. 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.
-
-
Field Summary
Fields Modifier and Type Field Description private static PolicyDEFAULTDefault policy.private doubleepsEpsilon value for relative error.private intmaxIterationsThe 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 PolicygetDefault()Gets the default.(package private) doublegetEps()Gets the epsilon value for relative error.(package private) intgetMaxIterations()Gets the maximum number of iterations permitted in a series evaluation.
-
-
-
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.
-
-
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
-
-