(out) user-allocated quadrature nodes in ascending order length of N
(out) user-allocated corresponding quadrature weights length of N
(temp) user-allocated workspace length of greate or equal to (N + 1) ^^ 2
0 on success, xSTEQR LAPACK code on numerical error.
import mir.math.common; auto n = 5; auto x = new double[n]; auto w = new double[n]; auto work = new double[(n + 1) ^^ 2]; gaussHermiteQuadrature(x, w, work); static immutable xc = [-2.02018287, -0.95857246, 0. , 0.95857246, 2.02018287]; static immutable wc = [0.01995324, 0.39361932, 0.94530872, 0.39361932, 0.01995324]; foreach (i; 0 .. n) { assert(x[i].approxEqual(xc[i])); assert(w[i].approxEqual(wc[i])); }
Gauss-Hermite Quadrature