PCHIPInterpolator1D extends Interpolator1D { @Override public Interpolator1DDataBundle getDataBundle(final double[] x, final double[] y) { return new Interpolator1DPiecewisePoynomialDataBundle(new ArrayInterpolator1DDataBundle(x, y, true), new PiecewiseCubicHermiteSplineInterpolatorWithSensitivity()); }  @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 testDataBundleType1() { assertEquals(INTERPOLATOR.getDataBundle(X_DATA, Y_DATA).getClass(), Interpolator1DPiecewisePoynomialDataBundle.class); }
@Test public void dataBundleTest() { Interpolator1DDataBundle db = INTERPOLATOR.getDataBundle(X_DATA, Y_DATA); double[] keys = db.getKeys(); double[] values = db.getValues(); final int n = X_DATA.length; assertEquals("keys length", n, keys.length); assertEquals("values length", n, values.length); for (int i = 0; i < n; i++) { assertEquals("keys " + i, X_DATA[i], keys[i]); assertEquals("values " + i, Y_DATA[i], values[i]); } }