jsci.maths.polynomials
Class RealLagrangeBasis

java.lang.Object
  extended by jsci.maths.polynomials.RealLagrangeBasis
All Implemented Interfaces:
PolynomialBasis
Direct Known Subclasses:
ChebychevBasis

public class RealLagrangeBasis
extends 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}


Constructor Summary
RealLagrangeBasis(double[] samplings)
          Creates a new RealLagrangeBasis object.
RealLagrangeBasis(Field.Member[] samplings)
          Creates a new instance of LagrangeBasis for given sampling points
 
Method Summary
 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
 RealPolynomial 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealLagrangeBasis

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


RealLagrangeBasis

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

Parameters:
samplings -
Method Detail

getBasisVector

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

Specified by:
getBasisVector in interface PolynomialBasis
Parameters:
k -

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 RealPolynomial superposition(double[] c)
Same as above, but type-safe.



jHepWork 3.1 ©