Class GaussLegendreWeightAndAbscissaFunction
- java.lang.Object
-
- com.opengamma.strata.math.impl.integration.GaussLegendreWeightAndAbscissaFunction
-
- All Implemented Interfaces:
QuadratureWeightAndAbscissaFunction
public class GaussLegendreWeightAndAbscissaFunction extends Object implements QuadratureWeightAndAbscissaFunction
Class that generates weights and abscissas for Gauss-Legendre quadrature. The weights $w_i$ are given by: $$ \begin{align*} w_i = \frac{2}{(1 - x_i^2) L_i'(x_i)^2} \end{align*} $$ where $x_i$ is the $i^{th}$ root of the orthogonal polynomial and $L_i'$ is the first derivative of the $i^{th}$ polynomial. The orthogonal polynomial is generated byLegendrePolynomialFunction
.
-
-
Constructor Summary
Constructors Constructor Description GaussLegendreWeightAndAbscissaFunction()
-
-
-
Method Detail
-
generate
public GaussianQuadratureData generate(int n)
- Specified by:
generate
in interfaceQuadratureWeightAndAbscissaFunction
- Parameters:
n
- The number of weights and abscissas to generate, not negative or zero- Returns:
- An object containing the weights and abscissas
-
-