T
- Type of the (point, value) pair.
The type of the "value" part of the pair (not used by this class).public class SimplePointChecker<T extends Pair<double[],? extends Object>> extends AbstractConvergenceChecker<T>
ConvergenceChecker
interface using
only point coordinates.
Convergence is considered to have been reached if either the relative
difference between each point coordinate are smaller than a threshold
or if either the absolute difference between the point coordinates are
smaller than another threshold. converged
method will also return true
if the number of iterations has
been set (see this constructor
).Constructor and Description |
---|
SimplePointChecker(double relativeThreshold,
double absoluteThreshold)
Build an instance with specified thresholds.
|
SimplePointChecker(double relativeThreshold,
double absoluteThreshold,
int maxIter)
Builds an instance with specified thresholds.
|
Modifier and Type | Method and Description |
---|---|
boolean |
converged(int iteration,
T previous,
T current)
Check if the optimization algorithm has converged considering the
last two points.
|
getAbsoluteThreshold, getRelativeThreshold
public SimplePointChecker(double relativeThreshold, double absoluteThreshold)
relativeThreshold
- relative tolerance thresholdabsoluteThreshold
- absolute tolerance thresholdpublic SimplePointChecker(double relativeThreshold, double absoluteThreshold, int maxIter)
relativeThreshold
- Relative tolerance threshold.absoluteThreshold
- Absolute tolerance threshold.maxIter
- Maximum iteration count.NotStrictlyPositiveException
- if maxIter <= 0
.public boolean converged(int iteration, T previous, T current)
converged
in interface ConvergenceChecker<T extends Pair<double[],? extends Object>>
converged
in class AbstractConvergenceChecker<T extends Pair<double[],? extends Object>>
iteration
- Index of current iterationprevious
- Best point in the previous iteration.current
- Best point in the current iteration.true
if the arguments satify the convergence criterion.Copyright © 2019 CNES. All rights reserved.