Class 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 Detail

      • HermiteCoefficientsProvider

        public HermiteCoefficientsProvider()
    • Method Detail

      • solve

        public 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
      • solveWithSensitivity

        public 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
      • solve

        public 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
      • solveWithSensitivity

        public 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
      • intervalsCalculator

        public double[] intervalsCalculator​(double[] xValues)
        Parameters:
        xValues - The x values
        Returns:
        Intervals of xValues, ( xValues_{i+1} - xValues_i )
      • slopesCalculator

        public 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 )
      • slopeSensitivityCalculator

        public 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}
      • endpointDerivatives

        public 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