Package org.hipparchus.optim
Class AbstractConvergenceChecker<P>
- java.lang.Object
-
- org.hipparchus.optim.AbstractConvergenceChecker<P>
-
- Type Parameters:
P
- Type of (point, value) pair.
- All Implemented Interfaces:
ConvergenceChecker<P>
- Direct Known Subclasses:
SimplePointChecker
,SimpleUnivariateValueChecker
,SimpleValueChecker
,SimpleVectorValueChecker
public abstract class AbstractConvergenceChecker<P> extends Object implements ConvergenceChecker<P>
Base class for all convergence checker implementations.
-
-
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 boolean
converged(int iteration, P previous, P current)
Check if the optimization algorithm has converged.double
getAbsoluteThreshold()
Get absolute threshold.double
getRelativeThreshold()
Get relative threshold.
-
-
-
Method Detail
-
getRelativeThreshold
public double getRelativeThreshold()
Get relative threshold.- Returns:
- the relative threshold.
-
getAbsoluteThreshold
public double getAbsoluteThreshold()
Get absolute threshold.- Returns:
- the absolute threshold.
-
converged
public abstract boolean converged(int iteration, P previous, P current)
Check if the optimization algorithm has converged.- Specified by:
converged
in interfaceConvergenceChecker<P>
- Parameters:
iteration
- Current iteration.previous
- Best point in the previous iteration.current
- Best point in the current iteration.- Returns:
true
if the algorithm is considered to have converged.
-
-