FieldHermiteInterpolator { public T[] value(T x) throws NoDataException, NullArgumentException { MathUtils.checkNotNull(x); if (abscissae.isEmpty()) { throw new NoDataException(LocalizedFormats.EMPTY_INTERPOLATION_SAMPLE); } final T[] value = MathArrays.buildArray(x.getField(), topDiagonal.get(0).length); T valueCoeff = x.getField().getOne(); for (int i = 0; i < topDiagonal.size(); ++i) { T[] dividedDifference = topDiagonal.get(i); for (int k = 0; k < value.length; ++k) { value[k] = value[k].add(dividedDifference[k].multiply(valueCoeff)); } final T deltaX = x.subtract(abscissae.get(i)); valueCoeff = valueCoeff.multiply(deltaX); } return value; } FieldHermiteInterpolator(); void addSamplePoint(final T x, final T[] ... value); T[] value(T x); T[][] derivatives(T x, int order);  }
@Test(expected=NoDataException.class) public void testEmptySampleValue() { new FieldHermiteInterpolator<BigFraction>().value(BigFraction.ZERO); }