[SciPy-Dev] Multilinear interpolation

Pablo Winant pablo.winant@gmail....
Thu Feb 21 06:08:46 CST 2013


Continuing a series of thread about interpolation, I have an almost 
ready implementation of multilinear implementation, that is linear 
interpolation in each dimension.  I have been toying with several 

- in pure numpy (quite memory hungry)
- in cython
- using pycuda

Obviously, if there is some interest for it in scipy, it would be a good 
motivation to finish it. There are two main differences with respect to 
the existing interp routine :

- it is independent of fitpack
- it extrapolates linearly while the existing routine returns a constant 
(or NaN)

Now I have some questions about it:

- in this case I several implementations, in the same library that can 
potentially be enabled on different systems (with a compiler, with a 
gpu). I made a python file that tries to import one version after all 
shadowing slower ones by faster ones. It is meant to replicate the 
.m/.mex file behavior of Matlab. Is there a better approach ?
- the cython code is meant to operate on double* inputs, and is limited 
to 4 dimensions. It is however very easy to generate single or higher 
order code. What would you use for that purpose ?



More information about the SciPy-Dev mailing list