ru.sscc.spline.analytic
Class GSplineCreator

java.lang.Object
  |
  +--ru.sscc.spline.creator.SplineCreator
        |
        +--ru.sscc.spline.creator.SmoothingSplineCreator
              |
              +--ru.sscc.spline.analytic.GSplineCreator

public class GSplineCreator
extends SmoothingSplineCreator

This creator is intended for construction of multivariate Duchon's splines. The Duchon's spline is constructed with the help of a radual basic function and a polynomial kernel. The radial basic function smoothness determines the spline smoothness, and the degree of the polynomial kernel specifies the spline behaviour at the infinity and the set of polynomials for which the spline interpolation is strict. Both these parameters (smoothness and polynomial degree) are joint to so-called spline mode. We construct the Duchon's spline for 4 different spline modes described by an integer in the range [0..3]:

mode=0 -- the pseudo-linear radial basic function and the polynomial kernel of the 0th degree are used. We call this spline as the pseudo-linear spline with constant kernel. This spline tends to a constant along any ray.

mode=1 -- the pseudo-linear radial basic function and the polynomial kernel of the 1st degree are used. We call this spline as the pseudo-linear spline with linear kernel. This spline tends to a linear function along any ray.

mode=2 -- the pseudo-quadratic radial basic function and the polynomial kernel of the 1st degree are used. We call this spline as the pseudo-quadratic spline with linear kernel. This spline tends to a linear function along any ray.

mode=3 -- the pseudo-cubic radial basic function and the polynomial kernel of the 1st degree are used. We call this spline as the pseudo-cubic spline with linear kernel. This spline tends to a linear function along any ray.

See Also:
Serialized Form

Fields inherited from class ru.sscc.spline.creator.SmoothingSplineCreator
preparator
 
Constructor Summary
GSplineCreator()
          Default constructor.
GSplineCreator(int mode, RealVectors meshNodes)
          Constructor for the case of initial mesh.
GSplineCreator(int mode, ReducedMesh mesh)
          Constructor for the case of already reduced mesh.
 
Method Summary
 void calculate(RealVector source, RealVector target)
          Calculates spline coefficients.
 double calculate(RealVector source, RealVector target, double epsilon)
          Finds the smoothing parameter using the residual criterion and calculates spline coefficients.
 double calculationCost()
          Returns a number of operations needed for a calculation of one spline coefficients vector.
 Spline constructSpline(int mode, java.lang.Object mesh, java.lang.Object source, double epsilon, java.lang.Object weights)
          Constructs Duchon's spline in one call.
static Spline createSpline(int mode, java.lang.Object mesh, java.lang.Object source)
          Creates interpolating Duchon's spline.
static Spline createSpline(int mode, java.lang.Object mesh, java.lang.Object source, double epsilon)
          Creates Duchon's spline using unweighted residual criterion.
static Spline createSpline(int mode, java.lang.Object mesh, java.lang.Object source, double epsilon, java.lang.Object weights)
          Creates Duchon's spline using weighted residual criterion.
 double getReductionAccuracy()
          Returns the reduction accuracy level.
 void prepareCreatorBody(int mode, ReducedMesh mesh)
          Prepares the creator body.
 void setReductionAccuracy(double accuracy)
          Sets the reduction accuracy level affecting on making the decision ether the mesh is degenerate or not.
 
Methods inherited from class ru.sscc.spline.creator.SmoothingSplineCreator
clone, constructSpline, constructSpline, getAlpha, getPreparator, prepareSolver, prepareWeights, sourceSize
 
Methods inherited from class ru.sscc.spline.creator.SplineCreator
attachSplineBody, constructSpline, constructSplinesByColumns, constructSplinesByRows, ensurePrepared, getSplineBody, isPrepared, setPrepared, targetSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GSplineCreator

public GSplineCreator()
Default constructor.

GSplineCreator

public GSplineCreator(int mode,
                      RealVectors meshNodes)
