jsci.maths.polynomials
Class RealLagrangeBasis
- java.lang.Object
-
- jsci.maths.polynomials.RealLagrangeBasis
-
- All Implemented Interfaces:
- PolynomialBasis
- Direct Known Subclasses:
- ChebychevBasis
public class RealLagrangeBasis 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}
-
-
Constructor Summary
Constructors Constructor and Description RealLagrangeBasis(double[] samplings)Creates a new RealLagrangeBasis object.RealLagrangeBasis(Field.Member[] samplings)Creates a new instance of LagrangeBasis for given sampling points
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intdimension()The dimension ( # of sampling points)PolynomialgetBasisVector(int k)The basis vector as described aboveField.Member[]getSamplingPoints()The sampling points used in constructorRealPolynomialsuperposition(double[] c)Same as above, but type-safe.Polynomialsuperposition(Field.Member[] coeff)Make a superposition of basis-vectors for a given set of coefficients.
-
-
-
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:
getBasisVectorin interfacePolynomialBasis- Parameters:
k-
-
dimension
public int dimension()
The dimension ( # of sampling points)- Specified by:
dimensionin interfacePolynomialBasis- Returns:
- the dimension
-
getSamplingPoints
public Field.Member[] getSamplingPoints()
The sampling points used in constructor- Specified by:
getSamplingPointsin interfacePolynomialBasis- 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:
superpositionin interfacePolynomialBasis- 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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG