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

## Functions

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

## Function Documentation

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

Interpolation of Multivariate Data

This function employs cnspla to compute a spline interpolant of independent variable data and dependent variable data . For a given set of independent variable data and dependent variable data , for , this function computes the spline that minimizes subject to the interpolation constraints for . The integration region where and , for .

This function also imposes constraints on the spline's partial derivative at its left hand boundary and its right hand boundary , for all . These constraints are for These are the "so-called" natural boundary conditions and they are imposed at all for and .

In the above definition of the , for and , are the coefficients of the tensor product B-splines where are the univariate B-splines of degree defined by the knot vector . The knot vectors are and they depend on the independent variable data and the degree . They are based on the rectilinear grid upon which the independent variable data lies and they are defined by AMA_LamdaInterp(). That is, the knot vector is defined by AMA_LamdaInterp() based on the points .

Additionally, the spline is subject to the bounds where , and equals AMA_SplineInfbnd(). By default the spline is unbounded but finite bounds can be set with AMA_OptionsSetBounds(). If the bounds specified with AMA_OptionsSetBounds() can not be satisfied in conjunction with the aforementioned interpolation and boundary constraints, then AMA_MltvInterp() imposes the bounds where and . The values of and are defined by minimizing subject to the constraints and the aforementioned interpolation and boundary constraints. If either or , then AMA_MltvInterp() reports AMA_WARNING_ERROR messages which specify the bounds and imposed on the spline. Additionally, it sets AMA_OPTIONS::lwrbnd and AMA_OPTIONS::uprbnd .

This function does the following:

• Checks the input parameters for validity, see AMA_MltvInputCheck().
• Defines the spline based on the knot vectors , for .
• Defines CNSPLA_CONPNT constraints to represent the interpolation constraints, see AMA_MltvConpnt().
• Defines CNSPLA_CONREG constraints to represent the boundary constraints.
• Defines CNSPLA_PNLTRM condition to represent the function , see AMA_MltvPnltrm().
• Invokes cnspla to compute a spline which minimizes subject to the interpolation and boundary constraints.
• 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().
By default the spline is unbounded but finite bounds can be set with AMA_OptionsSetBounds().
By default the cross partial terms are included in the penalty term but they can be excluded with AMA_OptionsSetPenaltyTerm().
Because this function defines knot vectors based on the rectilinear grid upon which the independent variable data lies, it should only be used when the independent variable data either defines a gridded data with holes distribution, defines a gridded data distribution or consists of a small randomly distributed data set. See Multivariate Data Functions for a description of these data distributions.

Parameter Note: In the parameter definitions given below the limits on are and k = .

Parameters
 options [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvInterp(). nind [in] The number of independent variables . Must satisfy nind AMA_MXNIND. n [in] The number of data points . Must satisfy n . x [in] Array of size nind containing arrays of size n where x[k] contains the independent variable data , for . z [in] Array of size n containing the dependent variable data , for . degree [in] Array of size nind containing the degree where degree[k] . Must satisfy degree[k] . spline [out] Pointer to AMA_SPLINE pointer containing the spline interpolant. Must satisfy spline NULL.
Returns
Success/Error Code.

User Callable Function - Documented 022416