Constructor for the case of initial mesh.
Parameters:
mode - spline mode (in 0..3)
meshNodes - vector of mesh nodes

GSplineCreator

public GSplineCreator(int mode,
                      ReducedMesh mesh)
Constructor for the case of already reduced mesh.
Parameters:
mode - spline mode (in 0..3)
mesh - a mesh
Method Detail

prepareCreatorBody

public void prepareCreatorBody(int mode,
                               ReducedMesh mesh)
Prepares the creator body.
Parameters:
mode - spline mode (in 0..3)
mesh - a mesh

setReductionAccuracy

public final void setReductionAccuracy(double accuracy)
Sets the reduction accuracy level affecting on making the decision ether the mesh is degenerate or not.

getReductionAccuracy

public final double getReductionAccuracy()
Returns the reduction accuracy level.

calculate

public void calculate(RealVector source,
                      RealVector target)
Calculates spline coefficients.
Overrides:
calculate in class SplineCreator
Parameters:
source - interpolation values at mesh nodes
target - a vector to storage spline coefficients

calculate

public double calculate(RealVector source,
                        RealVector target,
                        double epsilon)
                 throws CalculatingException
Finds the smoothing parameter using the residual criterion and calculates spline coefficients.
Overrides:
calculate in class SmoothingSplineCreator
Parameters:
source - interpolation values at mesh nodes
target - a vector to store spline coefficients
epsilon - a required residual level (should be > 0)
Returns:
the smoothing parameter found

calculationCost

public double calculationCost()
Returns a number of operations needed for a calculation of one spline coefficients vector.
Overrides:
calculationCost in class SplineCreator

constructSpline

public Spline constructSpline(int mode,
                              java.lang.Object mesh,
                              java.lang.Object source,
                              double epsilon,
                              java.lang.Object weights)
                       throws CalculatingException
Constructs Duchon's spline in one call.
Parameters:
mode - spline mode (in 0..3)
mesh - a mesh (an instance of RealVectors or ReducedMesh types)
source - interpolation values at mesh nodes (an instance of double[], float[], RealContainer, or RealVector types)
epsilon - a residual criterion value. If epsilon<=0, the interpolation is performed
weights - a weights vector (may be the null value or an instance of double[], float[], RealContainer, or RealVector types)

createSpline

public static final Spline createSpline(int mode,
                                        java.lang.Object mesh,
                                        java.lang.Object source,
                                        double epsilon,
                                        java.lang.Object weights)
                                 throws CalculatingException
Creates Duchon's spline using weighted residual criterion.
Parameters:
mode - spline mode (in 0..3)
mesh - a mesh (an instance of RealVectors or ReducedMesh types)
source - interpolation values at mesh nodes (an instance of double[], float[], RealContainer, or RealVector types)
epsilon - a residual criterion value. If epsilon<=0, the interpolation is performed
weights - a weights vector (may be the null value or an instance of double[], float[], RealContainer, or RealVector types)

createSpline

public static final Spline createSpline(int mode,
                                        java.lang.Object mesh,
                                        java.lang.Object source,
                                        double epsilon)
                                 throws CalculatingException
Creates Duchon's spline using unweighted residual criterion.
Parameters:
mode - spline mode (in 0..3)
mesh - a mesh (an instance of RealVectors or ReducedMesh types)
source - interpolation values at mesh nodes (an instance of double[], float[], RealContainer, or RealVector types)
epsilon - a residual criterion value. If epsilon<=0, the interpolation is performed

createSpline

public static final Spline createSpline(int mode,
                                        java.lang.Object mesh,
                                        java.lang.Object source)
                                 throws CalculatingException
Creates interpolating Duchon's spline.
Parameters:
mode - spline mode (in 0..3)
mesh - a mesh (an instance of RealVectors or ReducedMesh types)
source - interpolation values at mesh nodes (an instance of double[], float[], RealContainer, or RealVector types)