Class ConvergingAlgorithmImpl
- All Implemented Interfaces:
ConvergingAlgorithm
- Direct Known Subclasses:
AbstractUnivariateRealOptimizer
,UnivariateRealIntegratorImpl
,UnivariateRealSolverImpl
- Since:
- 2.0
- Version:
- $Revision: 1062691 $ $Date: 2011-01-24 10:12:47 +0100 (lun. 24 janv. 2011) $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
Deprecated.Maximum absolute error.protected double
Deprecated.Default maximum absolute error.protected int
Deprecated.Default maximum number of iterations.protected double
Deprecated.Default maximum relative error.protected int
Deprecated.The last iteration count.protected int
Deprecated.Maximum number of iterations.protected double
Deprecated.Maximum relative error. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Deprecated.in 2.2 (to be removed as soon as the single non-default one has been removed).protected
ConvergingAlgorithmImpl
(int defaultMaximalIterationCount, double defaultAbsoluteAccuracy) Deprecated.in 2.2. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Deprecated.Get the actual absolute accuracy.int
Deprecated.Get the number of iterations in the last run of the algorithm.int
Deprecated.Get the upper limit for the number of iterations.double
Deprecated.Get the actual relative accuracy.protected void
Deprecated.Increment the iterations counter by 1.void
Deprecated.Reset the absolute accuracy to the default.protected void
Deprecated.Reset the iterations counter to 0.void
Deprecated.Reset the upper limit for the number of iterations to the default.void
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.
-
Field Details
-
absoluteAccuracy
protected double absoluteAccuracyDeprecated.Maximum absolute error. -
relativeAccuracy
protected double relativeAccuracyDeprecated.Maximum relative error. -
maximalIterationCount
protected int maximalIterationCountDeprecated.Maximum number of iterations. -
defaultAbsoluteAccuracy
protected double defaultAbsoluteAccuracyDeprecated.Default maximum absolute error. -
defaultRelativeAccuracy
protected double defaultRelativeAccuracyDeprecated.Default maximum relative error. -
defaultMaximalIterationCount
protected int defaultMaximalIterationCountDeprecated.Default maximum number of iterations. -
iterationCount
protected int iterationCountDeprecated.The last iteration count.
-
-
Constructor Details
-
ConvergingAlgorithmImpl
@Deprecated protected ConvergingAlgorithmImpl(int defaultMaximalIterationCount, double defaultAbsoluteAccuracy) Deprecated.in 2.2. Derived classes should use the "setter" methods in order to assign meaningful values to all the instances variables.Construct an algorithm with given iteration count and accuracy.- Parameters:
defaultAbsoluteAccuracy
- maximum absolute errordefaultMaximalIterationCount
- maximum number of iterations- Throws:
IllegalArgumentException
- if f is null or the defaultAbsoluteAccuracy is not valid
-
ConvergingAlgorithmImpl
Deprecated.in 2.2 (to be removed as soon as the single non-default one has been removed).Default constructor.- Since:
- 2.2
-
-
Method Details
-
getIterationCount
public int getIterationCount()Deprecated.Get the number of iterations in the last run of the algorithm.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.
- Specified by:
getIterationCount
in interfaceConvergingAlgorithm
- Returns:
- the last iteration count.
-
setAbsoluteAccuracy
public void setAbsoluteAccuracy(double accuracy) Deprecated.Set the absolute 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.
- Specified by:
setAbsoluteAccuracy
in interfaceConvergingAlgorithm
- Parameters:
accuracy
- the accuracy.
-
getAbsoluteAccuracy
public double getAbsoluteAccuracy()Deprecated.Get the actual absolute accuracy.- Specified by:
getAbsoluteAccuracy
in interfaceConvergingAlgorithm
- Returns:
- the accuracy
-
resetAbsoluteAccuracy
public void resetAbsoluteAccuracy()Deprecated.Reset the absolute accuracy to the default.The default value is provided by the algorithm implementation.
- Specified by:
resetAbsoluteAccuracy
in interfaceConvergingAlgorithm
-
setMaximalIterationCount
public void setMaximalIterationCount(int count) Deprecated.Set the upper limit for the number of iterations.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.- Specified by:
setMaximalIterationCount
in interfaceConvergingAlgorithm
- Parameters:
count
- maximum number of iterations
-
getMaximalIterationCount
public int getMaximalIterationCount()Deprecated.Get the upper limit for the number of iterations.- Specified by:
getMaximalIterationCount
in interfaceConvergingAlgorithm
- Returns:
- the actual upper limit
-
resetMaximalIterationCount
public void resetMaximalIterationCount()Deprecated.Reset the upper limit for the number of iterations to the default.The default value is supplied by the algorithm implementation.
- Specified by:
resetMaximalIterationCount
in interfaceConvergingAlgorithm
- See Also:
-
setRelativeAccuracy
public void setRelativeAccuracy(double accuracy) Deprecated.Set the relative 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
.- Specified by:
setRelativeAccuracy
in interfaceConvergingAlgorithm
- Parameters:
accuracy
- the relative accuracy.
-
getRelativeAccuracy
public double getRelativeAccuracy()Deprecated.Get the actual relative accuracy.- Specified by:
getRelativeAccuracy
in interfaceConvergingAlgorithm
- Returns:
- the accuracy
-
resetRelativeAccuracy
public void resetRelativeAccuracy()Deprecated.Reset the relative accuracy to the default. The default value is provided by the algorithm implementation.- Specified by:
resetRelativeAccuracy
in interfaceConvergingAlgorithm
-
resetIterationsCounter
protected void resetIterationsCounter()Deprecated.Reset the iterations counter to 0.- Since:
- 2.2
-
incrementIterationsCounter
Deprecated.Increment the iterations counter by 1.- Throws:
MaxIterationsExceededException
- if the maximal number of iterations is exceeded.- Since:
- 2.2
-