Package jsl.utilities.math
Class DBHIterativeProcess
- java.lang.Object
-
- jsl.utilities.math.DBHIterativeProcess
-
- Direct Known Subclasses:
ContinuedFraction,FunctionalIterator
public abstract class DBHIterativeProcess extends java.lang.ObjectAn iterative process is a general structure managing iterations. * This is based on the IterativeProcess class of Didier Besset in "Object-Oriented Implementation of Numerical Methods", Morgan-Kaufmann
-
-
Constructor Summary
Constructors Constructor Description DBHIterativeProcess()Generic constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidevaluate()Performs the iterative process.protected abstract doubleevaluateIteration()Evaluate the result of the current iteration.protected abstract voidfinalizeIterations()Perform eventual clean-up operations (must be implement by subclass when needed).doublegetDesiredPrecision()Returns the desired precision.intgetIterations()Returns the number of iterations performed.intgetMaximumIterations()Returns the maximum allowed number of iterations.doublegetPrecision()Returns the attained precision.booleanhasConverged()Check to see if the result has been attained.protected abstract voidinitializeIterations()Initializes internal parameters to start the iterative process.doublerelativePrecision(double epsilon, double x)voidsetDesiredPrecision(double prec)Defines the desired precision.voidsetMaximumIterations(int maxIter)Defines the maximum allowed number of iterations.
-
-
-
Method Detail
-
evaluate
public void evaluate()
Performs the iterative process. Note: this method does not return anything Subclass must implement a method to get the result
-
evaluateIteration
protected abstract double evaluateIteration()
Evaluate the result of the current iteration.- Returns:
- the estimated precision of the result.
-
finalizeIterations
protected abstract void finalizeIterations()
Perform eventual clean-up operations (must be implement by subclass when needed).
-
initializeIterations
protected abstract void initializeIterations()
Initializes internal parameters to start the iterative process.
-
getDesiredPrecision
public double getDesiredPrecision()
Returns the desired precision.
-
getIterations
public int getIterations()
Returns the number of iterations performed.
-
getMaximumIterations
public int getMaximumIterations()
Returns the maximum allowed number of iterations.
-
getPrecision
public double getPrecision()
Returns the attained precision.
-
hasConverged
public boolean hasConverged()
Check to see if the result has been attained.- Returns:
- boolean
-
relativePrecision
public double relativePrecision(double epsilon, double x)- Parameters:
epsilon- doublex- double- Returns:
- double
-
setDesiredPrecision
public void setDesiredPrecision(double prec)
Defines the desired precision.
-
setMaximumIterations
public void setMaximumIterations(int maxIter)
Defines the maximum allowed number of iterations.
-
-