ru.sscc.spline.creator
Class SmoothingSplineCreator

java.lang.Object
  |
  +--ru.sscc.spline.creator.SplineCreator
        |
        +--ru.sscc.spline.creator.SmoothingSplineCreator
Direct Known Subclasses:
GSplineCreator, OddSplineCreator

public abstract class SmoothingSplineCreator
extends SplineCreator

An abstract parent class for all spline creators that support the selection of smoothing parameter with SmoothingPreparator.

See Also:
Serialized Form

Field Summary
protected  SmoothingPreparator preparator
          Smoothing spline preparator instance.
 
Constructor Summary
protected SmoothingSplineCreator()
          Default constructor.
 
Method Summary
abstract  double calculate(RealVector source, RealVector target, double epsilon)
          Finds the smoothing parameter using the residual criterion and calculates spline coefficients.
 java.lang.Object clone()
          Returns nonprepared clone of the creator that shares the constant part of the creator's body with parent instance.
 Spline constructSpline(java.lang.Object source, double epsilon, java.lang.Object weights)
          Constructs a spline in one call using already prepared creator's body.
 Spline constructSpline(RealVector source, double epsilon)
          Finds the smoothing parameter using the residual criterion and constructs the smoothing spline at this parameter.
 double getAlpha()
          Returns the smoothing parameter value.
 SmoothingPreparator getPreparator()
          Returns the preparator used by the creator.
 void prepareSolver(double alpha)
          Prepares the solver for calculation with specified alpha.
 void prepareWeights(java.lang.Object weights)
          Prepares the weight vector.
 int sourceSize()
          Returns a number of interpolation conditions.
 
Methods inherited from class ru.sscc.spline.creator.SplineCreator
attachSplineBody, calculate, calculationCost, 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
 

Field Detail

preparator

protected SmoothingPreparator preparator
Smoothing spline preparator instance.
Constructor Detail

SmoothingSplineCreator

protected SmoothingSplineCreator()
Default constructor.
Method Detail

clone

public java.lang.Object clone()
Returns nonprepared clone of the creator that shares the constant part of the creator's body with parent instance.
Overrides:
clone in class SplineCreator

prepareWeights

public final void prepareWeights(java.lang.Object weights)
Prepares the weight vector.
Parameters:
weights - a weight vector (may be the null value or an instance of double[], float[], RealContainer, or RealVector types).

prepareSolver

public final void prepareSolver(double alpha)
                         throws CalculatingException
Prepares the solver for calculation with specified alpha. The value alpha = Double.POSITIVE_INFINITY is permitted.

calculate

public abstract double calculate(RealVector source,
                                 RealVector target,
                                 double epsilon)
                          throws CalculatingException
Finds the smoothing parameter using the residual criterion and calculates spline coefficients.
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

getAlpha

public final double getAlpha()
Returns the smoothing parameter value.

sourceSize

public final int sourceSize()
Returns a number of interpolation conditions.
Overrides:
sourceSize in class SplineCreator

getPreparator

public final SmoothingPreparator getPreparator()
Returns the preparator used by the creator.

constructSpline

public final Spline constructSpline(RealVector source,
                                    double epsilon)
                             throws CalculatingException
Finds the smoothing parameter using the residual criterion and constructs the smoothing spline at this parameter.
Parameters:
source - interpolation values at mesh nodes
epsilon - a required residual level (should be > 0)
Returns:
the smoothing spline constructed

constructSpline

public Spline constructSpline(java.lang.Object source,
                              double epsilon,
                              java.lang.Object weights)
                       throws CalculatingException
Constructs a spline in one call using already prepared creator's body.
Parameters:
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)