org.jscience.mathematics.analysis.roots
Interface ConvergenceChecker


public interface ConvergenceChecker

This interface specifies methods to check if a root-finding algorithm has converged.

Deciding if convergence has been reached is a problem-dependent issue. The user should provide a class implementing this interface to allow the root-finding algorithm to stop its search according to the problem at hand.


Field Summary
static int HIGH
          Indicator for convergence on the higher bound of the interval.
static int LOW
          Indicator for convergence on the lower bound of the interval.
static int NONE
          Indicator for no convergence.
 
Method Summary
 int converged(double xLow, double fLow, double xHigh, double fHigh)
          Check if the root-finding algorithm has converged on the interval.
 

Field Detail

NONE

static final int NONE
Indicator for no convergence.

See Also:
Constant Field Values

LOW

static final int LOW
Indicator for convergence on the lower bound of the interval.

See Also:
Constant Field Values

HIGH

static final int HIGH
Indicator for convergence on the higher bound of the interval.

See Also:
Constant Field Values
Method Detail

converged

int converged(double xLow,
              double fLow,
              double xHigh,
              double fHigh)
Check if the root-finding algorithm has converged on the interval. The interval defined by the arguments contains one root (if there was at least one in the initial interval given by the user to the root-finding algorithm, of course)

Parameters:
xLow - abscissa of the lower bound of the interval
fLow - value of the function the lower bound of the interval
xHigh - abscissa of the higher bound of the interval
fHigh - value of the function the higher bound of the interval
Returns:
convergence indicator, must be one of NONE, LOW or HIGH