Go to the source code of this file.
Functions  
long int  AMA_MltvApprox (AMA_OPTIONS *options, long int nind, long int n, double **x, double *z, double *epsilon, long int *degree, AMA_SPLINE **spline) 
Approximation of Multivariate Data More...  
long int  AMA_MltvGrdApprox (AMA_OPTIONS *options, long int nind, long int *ng, double **x, double *z, double *wht, long int *degree, AMA_SPLINE **spline) 
Approximation of Multivariate Gridded Data More...  
long int  AMA_MltvGrdInterp (AMA_OPTIONS *options, long int nind, long int *ng, double **x, double *z, long int *degree, AMA_SPLINE **spline) 
Interpolation of Multivariate Gridded Data More...  
long int  AMA_MltvGrdLstsqr (AMA_OPTIONS *options, long int nind, long int *ng, double **x, double *z, double *wht, long int *degree, long int *mlamda, double **lamda, double theta, AMA_SPLINE **spline) 
Least Squares Approximation of Multivariate Gridded Data More...  
long int  AMA_MltvGrdMonoApprox (AMA_OPTIONS *options, long int nind, long int *ng, double **x, double *z, double *epsilon, long int *degree, AMA_SPLINE **spline) 
Monotonic Approximation of Multivariate Gridded Data More...  
long int  AMA_MltvGrdMonoInterp (AMA_OPTIONS *options, long int nind, long int *ng, double **x, double *z, long int *degree, AMA_SPLINE **spline) 
Monotonic Interpolation of Multivariate Gridded Data More...  
long int  AMA_MltvMonoApprox (AMA_OPTIONS *options, long int nind, long int n, double **x, double *z, double *epsilon, long int *degree, AMA_SPLINE **spline) 
Monotonic Approximation of Multivariate Data More...  
long int  AMA_MltvMonoInterp (AMA_OPTIONS *options, long int nind, long int n, double **x, double *z, long int *degree, AMA_SPLINE **spline) 
Monotonic Interpolation of Multivariate Data More...  
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...  
long int  AMA_MltvLstsqr (AMA_OPTIONS *options, long int nind, long int n, double **x, double *z, double *wht, long int *degree, long int *mlamda, double **lamda, double theta, AMA_SPLINE **spline) 
Least Squares Approximation of Multivariate Data More...  
long int  AMA_MltvBoundaryConditions (AMA_OPTIONS *options, enum AMA_Boolean interp, CNSPLA_SPLFUN *splfun) 
Define boundary conditions for multivariate approximation and interpolation functions. More...  
long int  AMA_MltvData (AMA_OPTIONS *options, const char *datfile, long int *nind, long int *degree, long int *n, double ***x, double **z, double **epsilon, double **wht, double *theta, long int *mlamda, double ***lamda) 
Read data and approximation options for AMA Spline Library Multivariate Random Data Functions. More...  
long int  AMA_MltvDataFree (AMA_OPTIONS *options, long int nind, double ***x, double **z, double **epsilon, double **wht, double ***lamda) 
Free Multivariate Data Functions data arrays. More...  
long int  AMA_MltvGrdData (AMA_OPTIONS *options, const char *datfile, long int *nind, long int *degree, long int *ng, double ***x, double **z, double **epsilon, double **wht, double *theta, long int *mlamda, double ***lamda) 
Read data and approximation options for AMA Spline Library Multivariate Gridded Data Functions. More...  
long int  AMA_MltvGrdInputCheck (AMA_OPTIONS *options, long int nind, long int *ng, double **x, double *z, double *wht, double *epsilon, long int *degree, long int *mlamda, double **lamda, enum AMA_Boolean lstsqr, enum AMA_Boolean *mltknt) 
Perform input check for multivariate gridded data. More...  
long int  AMA_MltvInputCheck (AMA_OPTIONS *options, long int nind, long int n, double **x, double *z, double *wht, double *epsilon, long int *degree, long int *mlamda, double **lamda, enum AMA_Boolean lstsqr) 
Perform input check for multivariate data approximation functions. More...  
long int  AMA_MltvPnltrm (AMA_OPTIONS *options, double theta, long int porder, CNSPLA_SPLFUN *splfun) 
Define penalty term on a multivariate spline. More...  
long int  AMA_MltvConpnt (AMA_OPTIONS *options, long int nind, long int n, double **x, double *z, double *epsilon, CNSPLA_SPLFUN *splfun) 
Define approximation or interpolation constraints on a multivariate spline. More...  
long int  AMA_MltvConreg (AMA_OPTIONS *options, long int nind, long int n, double **x, double *z, double *epsilon, long int *degree, CNSPLA_SPLFUN *splfun) 
Define monotonicity constraints on a multivariate spline. More...  
long int  AMA_MltvRglrze (AMA_OPTIONS *options, CNSPLA_SPLFUN *splfun) 
long int AMA_MltvApprox  (  AMA_OPTIONS *  options, 
long int  nind,  
long int  n,  
double **  x,  
double *  z,  
double *  epsilon,  
long int *  degree,  
AMA_SPLINE **  spline  
) 
Approximation of Multivariate Data
This function employs cnspla to compute a spline approximation of independent variable data and dependent variable data . For a given set of independent variable data , dependent variable data and approximation tolerances , for , this function computes the spline
that minimizes
subject to the approximation constraints
for . The integration region where and , for .
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines 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 approximation constraints, then AMA_MltvApprox() imposes the bounds
where and . The values of and are defined by minimizing
subject to the constraints
and the aforementioned approximation constraints. If either or , then AMA_MltvApprox() 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:
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvApprox(). 
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 . 
epsilon  [in] Array of size n containing the approximation tolerances , for . Must satisfy for all . If epsilon = NULL, then this function uses for all . 
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 approximation. Must satisfy spline NULL. 
User Callable Function  Documented 022416
long int AMA_MltvBoundaryConditions  (  AMA_OPTIONS *  options, 
enum AMA_Boolean  interp,  
CNSPLA_SPLFUN *  splfun  
) 
Define boundary conditions for multivariate approximation and interpolation functions.
options  [in] Pointer to AMA_OPTIONS. Should be initialized with AMA_Options() prior to calling AMA_MltvBoundaryConditions(). 
interp  [in] Interpolation function flag. It has one of the following two values:

splfun  [in] Pointer to CNSPLA_SPLFUN containing the spline upon which the penalty term is imposed. Should satisfy splfun NULL. 
User Support Function  Documented nnnnnn  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
long int AMA_MltvConpnt  (  AMA_OPTIONS *  options, 
long int  nind,  
long int  n,  
double **  x,  
double *  z,  
double *  epsilon,  
CNSPLA_SPLFUN *  splfun  
) 
Define approximation or interpolation constraints on a multivariate spline.
For a given set of independent variable data , dependent variable data and approximation tolerances , for , this function defines either the approximation constraints
or the interpolation constraints
for , on a multivariate spline given as
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Should be initialized with AMA_Options() prior to calling AMA_MltvConpnt(). 
nind  [in] The number of independent variables . Should satisfy nind . 
n  [in] The number of data points . Should 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 . 
epsilon  [in] Array of size n containing the approximation tolerances , for . Should satisfy for all . If epsilon = NULL, then the interpolation constraints are defined. Otherwise, the approximation constraints are defined. 
splfun  [in] Pointer to CNSPLA_SPLFUN containing spline upon which approximation or interpolation constraints are imposed. Should satisfy splfun NULL. 
User Support Function  Documented 110914  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
long int AMA_MltvConreg  (  AMA_OPTIONS *  options, 
long int  nind,  
long int  n,  
double **  x,  
double *  z,  
double *  epsilon,  
long int *  degree,  
CNSPLA_SPLFUN *  splfun  
) 
Define monotonicity constraints on a multivariate spline.
For a given set of independent variable data , dependent variable data and approximation tolerances , for , this function defines local monotonicity constraints on a multivariate spline given as
This function first defines the rectilinear grid upon which the independent variable data lies and then it defines the gridded dependent variable data and the gridded approximation tolerances for and . If the independent variable data defines a gridded data distribution, then . If it defines a gridded data with holes distribution, then ; that is, dependent variable data does not lie everywhere on the grid. In the latter case the local monotonicity constraints are not defined in regions of missing data.
After determining the data's underlying rectilinear grid this function imposes constraints on the first order partials , for all , which insure the spline satisfies the local monotonicity constraints. The form of the constraints depends on the approximation tolerances.
If , then for some a local monotonicity constraint is defined for all with and it is of the form
The above constraint is defined for all . The notation and refers to the dependent variable data associated with the grid points and , respectively. If data does not lie at both grid points, then the constraint is not defined.
Alternatively, if there exists an for which , then for some a local monotonicity constraint is defined for all with and it is of the form
The above constraint is defined for all . The notation and refers to the approximation tolerances associated with the grid points and , respectively. If data does not lie at both grid points, then the constraint is not defined.
If for some the above conditions are not met, then the intervals and intersect and the equality constraint
can be imposed over the interval . However, it is possible for the intervals and to intersect, for each and ; without an intersection existing between all the intervals. In this case the aforementioned equality constraint is inconsistent with the approximation constraints
for ; and, therefore, can not be imposed over the interval . Hence, instead of imposing an equality constraint this function minimizes
over all intervals for which the intervals and intersect.
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Should be initialized with AMA_Options() prior to calling AMA_MltvConreg(). 
nind  [in] The number of independent variables . Should satisfy nind . 
n  [in] The number of data points . Should 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 . 
epsilon  [in] Array of size n containing the approximation tolerances , for . Should satisfy for all . If epsilon = NULL, then this function uses for all . 
degree  [in] Array of size nind containing the degree where degree[k] . Should satisfy degree[k] . 
splfun  [in] Pointer to CNSPLA_SPLFUN containing spline upon which monotonicity constraints are imposed. Should satisfy splfun NULL. 
User Support Function  Documented 121114  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
long int AMA_MltvData  (  AMA_OPTIONS *  options, 
const char *  datfile,  
long int *  nind,  
long int *  degree,  
long int *  n,  
double ***  x,  
double **  z,  
double **  epsilon,  
double **  wht,  
double *  theta,  
long int *  mlamda,  
double ***  lamda  
) 
Read data and approximation options for AMA Spline Library Multivariate Random Data Functions.
This function reads data and approximation options for AMA Spline Library functions which compute spline approximations of independent variable data and dependent variable data .
The argument datfile should reference a readable file which consists of a data section and several, optional, approximation options sections. The Data section must preceed the approximation options sections and has the following structure:
where the Epsilon and Wht columns are optional. The data must satisfy the following conditions:
Following the Data section may be one or more of the Bounds, Least_Squares, Monotonicity or Penalty_Term sections. If an approximation options section is not defined, then this function sets the options to their default values. See Table Approximation Options Defaults for a list of Multivariate Random Data Functions approximation options default values.
The Bounds section specifies the lower and upper bounds. It has the following structure:
and its options must satisfy the following conditions:
The lower bound is read as a string lwrstr and based on the value of lwrstr the value of is set as follows:
Similarly, the upper bound is read as a string uprstr and based on the value of uprstr the value of is set as follows:
The Least_Squares section specifies the approximation options and knots employed by AMA_MltvLstsqr(). It has the following structure:
and its options must satisfy the following conditions:
The Monotonicity section specifies the monotonicity constraints and continuity conditions employed by AMA_MltvMonoApprox() and AMA_MltvMonoInterp(). It has the the following structure:
and its options must satisfy the following conditions:
The Penalty_Term section specifies which cross partial terms are used in the penalty term. It has the following structure:
and its options must satisfy the following condition:
The bold keywords are case sensitive and the string values for the approximation options are case insensitive.
This function performs the following tasks:
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvData(). 
datfile  [in] The data file name. Must satisfy datfile NULL. 
nind  [out] The number of independent variables . Must satisfy nind NULL. 
degree  [out] Array of size nind containing the degree where degree[k] . Must satisfy degree NULL. 
n  [out] The number of data points . Must satisfy n NULL. 
x  [out] Array of size nind containing arrays of size n where x[k] contains the independent variable data , for . Must satisfy x NULL. 
z  [out] Array of size n containing the dependent variable data , for . Must satisfy z NULL. 
epsilon  [out] Array of size n containing the approximation tolerances , for . Must satisfy epsilon NULL. 
wht  [out] Array of size n containing the weights , for . Must satisfy wht NULL. 
theta  [out] The penalty term weight . Must satisfy theta NULL. 
mlamda  [out] Array of size nind containing the number of knots where mlamda[k] . Must satisfy mlamda NULL. 
lamda  [out] Array of size nind containing arrays of size mlamda[k] where lamda[k] contains the knots , for . Must satisfy lambda NULL. 
User Support Function  Documented 110315  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
long int AMA_MltvDataFree  (  AMA_OPTIONS *  options, 
long int  nind,  
double ***  x,  
double **  z,  
double **  epsilon,  
double **  wht,  
double ***  lamda  
) 
Free Multivariate Data Functions data arrays.
This function frees the arrays allocated by AMA_MltvData() and AMA_MltvGrdData().
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvDataFree(). 
nind  [out] The number of independent variables . Must satisfy nind . 
x  [out] Pointer to array of size nind containing the independent variable data arrays. 
z  [out] Pointer to array containing the dependent variable data. 
epsilon  [out] Pointer to array containing the approximation tolerances. 
wht  [out] Pointer to array containing the weights. 
lamda  [out] Pointer to array of size nind containing the knot arrays. 
User Support Function  Documented 110515  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
long int AMA_MltvGrdApprox  (  AMA_OPTIONS *  options, 
long int  nind,  
long int *  ng,  
double **  x,  
double *  z,  
double *  epsilon,  
long int *  degree,  
AMA_SPLINE **  spline  
) 
Approximation of Multivariate Gridded Data
This function employs cnspla to compute a spline approximation of independent variable data and dependent variable data . The independent variable data is given as , for and , and it defines the rectilinear grid
The dependent variable data lies on the grid and is given as , for ; that is, there are dependent variable values. Similarly, the approximation tolerances are given as for .
For a given set of data this function employs cnspla to compute the spline
that minimizes
subject to the approximation constraints
for .
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The knot vectors are
and they depend on the independent variable data and the degree . The knot vector is defined by AMA_LamdaInterp() based on the points .
This function employs an efficient algorithm for computing spline approximations of multivariate gridded data. The algorithm consists of computing the splines
for . The coefficients of are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The degree is
the number of coefficients is
and the knot vector is
The spline is based on the spline and is defined by setting its coefficents for and . The spline is defined through multiple invocations of AMA_UnvApprox() in the following manner.
First, the spline is defined by invoking AMA_UnvApprox() times to compute the univariate spline
that minimizes
subject to the approximation constraints
for . Computing the univariate splines , for and , defines the coefficients of .
After computing the splines , for , are defined by invoking AMA_UnvApprox() times to compute the univariate spline
that minimizes
subject to the interpolation constraints
for . Computing the univariate splines , for when and for when , defines the coefficients of .
In total this algorithm consists of invocations of AMA_UnvApprox() to compute a multivariate spline which satisfies the approximation constraints.
This function does the following:
Parameter Note: In the parameters description given below the limits on are , k = and N .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvGrdApprox(). 
nind  [in] The number of independent variables . Must satisfy nind AMA_MXNIND. 
ng  [in] Array of size nind containing the number of points where ng[k] . Must satisfy ng[k] . 
x  [in] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data , for . The values of x[k] must be in strictly ascending order. 
z  [in] Array of size N containing the dependent variable data , for . 
epsilon  [in] Array of size N containing the approximation toleraneces , for . Must satisfy for all . If epsilon = NULL, then this function uses . 
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 approximation. Must satisfy spline NULL. 
User Callable Function  Documented 103015
long int AMA_MltvGrdData  (  AMA_OPTIONS *  options, 
const char *  datfile,  
long int *  nind,  
long int *  degree,  
long int *  ng,  
double ***  x,  
double **  z,  
double **  epsilon,  
double **  wht,  
double *  theta,  
long int *  mlamda,  
double ***  lamda  
) 
Read data and approximation options for AMA Spline Library Multivariate Gridded Data Functions.
This function reads data for AMA Spline Library functions which compute spline approximations of independent variable data and dependent variable data . The independent variable data defines the rectilinear grid
where and . The dependent variable data lies on the grid and is given as for ; that is, there are dependent variable values. Similarly, the approximation tolerances for lie on the grid.
The argument datfile should reference a readable file which consists of a data section and several, optional, approximation options sections. The Data section must preceed the approximation options sections and has the following structure:
where the Epsilon and Wht columns are optional. The data must satisfy the following conditions:
Following the Data section may be one or more of the Bounds, Least_Squares or Monotonicity sections. If an approximation options section is not defined, then this function sets the options to their default values. See Table Approximation Options Defaults for a list of Multivariate Gridded Data Functions approximation options default values.
The Bounds section specifies the lower and upper bounds employed by AMA_MltvGrdLstsqr(). It has the following structure:
and its options must satisfy the following conditions:
The lower bound is read as a string lwrstr and based on the value of lwrstr the value of is set as follows:
Similarly, the upper bound is read as a string uprstr and based on the value of uprstr the value of is set as follows:
The Least_Squares section specifies the approximation options and knots employed by AMA_MltvGrdLstsqr(). It has the following structure:
and its options must satisfy the following conditions:
The Monotonicity section specifies the monotonicity constraints and continuity conditions employed by AMA_MltvGrdMonoApprox() and AMA_MltvGrdMonoInterp(). It has the the following structure:
and its options must satisfy the following conditions:
The bold keywords are case sensitive and the string values for the approximation options are case insensitive.
This function performs the following tasks:
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvGrdData(). 
datfile  [in] The data file name. Must satisfy datfile NULL. 
nind  [out] The number of independent variables . Must satisfy nind NULL. 
degree  [out] Array of size nind containing the degree where degree[k] . Must satisfy degree NULL. 
ng  [out] Array of size nind containing the number of points where ng[k] . Must satisfy ng NULL. 
x  [out] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data , . Must satisfy x NULL. 
z  [out] Array of size containing the dependent variable data , for . Must satisfy z NULL. 
epsilon  [out] Array of size containing the approximation tolerances , for . Must satisfy epsilon NULL. 
wht  [out] Array of size containing the weights , for . Must satisfy wht NULL. 
theta  [out] The penalty term weight . Must satisfy theta NULL. 
mlamda  [out] Array of size nind containing the number of knots where mlamda[k] . Must satisfy mlamda NULL. 
lamda  [out] Array of size nind containing arrays of size mlamda[k] where lamda[k] contains the knots , for . Must satisfy lamda NULL. 
User Support Function  Documented 110315  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
long int AMA_MltvGrdInputCheck  (  AMA_OPTIONS *  options, 
long int  nind,  
long int *  ng,  
double **  x,  
double *  z,  
double *  wht,  
double *  epsilon,  
long int *  degree,  
long int *  mlamda,  
double **  lamda,  
enum AMA_Boolean  lstsqr,  
enum AMA_Boolean *  mltknt  
) 
Perform input check for multivariate gridded data.
This function checks the input parameters for the Multivariate Gridded Data Functions which compute the spline
of degree which is based on the knot vectors , for .
Along with the degree the Multivariate Gridded Data Functions require the independent variable data , for and , which defines the rectilinear grid
and either the weights or the approximation tolerances , for . There are a total of N points. Also, for least squares approximation functions the knot vectors , for , are required. This function insures the following conditions are satisfied:
Also, if lstsqr equals AMA_Boolean_True and the knot vector is represented by its distinct knot vector
and its knot multiplicity vector
then, for all , this function insures either the conditions
or
are satisfied. It also insures the first and last distinct knots satisfy the conditions and , respectively.
Parameter Note: In the parameter definitions given below the limits on are , k = and N .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvGrdInputCheck(). 
nind  [in] The number of independent variables . Must satisfy nind . 
ng  [in] Array of size nind containing the number of points where ng[k] . Must satisfy ng NULL and ng[k] . 
x  [in] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data , for . Must satisfy x NULL and x[k] NULL. Also, x[k] must be in ascending order. 
z  [in] Array of size N containing the dependent variable data , for . Must satisfy z NULL. 
wht  [in] Array of size N containing the weights , for . If wht NULL, then must satisfy for all . 
epsilon  [in] Array of size N containing the approximation tolerances , for . If epsilon NULL, then must satisfy for all . 
degree  [in] Array of size nind containing the degree where degree[k] . Must satisfy degree NULL and degree[k] . 
mlamda  [in] Array of size nind containing the number of knots where mlamda[k] . If lstsqr AMA_Boolean_True, then must satisfy mlamda NULL and mlamda[k] . 
lamda  [in] Array of size nind containing arrays of size mlamda[k] where lamda[k] contains the knot vector . If lstsqr equals AMA_Boolean_True, then must satisfy lamda NULL and lamda[k] NULL. Also, lamda[k] must be a valid knot vector. 
lstsqr  [in] Least squares approximation flag. If it equals AMA_Boolean_True, then this function is being called by a least squares approximation function. 
mltknt  [out] Array of size nind containing the multiple knot flag. Defined only if lstsqr equals AMA_Boolean_True. It has one of the following two values:

User Support Function  Documented 021116  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
long int AMA_MltvGrdInterp  (  AMA_OPTIONS *  options, 
long int  nind,  
long int *  ng,  
double **  x,  
double *  z,  
long int *  degree,  
AMA_SPLINE **  spline  
) 
Interpolation of Multivariate Gridded Data
This function employs cnspla to compute a spline interpolant of independent variable data and dependent variable data . The independent variable data is given as , for and , and it defines the rectilinear grid
The dependent variable data lies on the grid and is given as , for ; that is, there are dependent variable values.
For a given set of data this function employs cnspla to compute the spline
that minimizes
subject to the interpolation constraints
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 constraints are imposed at , for all where and .
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The knot vectors are
and they depend on the independent variable data and the degree . The knot vector is defined by AMA_LamdaInterp() based on the points .
This function employs an efficient algorithm for computing spline interpolants of multivariate gridded data. The algorithm consists of computing the splines
for . The coefficients of are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The degree is
the number of coefficients is
and the knot vector is
The spline is based on the spline and is defined by setting its coefficents for and . The spline is defined through multiple invocations of AMA_UnvInterp() in the following manner.
First, the spline is defined by invoking AMA_UnvInterp() times to compute the univariate spline
that minimizes
subject to the interpolation constraints
for , and the boundary constraints
for
Computing the univariate splines , for and , defines the coefficients of .
After computing the splines , for , are defined by invoking AMA_UnvInterp() times to compute the univariate spline
that minimizes
subject to the interpolation constraints
for , and the boundary constraints
for
Computing the univariate splines , for when and for when , defines the coefficients of .
In total this algorithm consists of invocations of AMA_UnvInterp() to compute a multivariate spline which satisfies the interpolation and boundary constraints.
This function does the following:
Parameter Note: In the parameters description given below the limits on are , k = and N .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvGrdInterp(). 
nind  [in] The number of independent variables . Must satisfy nind AMA_MXNIND. 
ng  [in] Array of size nind containing the number of points where ng[k] . Must satisfy ng[k] . 
x  [in] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data , for . The values of x[k] must be in strictly ascending order. 
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. 
User Callable Function  Documented 030215
long int AMA_MltvGrdLstsqr  (  AMA_OPTIONS *  options, 
long int  nind,  
long int *  ng,  
double **  x,  
double *  z,  
double *  wht,  
long int *  degree,  
long int *  mlamda,  
double **  lamda,  
double  theta,  
AMA_SPLINE **  spline  
) 
Least Squares Approximation of Multivariate Gridded Data
This function employs cnspla to compute a least squares spline approximation of independent variable data and dependent variable data . The independent variable data is given as , for and , and it defines the rectilinear grid
The dependent variable data lies on the grid and is given as , for ; that is, there are dependent variable values.
For a given set of data this function employs cnspla to compute the spline
that minimizes
for .
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The knot vector is given as
where the knots must satisfy the conditions
If the knot vector is represented by its distinct knot vector
and its knot multiplicity vector
then the aforementioned conditions are
Also the first and last distinct knots must satisfy the conditions and , respectively. In this case the number of knots is .
For convenience this function does not require the definition of the order knots at the left and right hand endpoints and also accepts the knot vector given as
where the knots satisfy the conditions
If the knot vector is represented by its distinct knot vector
and its knot multiplicity vector
then the aforementioned conditions are
As before, the first and last distinct knots must satisfy the conditions and , respectively. In this case the number of knots is .
This function employs an efficient algorithm for computing least squares spline approximations of multivariate gridded data. The algorithm consists of computing the splines
for . The coefficients of are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The degree is
the number of coefficients is
and the knot vector is
The spline is based on the spline and is defined by setting its coefficents for and . The spline is defined through multiple invocations of AMA_UnvLstsqr() in the following manner.
First, the spline is defined by invoking AMA_UnvLstsqr() times to compute the univariate spline
that minimizes
Computing the univariate splines , for and , defines the coefficients of .
After computing the splines , for , are defined by invoking AMA_UnvLstsqr() times to compute the univariate spline
that minimizes
Computing the univariate splines , for when and for when , defines the coefficients of .
In total this algorithm consists of invocations of AMA_UnvLstsqr() to compute a least squares spline approximation.
This function does the following:
Parameter Note: In the parameters description given below the limits on are , k = and N .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvGrdLstsqr(). 
nind  [in] The number of independent variables . Must satisfy nind AMA_MXNIND. 
ng  [in] Array of size nind containing the number of points where ng[k] . Must satisfy ng[k] . 
x  [in] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data , for . The values of x[k] must be in ascending order. 
z  [in] Array of size N containing the dependent variable data , for . 
wht  [in] Array of size N containing the weights , for . Must satisfy for all . If wht = NULL, then this function uses . 
degree  [in] Array of size nind containing the degree where degree[k] . Must satisfy degree[k] . 
mlamda  [in] Array of size nind containing the number of knots where mlamda[k] . Must satisfy mlamda[k] . 
lamda  [in] Array of size nind containing arrays of size mlamda[k] where lamda[k] contains the knot vector or . 
theta  [in] The penalty term weight . Must satisfy theta . 
spline  [out] Pointer to AMA_SPLINE pointer containing the least squares spline approximation. Must satisfy spline NULL. 
User Callable Function  Documented 103015
long int AMA_MltvGrdMonoApprox  (  AMA_OPTIONS *  options, 
long int  nind,  
long int *  ng,  
double **  x,  
double *  z,  
double *  epsilon,  
long int *  degree,  
AMA_SPLINE **  spline  
) 
Monotonic Approximation of Multivariate Gridded Data
This function employs cnspla to compute a spline approximation of independent variable data and dependent variable data . The independent variable data is given as , for and , and it defines the rectilinear grid
The dependent variable data lies on the grid and is given as , for ; that is, there are dependent variable values. Similarly, the approximation tolerances are given as , for .
For a given set of data this function employs cnspla to compute the spline
that minimizes
subject to the approximation constraints
for . Additionally, for each , this function provides the option to impose the local monotonicity constraints
These constraints are imposed at , for all and with . By default the local monotonicity constraints are imposed on the spline in all of its independent variables but the constraints can be disabled in one or more of its independent variables with AMA_OptionsSetMonotonicity().
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The knot vectors are
and they depend on the independent variable data and the degree . If the local monotonicity constraints are requested in the th independent variable, then the knot vector is defined by AMA_LamdaMonoInterp(); otherwise, it is defined by AMA_LamdaInterp(). In either case the knot vector is based on the points .
This function computes a spline which satisfies either the full or reduced continuity condition at the interior grid points, as well as, the approximation and local monotonicity constraints. The following table summarizes the continuity of with respect to at the interior grid points , for , and the number of coefficients, , for a spline that satisfies either the full or reduced continuity condition. In the table the term
is the th order partial of with respect to evaluated at and defined over the region .
Degree  Full Continuity  Reduced Continuity  

