#include <AMA.h>
Functions | |
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_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 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 . 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 B-splines
where are the univariate B-splines 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