Skip to content

num::gauss_legendre_rule

Defined in header <quadrature/gauss_legendre_rule.hpp>

std::pair<std::vector<real>, std::vector<real>>
gauss_legendre_rule(idx order, real a = 0.0, real b = 1.0);

Compute the Gauss–Legendre nodes \(x_k\) and weights \(w_k\) on \([a, b]\) (Golub–Welsch). The weights sum to \(b - a\).