Linear  is continuous for  is continuous for  
Quadratic  is continuous for  is continuous for  
Cubic  is continuous for  is continuous for  
Quartic  is continuous for  is continuous for  
Quintic  is continuous for  is continuous for 
This function employs an efficient algorithm for computing monotonic spline approximations of multivariate gridded data. The algorithm consists of computing the splines
for . The coefficients of are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The degree is
the number of coefficients is
and the knot vector is
The spline is based on the spline and is defined by setting its coefficents for and . The spline is defined through multiple invocations of AMA_UnvMonoApprox() in the following manner.
First, the spline is defined by invoking AMA_UnvMonoApprox() times to compute the univariate spline
that minimizes
subject to the approximation constraints
and the local monotonicity constraints
for . Computing the univariate splines , for and , defines the coefficients of .
After computing the splines , for , are defined by invoking AMA_UnvMonoApprox() times to compute the univariate spline
that minimizes
subject to the interpolation constraints
and the local monotonicity constraints
for . Computing the univariate splines , for when and for when , defines the coefficients of .
In total this algorithm consists of invocations of AMA_UnvMonoApprox() to compute a multivariate spline which satisfies the approximation and local monotonicity constraints.
This function does the following:
Parameter Note: In the parameters description given below the limits on are , k = and N .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvGrdMonoApprox(). 
nind  [in] The number of independent variables . Must satisfy nind AMA_MXNIND. 
ng  [in] Array of size nind containing the number of points where ng[k] . Must satisfy ng[k] . 
x  [in] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data , for . The values of x[k] must be in strictly ascending order. 
z  [in] Array of size N containing the dependent variable data , for . 
epsilon  [in] Array of size N containing the approximation toleraneces , for . Must satisfy for all . If epsilon = NULL, then this function uses . 
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 monotonic spline approximation. Must satisfy spline NULL. 
User Callable Function  Documented 030215
long int AMA_MltvGrdMonoInterp  (  AMA_OPTIONS *  options, 
long int  nind,  
long int *  ng,  
double **  x,  
double *  z,  
long int *  degree,  
AMA_SPLINE **  spline  
) 
Monotonic Interpolation of Multivariate Gridded Data
This function employs cnspla to compute a spline interpolant of independent variable data and dependent variable data . The independent variable data is given as , for and , and it defines the rectilinear grid
The dependent variable data lies on the grid and is given as , for ; that is, there are dependent variable values.
For a given set of data this function employs cnspla to compute the spline
that minimizes
subject to the interpolation constraints
for . Additionally, for each , this function provides the option to impose the local monotonicity constraints
These constraints are imposed at , for all and with . By default the local monotonicity constraints are imposed on the spline in all of its independent variables but the constraints can be disabled in one or more of its independent variables with AMA_OptionsSetMonotonicity().
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The knot vectors are
and they depend on the independent variable data and the degree . If the local monotonicity constraints are requested in the th independent variable, then the knot vector is defined by AMA_LamdaMonoInterp(); otherwise, it is defined by AMA_LamdaInterp(). In either case the knot vector is based on the points .
This function computes a spline which satisfies either the full or reduced continuity condition at the interior grid points, as well as, the interpolation and local monotonicity constraints. The following table summarizes the continuity of with respect to at the interior grid points , for , and the number of coefficients, , for a spline that satisfies either the full or reduced continuity condition. In the table the term
is the th order partial of with respect to evaluated at and defined over the region .
Degree  Full Continuity  Reduced Continuity  

