Class RelativeTolerance
- java.lang.Object
-
- dev.nm.misc.algorithm.iterative.tolerance.RelativeTolerance
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_TOLERANCE
default tolerance
-
Constructor Summary
Constructors Constructor Description RelativeTolerance(double base)
Construct an instance withDEFAULT_TOLERANCE
.RelativeTolerance(double base, double tolerance)
Construct an instance with specifiedtolerance
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isResidualSmall(double norm)
Checks if the updated residual satisfies the tolerance criteria.
-
-
-
Field Detail
-
DEFAULT_TOLERANCE
public static final double DEFAULT_TOLERANCE
default tolerance- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RelativeTolerance
public RelativeTolerance(double base)
Construct an instance withDEFAULT_TOLERANCE
.- Parameters:
base
- the base value for computing the relative residual
-
RelativeTolerance
public RelativeTolerance(double base, double tolerance)
Construct an instance with specifiedtolerance
.- Parameters:
base
- the base value for computing the relative residualtolerance
- the residual norm criteria
-
-
Method Detail
-
isResidualSmall
public boolean isResidualSmall(double norm)
Description copied from interface:Tolerance
Checks if the updated residual satisfies the tolerance criteria.- Specified by:
isResidualSmall
in interfaceTolerance
- Parameters:
norm
- the norm of the updated residual- Returns:
true
if the residual norm is small enough
-
-