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

◆ pchse()

void pchse ( int  n,
double  x[],
double  f[],
double  d[],
int  incfd,
double  work[],
int  lwork,
int *  info 
)

Piecewise cubic spline interpolation ("not a knot" condition)

Purpose
This routine computes the derivatives needed to determine the Hermite representation of the cubic spline interpolant to given data, with with the default boundary conditions ("not a knot" condition).

The resulting piecewise cubic spline function may be evaluated by pchfe or pchfd.
Parameters
[in]nNumber of data points. (n >= 2)
[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. f[i*incfd] is the value corresponding to x[i] (i = 0 to n - 1).
[out]d[]Array d[ld] (ld >= incfd*(n - 1) + 1)
Derivative values at the data points. These values will determine the cubic spline interpolant with the requested boundary conditions. The value corresponding to x[i] is stored in d[i*incfd] (i = 0 to n - 1). No other entries in d[] are changed.
[in]incfdIncrement between successive values in f[] and d[]. This argument is provided primarily for 2-D applications. (incfd >= 1)
[out]work[]Array work[lwork]
Work array.
[in]lworkThe dimension of the array work[] (lwork >= 2*n)
[out]info= 0: Successful exit
= -1: The argument n had an illegal value (n < 2)
= -2: The argument x had an illegal value (x[] is not strictly increasing)
= -5: The argument incfd had an illegal value (incfd < 1)
= -7: The argument lwork had an illegal value (lwork < 2*n)
Reference
SLATEC (PCHIP) (Driver for pchsp)