Linear  is continuous for  is continuous for  
Quadratic  is continuous for  is continuous for  
Cubic  is continuous for  is continuous for  
Quartic  is continuous for  is continuous for  
Quintic  is continuous for  is continuous for 
This function employs an efficient algorithm for computing monotonic spline interpolants of multivariate gridded data. The algorithm consists of computing the splines
for . The coefficients of are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The degree is
the number of coefficients is
and the knot vector is
The spline is based on the spline and is defined by setting its coefficents for and . The spline is defined through multiple invocations of AMA_UnvMonoInterp() in the following manner.
First, the spline is defined by invoking AMA_UnvMonoInterp() times to compute the univariate spline
that minimizes
subject to the interpolation constraints
and the local monotonicity constraints
for . Computing the univariate splines , for and , defines the coefficients of .
After computing the splines , for , are defined by invoking AMA_UnvMonoInterp() times to compute the univariate spline
that minimizes
subject to the interpolation constraints
and the local monotonicity constraints
for . Computing the univariate splines , for when and for when , defines the coefficients of .
In total this algorithm consists of invocations of AMA_UnvMonoInterp() to compute a multivariate spline which satisfies the interpolation and local monotonicity constraints.
This function does the following:
Parameter Note: In the parameters description given below the limits on are , k = and N .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvGrdMonoInterp(). 
nind  [in] The number of independent variables . Must satisfy nind AMA_MXNIND. 
ng  [in] Array of size nind containing the number of points where ng[k] . Must satisfy ng[k] . 
x  [in] Array of size nind containing arrays of size ng[k] where x[k] contains the independent variable data , for . The values of x[k] must be in strictly ascending order. 
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 monotonic spline interpolant. Must satisfy spline NULL. 
User Callable Function  Documented 030215
long int AMA_MltvInputCheck  (  AMA_OPTIONS *  options, 
long int  nind,  
long int  n,  
double **  x,  
double *  z,  
double *  wht,  
double *  epsilon,  
long int *  degree,  
long int *  mlamda,  
double **  lamda,  
enum AMA_Boolean  lstsqr  
) 
Perform input check for multivariate data approximation functions.
This function checks the input parameters for the Multivariate Random Data Functions which compute the spline
of degree which is based on the knot vectors , for . Along with the degree the Multivariate Random Data Functions require the independent variable data data , for , and either the weights or the approximation tolerances , for . Also, for least squares approximation functions the knot vectors , for , are required. This function insures the following conditions are satisfied:
Also, if lstsqr equals AMA_Boolean_True and the knot vector is represented by its distinct knot vector
and its knot multiplicity vector
then, for all , this function insures either the conditions
or
are satisfied. It also insures the first and last distinct knots satisfy the conditions and , respectively.
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvInputCheck(). 
nind  [in] The number of independent variables . Must satisfy nind . 
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 . Must satisfy x NULL and x[k] NULL. Also, x[k] must be in ascending order. 
z  [in] Array of size n containing the dependent variable data , for . Must satisfy z NULL. 
wht  [in] Array of size n containing the weights , for . If wht NULL, then must satisfy for all . 
epsilon  [in] Array of size n containing the approximation tolerances , for . If epsilon NULL, then must satisfy for all . 
degree  [in] Array of size nind containing the degree where degree[k] . Must satisfy degree NULL and degree[k] . 
mlamda  [in] Array of size nind containing the number of knots where mlamda[k] . If lstsqr AMA_Boolean_True, then must satisfy mlamda NULL and mlamda[k] . 
lamda  [in] Array of size nind containing arrays of size mlamda[k] where lamda[k] contains the knot vector . If lstsqr equals AMA_Boolean_True, then must satisfy lamda NULL and lamda[k] NULL. Also, lamda[k] must be a valid knot vector. 
lstsqr  [in] Least squares approximation flag. If it equals AMA_Boolean_True, then this function is being called by a least squares approximation function. 
User Support Function  Documented 021116  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
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 "socalled" 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 Bsplines
where are the univariate Bsplines 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:
Parameter Note: In the parameter definitions given below the limits on are and k = .
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. 
User Callable Function  Documented 022416
long int AMA_MltvLstsqr  (  AMA_OPTIONS *  options, 
long int  nind,  
long int  n,  
double **  x,  
double *  z,  
double *  wht,  
long int *  degree,  
long int *  mlamda,  
double **  lamda,  
double  theta,  
AMA_SPLINE **  spline  
) 
Least Squares Approximation of Multivariate Data
This function employs cnspla to compute a least squares spline approximation of independent variable data and dependent variable data . For a given set of independent variable data , dependent variable data and weights , for , this function computes the spline
that minimizes
for . The function imposes a penalty term on the least squares approximation.
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The knot vector is given as
where the knots must satisfy the conditions
If the knot vector is represented by its distinct knot vector
and its knot multiplicity vector
then the aforementioned conditions are
Also the first and last distinct knots must satisfy the conditions and , respectively. In this case the number of knots is .
For convenience this function does not require the definition of the order knots at the left and right hand endpoints and also accepts the knot vector given as
where the knots satisfy the conditions
If the knot vector is represented by its distinct knot vector
and its knot multiplicity vector
then the aforementioned conditions are
As before, the first and last distinct knots must satisfy the conditions and , respectively. In this case the number of knots is .
The function is used to impose a penalty term on the least squares approximation and is defined as
where . The cross partial terms can be excluded from the penalty term with AMA_OptionsSetPenaltyTerm().
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().
Depending on the number and distribution of the knots relative to the independent variable data it is possible for the least squares approximation problem to have a nonunique solution. Hence, this function provides the capability of performing a minimum norm optimization subsequent to computing the least squares approximation. The minimum norm optimization computes an alternate spline by minimizing subject to the approximation constraints
for , where and is the least squares approximation. These constraints insure the condition
that is, the minimum norm optimization does not increase the least squares error.
This function does the following:
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvLstsqr(). 
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 . 
wht  [in] Array of size n containing the weights , for . Must satisfy for all . If wht = NULL, then this function uses for all . 
degree  [in] Array of size nind containing the degree where degree[k] . Must satisfy degree[k] . 
mlamda  [in] Array of size nind containing the number of knots where mlamda[k] . Must satisfy mlamda[k] . 
lamda  [in] Array of size nind containing arrays of size mlamda[k] where lamda[k] contains the knot vector or . 
theta  [in] The penalty term weight . Must satisfy theta . 
spline  [out] Pointer to AMA_SPLINE pointer containing the least squares spline approximation. Must satisfy spline NULL. 
User Callable Function  Documented 101715
long int AMA_MltvMonoApprox  (  AMA_OPTIONS *  options, 
long int  nind,  
long int  n,  
double **  x,  
double *  z,  
double *  epsilon,  
long int *  degree,  
AMA_SPLINE **  spline  
) 
Monotonic Approximation of Multivariate Data
This function employs cnspla to compute a spline approximation of independent variable data and dependent variable data . For a given set of independent variable data , dependent variable data and approximation tolerances , for , this function computes the spline
that minimizes
subject to the approximation constraints
for . The integration region where and , for . This function also imposes constraints on the first order partials for all . These constraints are known as the local monotonicity constraints and they are defined by AMA_MltvConreg().
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The knot vectors are
and they depend on the independent variable data, the degree and the continuity of the spline at the interior data points. They are based on the rectilinear grid upon which the independent variable data lies and they are defined by AMA_LamdaMonoInterp(). That is, the knot vector is defined by AMA_LamdaMonoInterp() 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 approximation and local monotonicity constraints, then AMA_MltvMonoApprox() imposes the bounds
where and . The values of and are defined by minimizing
subject to the constraints
and the aforementioned approximation and local monotonicity constraints. If either or , then AMA_MltvMonoApprox() 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 computes a spline which satisfies either the full or reduced continuity condition at the interior grid points, as well as, the approximation and local monotonicity constraints. The following table summarizes the continuity of with respect to at the interior grid points , for , and the number of coefficients, , for a spline that satisfies either the full or reduced continuity condition. In the table the term
is the th order partial of with respect to evaluated at and defined over the region .
Degree  Full Continuity  Reduced Continuity  

