AMA_UnvInterp.c File Reference
#include <AMA.h>

## Functions

long int AMA_UnvInterp (AMA_OPTIONS *options, long int n, double *x, double *z, long int degree, AMA_SPLINE **spline)
Interpolation of Univariate Data More...

## Function Documentation

 long int AMA_UnvInterp ( AMA_OPTIONS * options, long int n, double * x, double * z, long int degree, AMA_SPLINE ** spline )

Interpolation of Univariate Data

For a given set of data , for , this function employs cnspla to compute the spline subject to the interpolation constraints for .

In the above definition of the , for , are the coefficients of the univariate B-splines of degree which are based on the knot vector . If the degree is even, then the knot vector is defined such that its distinct knot vector is and; if the degree is odd, then is defined such that its distinct knot vector is In either case, its corresponding knot multiplicity vector is and the number of spline coefficients is Since there are only interpolation constraints and coefficients, it is necessary to define additional conditions in order to insure an unique solution when . Hence, this function imposes boundary conditions on the derivatives of the spline at its left and right hand boundaries. These conditions are for The following table summarizes the boundary conditions imposed for .

Degree Boundary Conditions
Quadratic Cubic Quartic Quintic This function performs the follow tasks:

• Checks the input parameters for validity, see AMA_UnvInputCheck().
• Defines the spline based on the knot vector described above.
• Defines CNSPLA_CONPNT constraints to represent the interpolation constraints, see AMA_UnvConpnt().
• Defines CNSPLA_CONPNT constraints to represent the boundary conditions.
• Invokes cnspla to compute a spline which minimizes subject to the interpolation constraints and boundary conditions.
• Stores interpolant into spline.
Note
By default the spline coefficients are initialized to zero but a different initial value for the spline coefficients can be set with AMA_OptionsSetCoefficients().
Parameters
 options [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_UnvInterp(). n [in] The number of data points . Must satisfy n . x [in] Array of size n containing the independent variable data , for . Must be in strictly ascending order. z [in] Array of size n containing the dependent variable data , for . degree [in] The degree . Must satisfy degree . spline [out] Pointer to AMA_SPLINE pointer containing the spline interpolant. Must satisfy spline NULL.
Returns
Success/Error Code.

User Callable Function - Documented 101715