An NDoc Documented Class Library

ContinuedFraction Class

This class provides the means to evaluate continued fractions.

For a list of all members of this type, see ContinuedFraction Members.

System.Object
   numerics4net.IterativeMethod
      numerics4net.continuedfraction.ContinuedFraction

public class ContinuedFraction : IterativeMethod

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

To create a continued fraction (1), authors provide concrete a and b coefficient delegates.

For example, this is the continued fraction for the exponential function defined by (2):

double ExponentialA(int n, double x) {
    if (n == 0) {
        return 1.0;
    } else if (n % 2 == 0) { // even
        return 2.0;
    } else { // odd
        return n;
    }
}

double ExponentialB(int n, double x) {
    if (n % 2 == 0) { // even
        return x;
    } else { // odd
        return -x;
    }
}

ContinuedFraction exponential = new ContinuedFraction(
    new ContinuedFraction.Coefficient(ExponentialA),
    new ContinuedFraction.Coefficient(ExponentialB));

References:

  1. Eric W. Weisstein. "Continued Fraction." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/ContinuedFraction.html
  2. Exponential Function: Continued Fraction Representation. http://functions.wolfram.com/01.03.10.0001.01

Requirements

Namespace: numerics4net.continuedfraction

Assembly: numerics4net-1.2 (in numerics4net-1.2.dll)

See Also

ContinuedFraction Members | numerics4net.continuedfraction Namespace