Function
NumCosmoMathIntegralFixedcalibrate
Declaration [src]
NcmIntegralFixed*
ncm_integral_fixed_calibrate (
gint* F,
gint* G,
gdouble xl,
gdouble xu,
gdouble reltol,
gdouble exact_F_integ,
gulong max_total_nodes,
guint* n_nodes_out,
guint* rule_n_out
)
Description [src]
Searches the $(n_\mathrm{nodes}, \mathrm{rule}_n)$ configuration space for the
fixed Gauss-Legendre rule of minimal total node count whose estimate of
$\int F(x) G(x) \mathrm{d}x$ over [xl, xu] matches a high-resolution
reference (n_nodes = 1000, rule_n = 7) to within reltol. The selected
configuration must additionally reproduce $\int F \mathrm{d}x$ (via
ncm_integral_fixed_nodes_eval) to within reltol — this catches an F feature
narrower than the reference panel width, where the $F\,G$ test alone could
false-pass because both reference and trial straddle it. The guard baseline is
exact_F_integ when finite, otherwise the reference’s own $\int F$.
For each candidate rule_n the threshold $n_\mathrm{nodes}$ is bracketed by
geometric growth and then pinned exactly by bisection (assuming convergence is
monotone in $n_\mathrm{nodes}$), so the returned configuration is the true
minimal-total rule rather than a geometric overshoot.
If no configuration within max_total_nodes meets the tolerance, the
configuration with the smallest $F\,G$ error seen is used and a warning is emitted.
This function is not directly available to language bindings.
Parameters
F-
Type:
gint*A pointer to a gsl_function, the integration weight (baked into the nodes).
The data is owned by the caller of the function. G-
Type:
gint*A pointer to a gsl_function, the slowly-varying factor probed at the nodes.
The data is owned by the caller of the function. xl-
Type:
gdoubleThe interval lower limit.
xu-
Type:
gdoubleThe interval upper limit.
reltol-
Type:
gdoubleTarget relative tolerance.
exact_F_integ-
Type:
gdoubleThe exact value of $\int F \mathrm{d}x$ over [
xl,xu] for the missed-mass guard, orGSL_NANto fall back to the reference’s own $\int F \mathrm{d}x$. max_total_nodes-
Type:
gulongCeiling on the total node count $(n_\mathrm{nodes}-1)\,r$.
n_nodes_out-
Type:
guint*Receives the selected number of nodes.
The argument will be set by the function. rule_n_out-
Type:
guint*Receives the selected Gauss-Legendre rule order.
The argument will be set by the function.
Return value
Type: NcmIntegralFixed
A newly allocated NcmIntegralFixed at the selected
configuration, with F already baked into its nodes (see
ncm_integral_fixed_calc_nodes).
| The caller of the function takes ownership of the data, and is responsible for freeing it. |