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.Object
An 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 void
evaluate()
Performs the iterative process.protected abstract double
evaluateIteration()
Evaluate the result of the current iteration.protected abstract void
finalizeIterations()
Perform eventual clean-up operations (must be implement by subclass when needed).double
getDesiredPrecision()
Returns the desired precision.int
getIterations()
Returns the number of iterations performed.int
getMaximumIterations()
Returns the maximum allowed number of iterations.double
getPrecision()
Returns the attained precision.boolean
hasConverged()
Check to see if the result has been attained.protected abstract void
initializeIterations()
Initializes internal parameters to start the iterative process.double
relativePrecision(double epsilon, double x)
void
setDesiredPrecision(double prec)
Defines the desired precision.void
setMaximumIterations(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.
-
-