Name

interpol

Synopsis

int interpol (const double *x, const double *fx, int n, double *z, double *pz, 
   int m);

Return Value

0 if interpolating is successful, or -1 otherwise.

Description

Determines the value of a function at specified points using polynomial interpolation. Points at which values are known are specified by the caller in x. The known values of the function at each point in x are specified in fx. Points at which values are to be determined are specified in z. The values calculated for the points passed in z are returned in pz. The number of values in x and fx is specified as n. The number of points in z (and thus returned in pz) is specified as m. It is the responsibility of the caller to manage the storage associated with x, fx, z, and pz.

Complexity

O (mn 2), where m is the number of values to determine and n is the number of points at which values are known.

Get Mastering Algorithms with C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.