Class 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 Detail

      • DBHIterativeProcess

        public DBHIterativeProcess()
        Generic constructor.
    • 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 - double
        x - 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.