ru.sscc.spline.polynomial
Class PSplineCalculator

java.lang.Object
  |
  +--ru.sscc.spline.polynomial.PSplineCalculator

public class PSplineCalculator
extends java.lang.Object
implements java.io.Serializable

The calculator of the polynomial representation for 1D spline. Calculates the representation from the values of spline at mesh nodes and the coefficients of B-spline representation for m-th derivative.

See Also:
Serialized Form

Field Summary
protected  PSplineBody body
          The body of spline (mesh and spline degrees are used).
protected  RectBandedMatrix h
          The matrix needed for the calculation of upper derivatives.
 
Constructor Summary
PSplineCalculator(PSplineBody body, RectBandedMatrix h)
          Constructor.
 
Method Summary
protected  void calcDFg(RealVector lambda, RealVector target)
          Calculates upper derivatives of spline representation.
protected  void calcDFl(RealVector f, RealVector target)
          Calculates lower derivatives of spline representation.
 void calculate(RealVector lambda, RealVector f, RealVector target)
          Calculates the polynomial representation of a polynomial spline at mesh nodes.
 double calculationCost()
          Returns a number of arithmetic operations needed for calculation of a spline representation.
static void recalculate(double[] p, double[] q, double point, int size, int count)
          Recalculates teilor representation of a polynomial relative to a required point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

h

protected RectBandedMatrix h
The matrix needed for the calculation of upper derivatives.

body

protected PSplineBody body
The body of spline (mesh and spline degrees are used).
Constructor Detail

PSplineCalculator

public PSplineCalculator(PSplineBody body,
                         RectBandedMatrix h)
Constructor.
Parameters:
body - polynomial spline body
h - matrix of finite differences
Method Detail

calculationCost

public double calculationCost()
Returns a number of arithmetic operations needed for calculation of a spline representation.

calculate

public void calculate(RealVector lambda,
                      RealVector f,
                      RealVector target)
Calculates the polynomial representation of a polynomial spline at mesh nodes.
Parameters:
lambda - B-spline representation coefficients for m-th derivative of spline
f - spline values at mesh nodes
target - a vector to store the result

calcDFg

protected void calcDFg(RealVector lambda,
                       RealVector target)
Calculates upper derivatives of spline representation.
Parameters:
lambda - B-spline representation coefficients for m-th derivative of spline
target - a vector to store the result as teilor representaion

calcDFl

protected void calcDFl(RealVector f,
                       RealVector target)
Calculates lower derivatives of spline representation.
Parameters:
f - spline values at mesh nodes
target - a vector to store the result as teilor representaion

recalculate

public static void recalculate(double[] p,
                               double[] q,
                               double point,
                               int size,
                               int count)
Recalculates teilor representation of a polynomial relative to a required point.
Parameters:
p - teilor representation coefficients in increasing order
q - a vector to store the result
point - a point to recalculate the representation in
size - a number of teilor coefficients in p (polynomial degree + 1)
count - a number of teilor coefficients to calculate