lagrange_nd, a FORTRAN90 code which is given a set of ND points X(*) in D-dimensional space, and constructs a family of ND Lagrange polynomials P(*)(X), associating polynomial P(i) with point X(i), such that, for 1 <= i <= ND,
P(i)(X(i)) = 1but, if i =/= j
P(i)(X(j)) = 0
The library currently includes the following primary routines:
The set of ND polynomials P(*)(X) are returned as a set of three arrays:
Each value of PE(i,j) is an exponent codes which can be converted to a vector of exponents that define a monomial. For example, if we are working in spatial dimension D=3, then if PE(i,j)=13, the corresponding exponent vector is (0,2,1), so this means that the j-th term in polynomial i is
PC(i,j) * x^0 y^2 z^1An exponent code can be converted to an exponent vector by calling mono_unrank_grlex().
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
lagrange_nd is available in a C++ version and a FORTRAN90 version and a MATLAB version.
LAGRANGE_INTERP_ND, a FORTRAN90 code which defines and evaluates the Lagrange polynomial p(x) which interpolates a set of multivariate data, so that p(x(i)) = y(i).
SPARSE_INTERP_ND a FORTRAN90 code which can be used to define a sparse interpolant to a function f(x) of a multidimensional argument.
TEST_INTERP_ND, a FORTRAN90 code which defines test problems for interpolation of data z(x), depending on an M-dimensional argument.