|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.util.ContinuedFraction
public abstract class ContinuedFraction
Provides a generic means to evaluate continued fractions. Subclasses simply provided the a and b coefficients to evaluate the continued fraction.
References:
Field Summary | |
---|---|
private static double |
DEFAULT_EPSILON
Maximum allowed numerical error. |
Constructor Summary | |
---|---|
protected |
ContinuedFraction()
Default constructor. |
Method Summary | |
---|---|
double |
evaluate(double x)
Evaluates the continued fraction at the value x. |
double |
evaluate(double x,
double epsilon)
Evaluates the continued fraction at the value x. |
double |
evaluate(double x,
double epsilon,
int maxIterations)
Evaluates the continued fraction at the value x. |
double |
evaluate(double x,
int maxIterations)
Evaluates the continued fraction at the value x. |
protected abstract double |
getA(int n,
double x)
Access the n-th a coefficient of the continued fraction. |
protected abstract double |
getB(int n,
double x)
Access the n-th b coefficient of the continued fraction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final double DEFAULT_EPSILON
Constructor Detail |
---|
protected ContinuedFraction()
Method Detail |
---|
protected abstract double getA(int n, double x)
n
- the coefficient index to retrieve.x
- the evaluation point.
protected abstract double getB(int n, double x)
n
- the coefficient index to retrieve.x
- the evaluation point.
public double evaluate(double x) throws ConvergenceException
x
- the evaluation point.
ConvergenceException
- if the algorithm fails to converge.public double evaluate(double x, double epsilon) throws ConvergenceException
x
- the evaluation point.epsilon
- maximum error allowed.
ConvergenceException
- if the algorithm fails to converge.public double evaluate(double x, int maxIterations) throws ConvergenceException, MaxCountExceededException
x
- the evaluation point.maxIterations
- maximum number of convergents
ConvergenceException
- if the algorithm fails to converge.
MaxCountExceededException
- if maximal number of iterations is reachedpublic double evaluate(double x, double epsilon, int maxIterations) throws ConvergenceException, MaxCountExceededException
The implementation of this method is based on the modified Lentz algorithm as described on page 18 ff. in:
x
- the evaluation point.epsilon
- maximum error allowed.maxIterations
- maximum number of convergents
ConvergenceException
- if the algorithm fails to converge.
MaxCountExceededException
- if maximal number of iterations is reached
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |