org.jscience.mathematics.analysis.polynomials
Class DoubleLagrangeBasis

java.lang.Object
  extended by org.jscience.mathematics.analysis.polynomials.DoubleLagrangeBasis
All Implemented Interfaces:
PolynomialBasis
Direct Known Subclasses:
DoubleChebyshevBasis

public class DoubleLagrangeBasis
extends java.lang.Object
implements PolynomialBasis

The Lagrange Basis for real polynomials. For a given set of sampling points {x_1, ..., x_n}, the corresponding lagrange polynomials are L_k = \kronecker_kj \forall j=1..n. The explicit form is

L_k= \prod_{j=0, j\neq k}^n \frac{t-t_j}{t_k-t_j}


Field Summary
protected  int _dim
           
protected  double[] _samplingsX
           
 
Constructor Summary
protected DoubleLagrangeBasis()
           
  DoubleLagrangeBasis(double[] samplings)
          Creates a new DoubleLagrangeBasis object.
  DoubleLagrangeBasis(Field.Member[] samplings)
          Creates a new instance of LagrangeBasis for given sampling points
 
Method Summary
protected  void buildBasis()
           
 int dimension()
          The dimension ( # of sampling points)
 Polynomial getBasisVector(int k)
          The basis vector as described above
 Field.Member[] getSamplingPoints()
          The sampling points used in constructor
 DoublePolynomial superposition(double[] c)
          Same as above, but type-safe
 Polynomial superposition(Field.Member[] coeff)
          Make a superposition of basis- vectors for a given set of coefficients.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_samplingsX

protected double[] _samplingsX

_dim

protected int _dim
Constructor Detail

DoubleLagrangeBasis

public DoubleLagrangeBasis(Field.Member[] samplings)
Creates a new instance of LagrangeBasis for given sampling points


DoubleLagrangeBasis

public DoubleLagrangeBasis(double[] samplings)
Creates a new DoubleLagrangeBasis object.

Parameters:
samplings -

DoubleLagrangeBasis

protected DoubleLagrangeBasis()
Method Detail

getBasisVector

public Polynomial getBasisVector(int k)
The basis vector as described above

Specified by:
getBasisVector in interface PolynomialBasis
Parameters:
k -
Returns:
DOCUMENT ME!

dimension

public int dimension()
The dimension ( # of sampling points)

Specified by:
dimension in interface PolynomialBasis
Returns:
the dimension

getSamplingPoints

public Field.Member[] getSamplingPoints()
The sampling points used in constructor

Specified by:
getSamplingPoints in interface PolynomialBasis
Returns:
the sampling points

superposition

public Polynomial superposition(Field.Member[] coeff)
Make a superposition of basis- vectors for a given set of coefficients. Due to the properties of a lagrange base, the result is the interpolating polynomial with values coeff[k] at sampling point k

Specified by:
superposition in interface PolynomialBasis
Parameters:
coeff - in this case the values of the interpolation problem
Returns:
the interpolating polynomial

superposition

public DoublePolynomial superposition(double[] c)
Same as above, but type-safe


buildBasis

protected void buildBasis()