ru.sscc.spline.analytic
Class GSplineBody

java.lang.Object
  |
  +--ru.sscc.spline.analytic.GSplineBody

public class GSplineBody
extends java.lang.Object
implements SplineBody

The implementation of spline body interface supporting the calculation of spline value for Duchon's spline. A partial derivative calculation is not possible.

See Also:
Serialized Form

Field Summary
protected  int dataSize
          The size of coefficients vector.
protected  ReducedMesh mesh
          The mesh.
protected  byte mode
          The spline mode (0, 1, 2, or 3).
 
Fields inherited from interface ru.sscc.spline.SplineBody
DERIVATIVE_OUT_OF_RANGE, ONE_D_NONSUPPORTED, POINT_OUT_OF_RANGE
 
Constructor Summary
GSplineBody(int mode, ReducedMesh mesh)
          Constructor.
 
Method Summary
 double calculate(SplineWorkspace workspace)
          Calculates a spline value at a required point by the formula : s(s)= SliG(s,ti)+ Smasa.
 SplineWorkspace createWorkspace(RealPointer data)
          Creates a workspace required for a Green spline value calculation.
 int dimension()
          Return the mesh dimension.
 int getVectorLength()
          Return the coefficients vector size.
 int maxQuote()
          Return the coefficients vector size because all coefficients are always needed in spline value calculation.
 void prepareBase(RealPointer x, RealPointer vector)
          Calculates the vector of spline base values at a point x.
 void prepareWorkspace(SplineWorkspace workspace, double point, int index, int count)
          Prepares a workspace for a Green spline value calculation in 1D case.
 void prepareWorkspace(SplineWorkspace workspace, RealPointer point, int count)
          Prepares a workspace for a spline value calculation: calculates the vector of spline base values at the reduced point and puts coordinates of reduced point into workspace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mesh

protected ReducedMesh mesh
The mesh.

dataSize

protected int dataSize
The size of coefficients vector.

mode

protected byte mode
The spline mode (0, 1, 2, or 3).
Constructor Detail

GSplineBody

public GSplineBody(int mode,
                   ReducedMesh mesh)
Constructor.
Parameters:
mode - a spline mode from the range 0..3: 0 means pseudo-linear spline with constant polynomial kernel; 1, 2, and 3 mean pseudo-linear, pseudo-quadratic, and pseudo-cubic spline respectively with linear polynomial kernel
mesh - a mesh
Method Detail

createWorkspace

public SplineWorkspace createWorkspace(RealPointer data)
Creates a workspace required for a Green spline value calculation. The workspace contains the vector of spline base values at the point, a reduced point to calculate the spline, and the coefficients vector.
Specified by:
createWorkspace in interface SplineBody
Parameters:
data - a pointer to coefficients vector

dimension

public int dimension()
Return the mesh dimension.
Specified by:
dimension in interface SplineBody

getVectorLength

public int getVectorLength()
Return the coefficients vector size.
Specified by:
getVectorLength in interface SplineBody

maxQuote

public int maxQuote()
Return the coefficients vector size because all coefficients are always needed in spline value calculation.
Specified by:
maxQuote in interface SplineBody

prepareWorkspace

public void prepareWorkspace(SplineWorkspace workspace,
                             double point,
                             int index,
                             int count)
Prepares a workspace for a Green spline value calculation in 1D case.
Specified by:
prepareWorkspace in interface SplineBody
Parameters:
workspace - a spline workspace
point - a point on the real axis
index - must be 0
count - don't use in analitic case

prepareWorkspace

public void prepareWorkspace(SplineWorkspace workspace,
                             RealPointer point,
                             int count)
Prepares a workspace for a spline value calculation: calculates the vector of spline base values at the reduced point and puts coordinates of reduced point into workspace.
Specified by:
prepareWorkspace in interface SplineBody
Parameters:
workspace - a spline workspace
point - a point in the space of independent variables
count - a number of splines will be calculated later

calculate

public double calculate(SplineWorkspace workspace)
Calculates a spline value at a required point by the formula : s(s)= SliG(s,ti)+ Smasa. All information on the point should be prepared before by one of prepareWorkspace methods.
Specified by:
calculate in interface SplineBody
Parameters:
workspace - a spline workspace
Returns:
the spline value

prepareBase

public void prepareBase(RealPointer x,
                        RealPointer vector)
Calculates the vector of spline base values at a point x.
Parameters:
x - a point in reduced coordinates
vector - a vector to store results