Numerical integration/Gauss-Legendre Quadrature: Difference between revisions

Updated D entry
m (Updated D entry)
(Updated D entry)
Line 229:
immutable struct GaussLegendreQuadrature(size_t N, FP=double,
size_t NBITS=50) {
/*const*/ __gshared static double[N] lroots, weight;
alias FP[N + 1][N + 1] CoefMat;
 
Line 241:
pure nothrow {
lcoef[0][0] = lcoef[1][1] = 1;
foreach (int n; 2 .. N + 1) { // n must be signed.
lcoef[n][0] = -(n - 1) * lcoef[n - 2][0] / n;
foreach (i; 1 .. n + 1)