Class HermiteCoefficientsProvider
- java.lang.Object
- 
- com.opengamma.strata.math.impl.interpolation.HermiteCoefficientsProvider
 
- 
 public class HermiteCoefficientsProvider extends Object Hermite interpolation is determined if one specifies first derivatives for a cubic interpolant and first and second derivatives for a quintic interpolant.
- 
- 
Constructor SummaryConstructors Constructor Description HermiteCoefficientsProvider()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleendpointDerivatives(double ints1, double ints2, double slope1, double slope2)double[]intervalsCalculator(double[] xValues)double[]slopesCalculator(double[] yValues, double[] intervals)double[][]slopeSensitivityCalculator(double[] intervals)Derivative values of slopes_i with respect to yValues_j, s_{ij}.double[][]solve(double[] values, double[] intervals, double[] slopes, double[] first)double[][]solve(double[] values, double[] intervals, double[] slopes, double[] first, double[] second)DoubleMatrix[]solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity)DoubleMatrix[]solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity, DoubleArray[] secondWithSensitivity)
 
- 
- 
- 
Method Detail- 
solvepublic double[][] solve(double[] values, double[] intervals, double[] slopes, double[] first)- Parameters:
- values- (yValues_i)
- intervals- (xValues_{i+1} - xValues_{i})
- slopes- (yValues_{i+1} - yValues_{i})/(xValues_{i+1} - xValues_{i})
- first- First derivatives at xValues_i
- Returns:
- Coefficient matrix whose i-th row vector is { a_n, a_{n-1}, ...} for the i-th interval, where a_n, a_{n-1},... are coefficients of f(x) = a_n (x-x_i)^n + a_{n-1} (x-x_i)^{n-1} + .... with n=3
 
 - 
solveWithSensitivitypublic DoubleMatrix[] solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity) - Parameters:
- values- Y values of data
- intervals- (xValues_{i+1} - xValues_{i})
- slopes- (yValues_{i+1} - yValues_{i})/(xValues_{i+1} - xValues_{i})
- slopeSensitivity- Derivative values of slope with respect to yValues
- firstWithSensitivity- First derivative values at xValues_i and their yValues dependencies
- Returns:
- Coefficient matrix and its node dependencies
 
 - 
solvepublic double[][] solve(double[] values, double[] intervals, double[] slopes, double[] first, double[] second)- Parameters:
- values- (yValues_i)
- intervals- (xValues_{i+1} - xValues_{i})
- slopes- (yValues_{i+1} - yValues_{i})/(xValues_{i+1} - xValues_{i})
- first- First derivatives at xValues_i
- second- Second derivatives at xValues_i
- Returns:
- Coefficient matrix whose i-th row vector is { a_n, a_{n-1}, ...} for the i-th interval, where a_n, a_{n-1},... are coefficients of f(x) = a_n (x-x_i)^n + a_{n-1} (x-x_i)^{n-1} + .... with n=5
 
 - 
solveWithSensitivitypublic DoubleMatrix[] solveWithSensitivity(double[] values, double[] intervals, double[] slopes, double[][] slopeSensitivity, DoubleArray[] firstWithSensitivity, DoubleArray[] secondWithSensitivity) - Parameters:
- values- (yValues_i)
- intervals- (xValues_{i+1} - xValues_{i})
- slopes- (yValues_{i+1} - yValues_{i})/(xValues_{i+1} - xValues_{i})
- slopeSensitivity- Derivative values of slope with respect to yValues
- firstWithSensitivity- First derivative values at xValues_i and their yValues dependencies
- secondWithSensitivity- Second derivative values at xValues_i and their yValues dependencies
- Returns:
- Coefficient matrix and its node dependencies
 
 - 
intervalsCalculatorpublic double[] intervalsCalculator(double[] xValues) - Parameters:
- xValues- The x values
- Returns:
- Intervals of xValues, ( xValues_{i+1} - xValues_i )
 
 - 
slopesCalculatorpublic double[] slopesCalculator(double[] yValues, double[] intervals)- Parameters:
- yValues- Y values of data
- intervals- Intervals of x data
- Returns:
- ( yValues_{i+1} - yValues_i )/( xValues_{i+1} - xValues_i )
 
 - 
slopeSensitivityCalculatorpublic double[][] slopeSensitivityCalculator(double[] intervals) Derivative values of slopes_i with respect to yValues_j, s_{ij}.- Parameters:
- intervals- Intervals of x data
- Returns:
- The matrix s_{ij}
 
 - 
endpointDerivativespublic double endpointDerivatives(double ints1, double ints2, double slope1, double slope2)- Parameters:
- ints1- The first interval
- ints2- The second interval
- slope1- The first gradient
- slope2- The second gradient
- Returns:
- Value of derivative at each endpoint
 
 
- 
 
-