ProductPiecewisePolynomialInterpolator extends PiecewisePolynomialInterpolator { @Override public PiecewisePolynomialResult interpolate(double[] xValues, double[] yValues) { ArgumentChecker.notNull(xValues, "xValues"); ArgumentChecker.notNull(yValues, "yValues"); ArgumentChecker.isTrue(xValues.length == yValues.length, "xValues length = yValues length"); PiecewisePolynomialResult result; if (_isClamped) { double[][] xyValuesAll = getDataTotal(xValues, yValues); result = _baseMethod.interpolate(xyValuesAll[0], xyValuesAll[1]); } else { double[] xyValues = getProduct(xValues, yValues); result = _baseMethod.interpolate(xValues, xyValues); } return extrapolateByLinearFunction(result, xValues); } ProductPiecewisePolynomialInterpolator(PiecewisePolynomialInterpolator baseMethod);  ProductPiecewisePolynomialInterpolator(PiecewisePolynomialInterpolator baseMethod, double[] xValuesClamped,
      double[] yValuesClamped); @Override PiecewisePolynomialResult interpolate(double[] xValues, double[] yValues); @Override PiecewisePolynomialResult interpolate(double[] xValues, double[][] yValuesMatrix); @Override PiecewisePolynomialResultsWithSensitivity interpolateWithSensitivity(double[] xValues, double[] yValues); @Override PiecewisePolynomialInterpolator getPrimaryMethod();  }
@Test(expectedExceptions = IllegalArgumentException.class) public void dataDifferentLengthTest() { double[] xValues = new double[] {-5.0, -1.4, 3.2, 3.5, 7.6 }; double[] yValues = new double[] {-2.2, 1.1, 1.9, 2.3 }; ProductPiecewisePolynomialInterpolator interp = new ProductPiecewisePolynomialInterpolator(INTERP_SENSE[1]); interp.interpolate(xValues, yValues); }
@Test(expectedExceptions = NotImplementedException.class) public void notImplementedTest() { double[] xValues = new double[] {-5.0, -1.4, 3.2, 3.5, 7.6 }; double[][] yValues = new double[][] { {-2.2, 1.1, 1.9, 2.3, 1.2 }, {-2.2, 1.1, 1.9, 2.3, 1.2 } }; ProductPiecewisePolynomialInterpolator interp = new ProductPiecewisePolynomialInterpolator(INTERP_SENSE[1]); interp.interpolate(xValues, yValues); }