Linear  is continuous for  is continuous for  
Quadratic  is continuous for  is continuous for  
Cubic  is continuous for  is continuous for  
Quartic  is continuous for  is continuous for  
Quintic  is continuous for  is continuous for 
This function does the following:
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvMonoApprox(). 
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 . 
epsilon  [in] Array of size n containing the approximation tolerances , for . Must satisfy for all . If epsilon = NULL, then this function uses for all . 
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 monotonic spline approximation. Must satisfy spline NULL. 
User Callable Function  Documented 022416
long int AMA_MltvMonoInterp  (  AMA_OPTIONS *  options, 
long int  nind,  
long int  n,  
double **  x,  
double *  z,  
long int *  degree,  
AMA_SPLINE **  spline  
) 
Monotonic 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 first order partials for all . These constraints are known as the local monotonicity constraints and they are defined by AMA_MltvConreg().
In the above definition of the , for and , are the coefficients of the tensor product Bsplines
where are the univariate Bsplines of degree defined by the knot vector . The knot vectors are
and they depend on the independent variable data, the degree and the continuity of the spline at the interior data points. They are based on the rectilinear grid upon which the independent variable data lies and they are defined by AMA_LamdaMonoInterp(). That is, the knot vector is defined by AMA_LamdaMonoInterp() 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 approximation and local monotonicity constraints, then AMA_MltvMonoApprox() imposes the bounds
where and . The values of and are defined by minimizing
subject to the constraints
and the aforementioned approximation and local monotonicity constraints. If either or , then AMA_MltvMonoApprox() 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 computes a spline which satisfies either the full or reduced continuity condition at the interior grid points, as well as, the interpolation and local monotonicity constraints. The following table summarizes the continuity of with respect to at the interior grid points , for , and the number of coefficients, , for a spline that satisfies either the full or reduced continuity condition. In the table the term
is the th order partial of with respect to evaluated at and defined over the region .
Degree  Full Continuity  Reduced Continuity  

