XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ interv()

void interv ( double  xt[],
int  lxt,
double  x,
int *  ilo,
int *  ileft,
int *  info 
)

Compute ileft for the input to bsplvd and bsplvn

Purpose
This routine computes the largest integer ileft in 1 <= ileft <= lxt such that xt[ileft-1] <= x where xt[] is a subdivision of the x interval. Precisely, the following values will be returned.
  If x < xt[0] then ileft = 1, info = 2
  If xt[i-1] <= x < xt[i] then ileft = i, info = 0
  If xt[lxt-1] <= x then ileft = lxt, info = 1
When multiplicities are present in the break point to the left of x, the largest index is taken for ileft.
Parameters
[in]xt[]Array xt[lxt]
Knot or break point vector.
[in]lxtLength of the vector xt[]. (lxt >= 1)
[in]xArgument x.
[in,out]iloInitialization parameter.
[in] Must be set to 1 the first time the array xt[] is processed by interv.
[out] Information for efficient processing after the initial call and ilo must not be changed by the user. Distinct splines require distinct ilo parameters.
[out]ileftLargest integer satisfying xt[ileft-1] <= x.
[out]info= 0: Successful exit
= -2: The argument lxt had an illegal value (lxt < 1)
= 1: x lies out of bounds (xt[lxt-1] <= x)
= 2: x lies out of bounds (x < xt[0])
Reference
SLATEC