TransformedInterpolator1D extends Interpolator1D { @Override public double[] getNodeSensitivitiesForValue(final Interpolator1DDataBundle data, final Double value) { final double yStar = _base.interpolate(data, value); final double grad = _transform.inverseTransformGradient(yStar); final double[] temp = _base.getNodeSensitivitiesForValue(data, value); final int n = temp.length; for (int i = 0; i < n; i++) { temp[i] *= grad; } return temp; } TransformedInterpolator1D(final Interpolator1D baseInterpolator, final ParameterLimitsTransform transform); @Override Double interpolate(final Interpolator1DDataBundle data, final Double value); @Override double firstDerivative(final Interpolator1DDataBundle data, final Double value); @Override double[] getNodeSensitivitiesForValue(final Interpolator1DDataBundle data, final Double value); @Override Interpolator1DDataBundle getDataBundle(final double[] x, final double[] y); @Override Interpolator1DDataBundle getDataBundleFromSortedArrays(final double[] x, final double[] y);  }
@Test public void testSensitivity() { for (int i = 0; i < 20; i++) { double x = 5.0 * i / 19.0; double[] fdSense = INTERPOLATOR.getFiniteDifferenceSensitivities(TRANS_DATA_BUNDLE, x); double[] analSense = INTERPOLATOR.getNodeSensitivitiesForValue(TRANS_DATA_BUNDLE, x); for (int j = 0; j < fdSense.length; j++) { assertEquals(analSense[j], fdSense[j], 1e-8); } } }