IterativeAlgorithm
. The concept of "accuracy" is
currently is also contained in SimpleRealPointChecker
and similar classes.@Deprecated
public interface ConvergingAlgorithm
This interface only deals with convergence parameters setting, not execution of the algorithms per se.
ConvergenceException
Modifier and Type | Method and Description |
---|---|
double |
getAbsoluteAccuracy()
Deprecated.
Get the actual absolute accuracy.
|
int |
getIterationCount()
Deprecated.
Get the number of iterations in the last run of the algorithm.
|
int |
getMaximalIterationCount()
Deprecated.
Get the upper limit for the number of iterations.
|
double |
getRelativeAccuracy()
Deprecated.
Get the actual relative accuracy.
|
void |
resetAbsoluteAccuracy()
Deprecated.
Reset the absolute accuracy to the default.
|
void |
resetMaximalIterationCount()
Deprecated.
Reset the upper limit for the number of iterations to the default.
|
void |
resetRelativeAccuracy()
Deprecated.
Reset the relative accuracy to the default.
|
void |
setAbsoluteAccuracy(double accuracy)
Deprecated.
Set the absolute accuracy.
|
void |
setMaximalIterationCount(int count)
Deprecated.
Set the upper limit for the number of iterations.
|
void |
setRelativeAccuracy(double accuracy)
Deprecated.
Set the relative accuracy.
|
void setMaximalIterationCount(int count)
Usually a high iteration count indicates convergence problems. However, the "reasonable value" varies widely for different algorithms. Users are advised to use the default value supplied by the algorithm.
A ConvergenceException
will be thrown if this number
is exceeded.
count
- maximum number of iterationsint getMaximalIterationCount()
void resetMaximalIterationCount()
The default value is supplied by the algorithm implementation.
setMaximalIterationCount(int)
void setAbsoluteAccuracy(double accuracy)
The default is usually chosen so that results in the interval -10..-0.1 and +0.1..+10 can be found with a reasonable accuracy. If the expected absolute value of your results is of much smaller magnitude, set this to a smaller value.
Algorithms are advised to do a plausibility check with the relative accuracy, but clients should not rely on this.
accuracy
- the accuracy.java.lang.IllegalArgumentException
- if the accuracy can't be achieved by
the solver or is otherwise deemed unreasonable.double getAbsoluteAccuracy()
void resetAbsoluteAccuracy()
The default value is provided by the algorithm implementation.
void setRelativeAccuracy(double accuracy)
This is used to stop iterations if the absolute accuracy can't be achieved due to large values or short mantissa length.
If this should be the primary criterion for convergence rather then a
safety measure, set the absolute accuracy to a ridiculously small value,
like MathUtils.SAFE_MIN
.
accuracy
- the relative accuracy.java.lang.IllegalArgumentException
- if the accuracy can't be achieved by
the algorithm or is otherwise deemed unreasonable.double getRelativeAccuracy()
void resetRelativeAccuracy()
int getIterationCount()
This is mainly meant for testing purposes. It may occasionally help track down performance problems: if the iteration count is notoriously high, check whether the problem is evaluated properly, and whether another algorithm is more amenable to the problem.
java.lang.IllegalStateException
- if there is no result available, either
because no result was yet computed or the last attempt failed."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"