org.apache.commons.math3.util
Class ContinuedFraction
- java.lang.Object
-
- org.apache.commons.math3.util.ContinuedFraction
-
public abstract class ContinuedFraction extends java.lang.ObjectProvides a generic means to evaluate continued fractions. Subclasses simply provided the a and b coefficients to evaluate the continued fraction.References:
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleevaluate(double x)Evaluates the continued fraction at the value x.doubleevaluate(double x, double epsilon)Evaluates the continued fraction at the value x.doubleevaluate(double x, double epsilon, int maxIterations)Evaluates the continued fraction at the value x.doubleevaluate(double x, int maxIterations)Evaluates the continued fraction at the value x.
-
-
-
Method Detail
-
evaluate
public double evaluate(double x) throws ConvergenceExceptionEvaluates the continued fraction at the value x.- Parameters:
x- the evaluation point.- Returns:
- the value of the continued fraction evaluated at x.
- Throws:
ConvergenceException- if the algorithm fails to converge.
-
evaluate
public double evaluate(double x, double epsilon) throws ConvergenceExceptionEvaluates the continued fraction at the value x.- Parameters:
x- the evaluation point.epsilon- maximum error allowed.- Returns:
- the value of the continued fraction evaluated at x.
- Throws:
ConvergenceException- if the algorithm fails to converge.
-
evaluate
public double evaluate(double x, int maxIterations) throws ConvergenceException, MaxCountExceededExceptionEvaluates the continued fraction at the value x.- Parameters:
x- the evaluation point.maxIterations- maximum number of convergents- Returns:
- the value of the continued fraction evaluated at x.
- Throws:
ConvergenceException- if the algorithm fails to converge.MaxCountExceededException- if maximal number of iterations is reached
-
evaluate
public double evaluate(double x, double epsilon, int maxIterations) throws ConvergenceException, MaxCountExceededExceptionEvaluates the continued fraction at the value x.The implementation of this method is based on the modified Lentz algorithm as described on page 18 ff. in:
- I. J. Thompson, A. R. Barnett. "Coulomb and Bessel Functions of Complex Arguments and Order." http://www.fresco.org.uk/papers/Thompson-JCP64p490.pdf
- Parameters:
x- the evaluation point.epsilon- maximum error allowed.maxIterations- maximum number of convergents- Returns:
- the value of the continued fraction evaluated at x.
- Throws:
ConvergenceException- if the algorithm fails to converge.MaxCountExceededException- if maximal number of iterations is reached
-
-
DMelt 3.0 © DataMelt by jWork.ORG