Linear  is continuous for  is continuous for  
Quadratic  is continuous for  is continuous for  
Cubic  is continuous for  is continuous for  
Quartic  is continuous for  is continuous for  
Quintic  is continuous for  is continuous for 
This function does the following:
Parameter Note: In the parameter definitions given below the limits on are and k = .
options  [in] Pointer to AMA_OPTIONS. Must be initialized with AMA_Options() prior to calling AMA_MltvMonoInterp(). 
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 monotonic spline interpolant. Must satisfy spline NULL. 
User Callable Function  Documented 022416
long int AMA_MltvPnltrm  (  AMA_OPTIONS *  options, 
double  theta,  
long int  porder,  
CNSPLA_SPLFUN *  splfun  
) 
Define penalty term on a multivariate spline.
This function defines a penalty term for or on a multivariate spline given as
where the s, for and , are the coefficients of the tensor product Bsplines
The s are the univariate Bsplines of degree defined by the knot vectors
For the penalty term is
where . Alternately, for the penalty term is
The cross partial terms can be excluded from the penalty term with AMA_OptionsSetPenaltyTerm().
options  [in] Pointer to AMA_OPTIONS. Should be initialized with AMA_Options() prior to calling AMA_MltvPnltrm(). 
theta  [in] The penalty term weight . Should satisfy theta . 
porder  [in] The penalty term order . Should satisfy porder or porder . 
splfun  [in] Pointer to CNSPLA_SPLFUN containing spline upon which penalty term is imposed. Should satisfy splfun NULL. 
User Support Function  Documented 121114  !!!THIS IS NOT A USER CALLABLE FUNCTION  DOCUMENT IS INCLUDED FOR COMPLETENESS!!!
long int AMA_MltvRglrze  (  AMA_OPTIONS *  options, 
CNSPLA_SPLFUN *  splfun  
) 