JacobiPolynomialFunction extends OrthogonalPolynomialFunctionGenerator { @Override public DoubleFunction1D[] getPolynomials(final int n) { throw new UnsupportedOperationException("Need values for alpha and beta for Jacobi polynomial function generation"); }  @Override DoubleFunction1D[] getPolynomials(final int n); @Override Pair<DoubleFunction1D, DoubleFunction1D>[] getPolynomialsAndFirstDerivative(final int n); DoubleFunction1D[] getPolynomials(final int n, final double alpha, final double beta); Pair<DoubleFunction1D, DoubleFunction1D>[] getPolynomialsAndFirstDerivative(final int n, final double alpha, final double beta);  }
@Test(expectedExceptions = UnsupportedOperationException.class) public void testNoAlphaBeta() { JACOBI.getPolynomials(3); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNegativeN() { JACOBI.getPolynomials(-3, ALPHA, BETA); }
@Test(expectedExceptions = UnsupportedOperationException.class) public void testGetPolynomials() { JACOBI.getPolynomialsAndFirstDerivative(3); }
@Test public void test() { DoubleFunction1D[] p = JACOBI.getPolynomials(0, ALPHA, BETA); assertEquals(p.length, 1); final double x = 1.23; assertEquals(p[0].evaluate(x), 1, EPS); for (int i = 0; i <= 2; i++) { p = JACOBI.getPolynomials(i, ALPHA, BETA); for (int j = 0; j <= i; j++) { assertEquals(P[j].evaluate(x), p[j].evaluate(x), EPS); } } }