class GaussLaguerreWeightAndAbscissaFunction implements QuadratureWeightAndAbscissaFunction {

  @Override
  public GaussianQuadratureData generate(final int n) {
    Validate.isTrue(n > 0);
    final Pair<DoubleFunction1D, DoubleFunction1D>[] polynomials = LAGUERRE.getPolynomialsAndFirstDerivative(n, _alpha);
    final Pair<DoubleFunction1D, DoubleFunction1D> pair = polynomials[n];
    final DoubleFunction1D p1 = polynomials[n - 1].getFirst();
    final DoubleFunction1D function = pair.getFirst();
    final DoubleFunction1D derivative = pair.getSecond();
    final double[] x = new double[n];
    final double[] w = new double[n];
    double root = 0;
    for (int i = 0; i < n; i++) {
      root = ROOT_FINDER.getRoot(function, derivative, getInitialRootGuess(root, i, n, x));
      x[i] = root;
      w[i] = -GAMMA_FUNCTION.evaluate(_alpha + n) / MathUtils.factorialDouble(n) / (derivative.evaluate(root) * p1.evaluate(root));
    }
    return new GaussianQuadratureData(x, w);
  }

  public  GaussLaguerreWeightAndAbscissaFunction();
  public  GaussLaguerreWeightAndAbscissaFunction(final double alpha);

}