Class AbstractConvergenceChecker<PAIR>
- java.lang.Object
-
- org.apache.commons.math4.legacy.optim.AbstractConvergenceChecker<PAIR>
-
- Type Parameters:
PAIR- Type of (point, value) pair.
- All Implemented Interfaces:
ConvergenceChecker<PAIR>,OptimizationData
- Direct Known Subclasses:
SimplePointChecker,SimpleUnivariateValueChecker,SimpleValueChecker,SimpleVectorValueChecker
public abstract class AbstractConvergenceChecker<PAIR> extends Object implements ConvergenceChecker<PAIR>
Base class for all convergence checker implementations.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description AbstractConvergenceChecker(double relativeThreshold, double absoluteThreshold)Build an instance with a specified thresholds.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanconverged(int iteration, PAIR previous, PAIR current)Check if the optimization algorithm has converged.doublegetAbsoluteThreshold()doublegetRelativeThreshold()
-
-
-
Constructor Detail
-
AbstractConvergenceChecker
public AbstractConvergenceChecker(double relativeThreshold, double absoluteThreshold)
Build an instance with a specified thresholds.- Parameters:
relativeThreshold- relative tolerance thresholdabsoluteThreshold- absolute tolerance threshold
-
-
Method Detail
-
getRelativeThreshold
public double getRelativeThreshold()
- Returns:
- the relative threshold.
-
getAbsoluteThreshold
public double getAbsoluteThreshold()
- Returns:
- the absolute threshold.
-
converged
public abstract boolean converged(int iteration, PAIR previous, PAIR current)
Check if the optimization algorithm has converged.- Specified by:
convergedin interfaceConvergenceChecker<PAIR>- Parameters:
iteration- Current iteration.previous- Best point in the previous iteration.current- Best point in the current iteration.- Returns:
trueif the algorithm is considered to have converged.
-
-