Method

NumCosmoMathSplineeval_integ_idx

Declaration [src]

gdouble
ncm_spline_eval_integ_idx (
  const NcmSpline* s,
  const gdouble xi,
  const gsize i,
  const gdouble xf,
  const gsize f
)

Description [src]

Evaluates the integral of the spline from xi to xf using the provided indices i and f. This function is useful when multiple splines share the same x vector and the indices are already known, avoiding redundant binary searches.

The indices should correspond to the intervals containing the limits, i.e., x[i] <= xi < x[i+1] and x[f] <= xf < x[f+1].

Parameters

xi

Type: const gdouble

Lower integration limit.

i

Type: const gsize

Index of the lower knot for xi.

xf

Type: const gdouble

Upper integration limit.

f

Type: const gsize

Index of the lower knot for xf.

Return value

Type: gdouble

The numerical integral of an interpolated function over the range [xi, xf].