|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ru.sscc.spline.creator.SmoothingPreparator
The basic class for all spline preparators that use smoothing algorithm. It prepares smoothing weight vector and multiples for matrix calculation and contains common algorithm for selection of the smoothing parameter by residual criterion.
The criterion has the form: xwi-1(fi-s(xi))2 = e2. Here wi are weight coefficients, fi are interpolation values, and s(xi) are smoothing spline values at mesh nodes. In general case, any linear functional may be used instead of spline value in mesh node.
Field Summary | |
protected double |
matrixMultiple
A multiple for interpolating spline matrix |
protected boolean |
solverPrepared
The flag is set true when the solver is prepared. |
int |
sourceSize
A number of interpolating conditions. |
protected double |
weightMultiple
A multiple for smoothing weight vector. |
protected RealVector |
weights
A weight vector (null value means identical unit weights). |
Constructor Summary | |
protected |
SmoothingPreparator(int sourceSize)
Constructor. |
Method Summary | |
abstract double |
calculationCost()
Returns a number of arithmetic operations needed for calculation of spline coefficients. |
java.lang.Object |
clone()
Returns a nonprepared clone of the preparator. |
void |
ensureSolverPrepared()
Ensures that the solver is prepared and throws the IllegalStateException if this is not true. |
static double |
getAccuracy()
Returns the current accuracy value. |
double |
getAlpha()
Returns the current value of the smoothing parameter. |
boolean |
isSolverPrepared()
Returns true if the solver is prepared. |
protected void |
prepareMultiples(double alpha)
Prepares multiples for construction of smoothing spline matrix (useful in prepareSolver methods). |
abstract void |
prepareSolver(double alpha)
An abstract method that prepares a solver for calculations with specified alpha. |
void |
prepareWeights(java.lang.Object weights)
Prepares weights by user's weight vector. |
RealVector |
residual()
Returns a vector to store the residual. |
double |
selectAlpha(RealVector values,
double epsilon,
double alpha,
RealVector data,
RealVector residual)
The smoothing parameter selection algorithm. |
static double |
setAccuracy(double accuracy)
Sets accuracy for solution of residual equation in smoothing parameter selection algorithm and returns the previous accuracy value. |
abstract void |
solve(RealVector values,
RealVector data,
RealVector residual)
An abstract method that calculates spline coefficients and smoothing residual (difference between interpolation data and values of smoothing spline at mesh nodes) by interpolation values. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public final int sourceSize
protected double matrixMultiple
protected double weightMultiple
protected RealVector weights
protected boolean solverPrepared
Constructor Detail |
protected SmoothingPreparator(int sourceSize)
sourceSize
- a number of interpolating conditionsMethod Detail |
public java.lang.Object clone()
public static double setAccuracy(double accuracy)
public static double getAccuracy()
public void prepareWeights(java.lang.Object weights)
weights
- a weight vector (may be the null value or an instance
of double[], float[], RealContainer, or RealVector types)protected void prepareMultiples(double alpha)
public RealVector residual()
public double getAlpha()
public abstract void prepareSolver(double alpha) throws CalculatingException
public final boolean isSolverPrepared()
public final void ensureSolverPrepared()
public abstract void solve(RealVector values, RealVector data, RealVector residual)
values
- interpolation values at mesh nodesdata
- a vector to store spline coefficientsresidual
- a vector to store residual (if it is equal to null,
the residual is not needed)public abstract double calculationCost()
public double selectAlpha(RealVector values, double epsilon, double alpha, RealVector data, RealVector residual) throws CalculatingException
values
- interpolation values at mesh nodesepsilon
- a required residual level (should be > 0)alpha
- a smoothing parameter value to start from (should be > 0)data
- a vector to store spline coefficientsresidual
- a vector to store residual
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |