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

◆ pchim()

void pchim ( int  n,
double  x[],
double  f[],
double  d[],
int  incfd,
int *  info 
)

Piecewise cubic Hermite interpolation (default boundary conditions)

Purpose
This routine sets derivatives needed to determine a monotone piecewise cubic Hermite interpolant. Default boundary conditions are provided which are compatible with monotonicity. Use pchic if user control of boundary conditions is desired.

The resulting piecewise cubic Hermite function may be evaluated by pchfe or pchfd.
Parameters
[in]nNumber of data points (n >= 2). If n = 2, simply does linear interpolation.
[in]x[]Array x[lx] (lx >= n)
Independent variable values. The elements of x[] must be strictly increasing.
[in]f[]Array f[lf] (lf >= incfd*(n - 1) + 1)
Dependent variable values to be interpolated.
[out]d[]Array d[ld] (ld >= incfd*(n - 1) + 1)
Derivative values at the data points.
[in]incfdIncrement between successive values in f[] and d[]. f[i*incfd] and d[i*incfd] are the values corresponding to x[i]. (i = 0 to n - 1)
[out]info= 0: Successful exit
= -1: The argument n had an illegal value (n < 2)
= -2: The argument x[] had an illegal value (not strictly increasing)
= -5: The argument incfd had an illegal value (incfd < 1)
= i > 0: i switches in the direction of monotonicity were detected
Reference
SLATEC (PCHIP)