vec_math
Class Legendre

java.lang.Object
  extended by vec_math.RecursivePolynom
      extended by vec_math.Legendre
All Implemented Interfaces:
Derivative, Function

public class Legendre
extends RecursivePolynom
implements Derivative

The recursive formular for the Legendre polynomials. Start the recursion with i=0.


Nested Class Summary
static class Legendre.Calc
           
static class Legendre.Print
           
 
Nested classes/interfaces inherited from class vec_math.RecursivePolynom
RecursivePolynom.Constant, RecursivePolynom.Linear
 
Constructor Summary
Legendre(double[] c, double min, double max)
          The coefficients of the Legendre polynomial must at least suffice for a linear relation.
 
Method Summary
 double derivative(double x)
          The first derivative of the Legendre polynomial with order n is defined as: (1-x&pow2;)P'_n(x)=(n+1)*x*P_n(x)-(n+1)*P_n+1(x)
static Derivative ofOrder(int n)
          Returns the function that is the sole Legendre polynomial of the given order.
protected  double recursion(int o, double norm, double xm1, double xm2)
          The recursion for the Legendre polynomials is
 
Methods inherited from class vec_math.RecursivePolynom
evaluate, getCoefficient, getOrder, normalize, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface vec_math.Function
evaluate
 

Constructor Detail

Legendre

public Legendre(double[] c,
                double min,
                double max)
The coefficients of the Legendre polynomial must at least suffice for a linear relation. The min and max define the range of allowed parameter space.

Method Detail

recursion

protected double recursion(int o,
                           double norm,
                           double xm1,
                           double xm2)
The recursion for the Legendre polynomials is
 x_i = 1/i*((2i-1)*norm*x_i-1-(i-1)*x_i-2), i >= 2
 

Specified by:
recursion in class RecursivePolynom

derivative

public double derivative(double x)
The first derivative of the Legendre polynomial with order n is defined as: (1-x&pow2;)P'_n(x)=(n+1)*x*P_n(x)-(n+1)*P_n+1(x)

Specified by:
derivative in interface Derivative

ofOrder

public static Derivative ofOrder(int n)
Returns the function that is the sole Legendre polynomial of the given order.