[SciPy-User] how can I create B-splines of mutidimensional values?

Zachary Pincus zachary.pincus@yale....
Mon Nov 28 12:42:44 CST 2011


>> You could then, as I mentioned, write a Cython module to erect all the
>> "infrastructure" in parallel to do the interpolation,
> 
> (gulp)
> 
> I may need another few years until I'm THAT advaced...
> I've just learnt a bit of swig and I'm not really so keen on learning yet
> another interface generator

Haha... cython is actually less scary than all that. It's more a python-like language that can be "compiled" to C, and which transparently interfaces with normal python code. After adding a few type annotations, it's really easy to write loops that operate on numpy arrays at C-ish speed.


>> or perhaps you could even figure out how to vectorize it in pure numpy.
>> (Perhaps that's not hard to do...)
> 
> My suspicion.
> 
>> If you do either, definitely drop a line to the list because I'm sure
>> folks might be interested in the code.
> 
> sure will. It should make a difference to all applications along these lines - I
> mean, how do they go on about RGB images? do each channel separately? Someone
> must have thought of exploiting the obvious redundancies.

Probably, but they might not have been writing in Python! After all, 3x slower doesn't change the big-O complexity, and for most tasks that's often going to be fine. I mean, everything equal it's always better to have faster, more general tools, but there's an API complexity cost, and someone needs to write the code, etc. etc. etc...

Zach


More information about the SciPy-User mailing list