### Question:
PiecewiseCubicHermiteMonotonicityCurveInterpolator implements CurveInterpolator, Serializable { @Override public BoundCurveInterpolator bind(DoubleArray xValues, DoubleArray yValues) { return new Bound(xValues, yValues); } private  PiecewiseCubicHermiteMonotonicityCurveInterpolator(); @Override String getName(); @Override BoundCurveInterpolator bind(DoubleArray xValues, DoubleArray yValues); @Override String toString(); static final String NAME; static final PiecewiseCubicHermiteMonotonicityCurveInterpolator INSTANCE; }### Answer:
@Test public void baseInterpolationTest() { int nExamples = Y.length; int n = XX.length; for (int example = 0; example < nExamples; example++) { PiecewisePolynomialResult pp = BASE.interpolate(X, Y[example]); BoundCurveInterpolator bound = PCHIP.bind( DoubleArray.ofUnsafe(X), DoubleArray.ofUnsafe(Y[example]), INTERPOLATOR, INTERPOLATOR); for (int i = 0; i < n; i++) { double computedValue = bound.interpolate(XX[i]); double expectedValue = PPVAL.evaluate(pp, XX[i]).get(0); assertThat(computedValue).isCloseTo(expectedValue, offset(1e-14)); double computedDerivative = bound.firstDerivative(XX[i]); double expectedDerivative = PPVAL.differentiate(pp, XX[i]).get(0); assertThat(computedDerivative).isCloseTo(expectedDerivative, offset(1e-14)); } } }
@Test public void sensitivityTest() { int nExamples = Y.length; int n = XX.length; int nData = X.length; for (int example = 0; example < nExamples; example++) { PiecewisePolynomialResultsWithSensitivity pp = BASE.interpolateWithSensitivity(X, Y[example]); BoundCurveInterpolator bound = PCHIP.bind( DoubleArray.ofUnsafe(X), DoubleArray.ofUnsafe(Y[example]), INTERPOLATOR, INTERPOLATOR); for (int i = 0; i < n; i++) { DoubleArray computed = bound.parameterSensitivity(XX[i]); DoubleArray expected = PPVAL.nodeSensitivity(pp, XX[i]); for (int j = 0; j < nData; j++) { assertThat(DoubleArrayMath.fuzzyEquals(computed.toArray(), expected.toArray(), TOL)).isTrue(); } } } }