Interpolator1DCubicSplineDataBundle implements Interpolator1DDataBundle, Serializable { public double[][] getSecondDerivativesSensitivities() { if (_secondDerivativesSensitivities == null) { final double[] x = getKeys(); final double[] y = getValues(); final int n = x.length; final double[] deltaX = new double[n - 1]; final double[] deltaYOverDeltaX = new double[n - 1]; final double[] oneOverDeltaX = new double[n - 1]; for (int i = 0; i < n - 1; i++) { deltaX[i] = x[i + 1] - x[i]; oneOverDeltaX[i] = 1.0 / deltaX[i]; deltaYOverDeltaX[i] = (y[i + 1] - y[i]) * oneOverDeltaX[i]; } final DoubleMatrix2D inverseTriDiag = getInverseTridiagonalMatrix(deltaX); final DoubleMatrix2D rhsMatrix = getRHSMatrix(oneOverDeltaX); _secondDerivativesSensitivities = ((DoubleMatrix2D) OG_ALGEBRA.multiply(inverseTriDiag, rhsMatrix)).getData(); } return _secondDerivativesSensitivities; } Interpolator1DCubicSplineDataBundle(final Interpolator1DDataBundle underlyingData);  Interpolator1DCubicSplineDataBundle(final Interpolator1DDataBundle underlyingData, final double leftGrad, final double rightGrad); @Override boolean containsKey(final Double key); @Override Double firstKey(); @Override Double firstValue(); @Override Double get(final Double key); @Override InterpolationBoundedValues getBoundedValues(final Double key); @Override double[] getKeys(); @Override int getLowerBoundIndex(final Double value); @Override Double getLowerBoundKey(final Double value); @Override double[] getValues(); @Override Double higherKey(final Double key); @Override Double higherValue(final Double key); @Override Double lastKey(); @Override Double lastValue(); @Override int size(); double[] getSecondDerivatives(); double[][] getSecondDerivativesSensitivities(); @Override void setYValueAtIndex(final int index, final double y); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void testSecondDerivativesSensitivities() { final double[][] sense = DATA.getSecondDerivativesSensitivities(); final int n = X.length; assertEquals(sense.length, n, 0); assertEquals(sense[0].length, n, 0); for (int i = 0; i < n; i++) { assertEquals(sense[0][i], 0.0, 0.0); assertEquals(sense[n - 1][i], 0.0, 0.0); } }