spotengineer.blogg.se

Matlab interp1 c code
Matlab interp1 c code











matlab interp1 c code

#include #include "linterp.h" // return an evenly spaced 1-d grid of doubles. Davies (1996), "Multidimensional Triangulation and Interpolation for Reinforcement Learning", Proceedings of Neural Information Processing Systems 1996.Weiser & Zarantonello (1988), "A Note on Piecewise Linear and Multilinear Table Interpolation in Many Dimensions", Mathematics of Computation 50 (181), p.If a reference-counting scheme is used for the memory containing the underlying data, an optional reference-counting type may be passed as a template parameter.įor a description of the two interpolation algorithms, see: The underlying data may be shared or copied. The number type is user-specified as a template parameter. Compared to the multilinear algorithm, this becomes much faster in higher dimensions, at the cost of decreased accuracy (since less neighboring points are used to control the interpolated value). Each hypercube of the rectangular grid is split into simplices the simplex containing a point x is determined by sorting the coordinates of x. Simplicial: This uses the values at the N+1 vertices of the N-dimensional simplex containing the point.In two dimensions, this is equivalent to bilinear interpolation in 3 dimensions, trilinear, etc. Multilinear: This uses the values at the 2^N vertices of the N-dimensional hypercube containing the point.Two algorithms for computing the interpolated value are available: Arbitrary dimensions are supported, but the number of dimensions must be specified as a template parameter at compile time. For interpolation on unstructured data, take a look at delaunay_linterp. Linterp is a C++ header-only library for N-dimensional linear interpolation on a rectangular grid, similar to Matlab's interpn command.













Matlab interp1 c code