Virtual Method

NumCosmoMathSplineeval_idx

Declaration [src]

gdouble
eval_idx (
  const NcmSpline* s,
  const gdouble x,
  const gsize i
)

Description [src]

Evaluates the spline at x using the provided index i. This function is useful when multiple splines share the same x vector and the index is already known, avoiding redundant binary searches.

The index i should correspond to the interval containing x, i.e., x[i] <= x < x[i+1].

Parameters

x

Type: const gdouble

X-coordinate value.

i

Type: const gsize

Index of the lower knot.

Return value

Type: gdouble

The interpolated value of a function computed at x.