Template Struct GKRule

Struct Documentation

template<GKOrder Order>
struct GKRule

Abscissae and weights for a single Gauss-Kronrod pair.

Only ever used via one of the six explicit specializations below (one per GKOrder enumerator); the primary template is deliberately left undefined, so instantiating GKRule<Order> for anything else is a compile error rather than silently ill-defined. Every specialization’s own ngk/ng/xgk/wg/wgk values are copied verbatim from the GSL’s own integration/ qkNN.c (NN = 15, 21, 31, 41, 51, 61), which in turn credits them to L. W. Fullerton, Bell Labs, Nov. 1981, evaluated with 80 decimal digit arithmetic – reproduced here (as std::array rather than the GSL’s own flat C arrays, but otherwise unchanged) purely so GKIntegrator does not need to link against the GSL’s own integration routines to get at them. Only the first half (plus, for an odd point count, the shared middle point at x = 0) of each symmetric rule’s own abscissae/weights are stored, exactly as the GSL’s own arrays do: xgk[ngk - 1] is always the shared middle abscissa (x = 0), xgk[1], xgk[3], … are the Gauss rule’s own (positive) abscissae, and xgk[0], xgk[2], … are the additional abscissae the Kronrod extension adds – see qk15.c’s own comment for the identical convention this mirrors.

Template Parameters:

Order – Which pair – see GKOrder’s own comment