public class CubicSplineClampedSolver extends Object
| Constructor and Description |
|---|
CubicSplineClampedSolver(double[] iniConds,
double[] finConds)
Constructor for a multi-dimensional problem.
|
CubicSplineClampedSolver(double iniCond,
double finCond)
Constructor for a one-dimensional problem.
|
| Modifier and Type | Method and Description |
|---|---|
protected DoubleArray[] |
combinedMatrixEqnSolver(double[][] doubMat1,
double[] doubVec,
double[][] doubMat2)
Cubic spline and its node sensitivity are respectively obtained by solving a linear problem Ax=b
where A is a square matrix and x,b are vector and AN=L where N,L are matrices
|
protected DoubleMatrix[] |
getCommonCoefficientWithSensitivity(double[] xValues,
double[] yValues,
double[] intervals,
double[][] toBeInv,
double[] commonVector,
double[][] commonVecSensitivity)
Cubic spline and its node sensitivity are respectively obtained by solving a linear problem Ax=b
where A is a square matrix and x,b are vector and AN=L where N,L are matrices
|
protected double[][] |
getCommonMatrixElements(double[] intervals)
Cubic spline is obtained by solving a linear problem Ax=b where A is a square matrix and x,b are vector
|
protected DoubleMatrix[] |
getCommonSensitivityCoeffs(double[] intervals,
double[][] solnMatrix) |
protected DoubleMatrix |
getCommonSplineCoeffs(double[] xValues,
double[] yValues,
double[] intervals,
double[] solnVector) |
protected double[] |
getCommonVectorElements(double[] yValues,
double[] intervals)
Cubic spline is obtained by solving a linear problem Ax=b where A is a square matrix and x,b are vector
|
protected double[][] |
getCommonVectorSensitivity(double[] intervals)
Node sensitivity is obtained by solving a linear problem AN = L where A,N,L are matrices
|
protected double[] |
getDiffs(double[] xValues) |
DoubleArray |
getKnotsMat1D(double[] xValues) |
protected double[] |
matrixEqnSolver(double[][] doubMat,
double[] doubVec)
Cubic spline is obtained by solving a linear problem Ax=b where A is a square matrix and x,b are vector
This can be done by LU decomposition
|
DoubleMatrix |
solve(double[] xValues,
double[] yValues)
One-dimensional cubic spline
If (xValues length) = (yValues length), Not-A-Knot endpoint conditions are used
If (xValues length) + 2 = (yValues length), Clamped endpoint conditions are used
|
DoubleMatrix[] |
solveMultiDim(double[] xValues,
DoubleMatrix yValuesMatrix)
Multi-dimensional cubic spline
If (xValues length) = (yValuesMatrix NumberOfColumn), Not-A-Knot endpoint conditions are used
If (xValues length) + 2 = (yValuesMatrix NumberOfColumn), Clamped endpoint conditions are used
|
DoubleMatrix[] |
solveWithSensitivity(double[] xValues,
double[] yValues)
One-dimensional cubic spline
If (xValues length) = (yValues length), Not-A-Knot endpoint conditions are used
If (xValues length) + 2 = (yValues length), Clamped endpoint conditions are used
|
public CubicSplineClampedSolver(double iniCond,
double finCond)
iniCond - Left endpoint conditionfinCond - Right endpoint conditionpublic CubicSplineClampedSolver(double[] iniConds,
double[] finConds)
iniConds - Set of left endpoint conditionsfinConds - Set of right endpoint conditionspublic DoubleMatrix solve(double[] xValues, double[] yValues)
xValues - X values of datayValues - Y values of datapublic DoubleMatrix[] solveWithSensitivity(double[] xValues, double[] yValues)
xValues - X values of datayValues - Y values of datapublic DoubleMatrix[] solveMultiDim(double[] xValues, DoubleMatrix yValuesMatrix)
xValues - X values of datayValuesMatrix - Y values of data, where NumberOfRow defines dimension of the splinepublic DoubleArray getKnotsMat1D(double[] xValues)
xValues - X values of dataprotected double[] getDiffs(double[] xValues)
xValues - X values of Dataprotected DoubleMatrix getCommonSplineCoeffs(double[] xValues, double[] yValues, double[] intervals, double[] solnVector)
xValues - X values of DatayValues - Y values of Dataintervals - {xValues[1]-xValues[0], xValues[2]-xValues[1],...}solnVector - Values of second derivative at knotsprotected DoubleMatrix[] getCommonSensitivityCoeffs(double[] intervals, double[][] solnMatrix)
intervals - {xValues[1]-xValues[0], xValues[2]-xValues[1],...}solnMatrix - Sensitivity of second derivatives (x 0.5)protected DoubleMatrix[] getCommonCoefficientWithSensitivity(double[] xValues, double[] yValues, double[] intervals, double[][] toBeInv, double[] commonVector, double[][] commonVecSensitivity)
xValues - X values of datayValues - Y values of dataintervals - {xValues[1]-xValues[0], xValues[2]-xValues[1],...}toBeInv - The matrix AcommonVector - The vector bcommonVecSensitivity - The matrix Lprotected double[][] getCommonMatrixElements(double[] intervals)
intervals - the intervalsprotected double[] getCommonVectorElements(double[] yValues,
double[] intervals)
yValues - Y values of Dataintervals - {xValues[1]-xValues[0], xValues[2]-xValues[1],...}protected double[][] getCommonVectorSensitivity(double[] intervals)
intervals - {xValues[1]-xValues[0], xValues[2]-xValues[1],...}protected double[] matrixEqnSolver(double[][] doubMat,
double[] doubVec)
doubMat - Matrix AdoubVec - Vector Bprotected DoubleArray[] combinedMatrixEqnSolver(double[][] doubMat1, double[] doubVec, double[][] doubMat2)
doubMat1 - The matrix AdoubVec - The vector bdoubMat2 - The matrix LCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.