| java.lang.Object org.apache.commons.math.util.ContinuedFraction
ContinuedFraction | abstract public class ContinuedFraction implements Serializable(Code) | | Provides a generic means to evaluate continued fractions. Subclasses simply
provided the a and b coefficients to evaluate the continued fraction.
References:
version: $Revision: 348888 $ $Date: 2005-11-24 23:21:25 -0700 (Thu, 24 Nov 2005) $ |
Method Summary | |
public double | evaluate(double x) Evaluates the continued fraction at the value x.
Parameters: x - the evaluation point. | public double | evaluate(double x, double epsilon) Evaluates the continued fraction at the value x.
Parameters: x - the evaluation point. Parameters: epsilon - maximum error allowed. | public double | evaluate(double x, int maxIterations) Evaluates the continued fraction at the value x.
Parameters: x - the evaluation point. Parameters: maxIterations - maximum number of convergents the value of the continued fraction evaluated at x. | public double | evaluate(double x, double epsilon, int maxIterations)
Evaluates the continued fraction at the value x.
The implementation of this method is based on equations 14-17 of:
| abstract protected double | getA(int n, double x) Access the n-th a coefficient of the continued fraction. | abstract protected double | getB(int n, double x) Access the n-th b coefficient of the continued fraction. |
ContinuedFraction | protected ContinuedFraction()(Code) | | Default constructor.
|
evaluate | public double evaluate(double x) throws MathException(Code) | | Evaluates the continued fraction at the value x.
Parameters: x - the evaluation point. the value of the continued fraction evaluated at x. throws: MathException - if the algorithm fails to converge. |
evaluate | public double evaluate(double x, double epsilon) throws MathException(Code) | | Evaluates the continued fraction at the value x.
Parameters: x - the evaluation point. Parameters: epsilon - maximum error allowed. the value of the continued fraction evaluated at x. throws: MathException - if the algorithm fails to converge. |
evaluate | public double evaluate(double x, int maxIterations) throws MathException(Code) | | Evaluates the continued fraction at the value x.
Parameters: x - the evaluation point. Parameters: maxIterations - maximum number of convergents the value of the continued fraction evaluated at x. throws: MathException - if the algorithm fails to converge. |
evaluate | public double evaluate(double x, double epsilon, int maxIterations) throws MathException(Code) | |
Evaluates the continued fraction at the value x.
The implementation of this method is based on equations 14-17 of:
The recurrence relationship defined in those equations can result in
very large intermediate results which can result in numerical overflow.
As a means to combat these overflow conditions, the intermediate results
are scaled whenever they threaten to become numerically unstable.
Parameters: x - the evaluation point. Parameters: epsilon - maximum error allowed. Parameters: maxIterations - maximum number of convergents the value of the continued fraction evaluated at x. throws: MathException - if the algorithm fails to converge. |
getA | abstract protected double getA(int n, double x)(Code) | | Access the n-th a coefficient of the continued fraction. Since a can be
a function of the evaluation point, x, that is passed in as well.
Parameters: n - the coefficient index to retrieve. Parameters: x - the evaluation point. the n-th a coefficient. |
getB | abstract protected double getB(int n, double x)(Code) | | Access the n-th b coefficient of the continued fraction. Since b can be
a function of the evaluation point, x, that is passed in as well.
Parameters: n - the coefficient index to retrieve. Parameters: x - the evaluation point. the n-th b coefficient. |
|
|