3 Dec
2010
3 Dec
'10
3:42 p.m.
It's hard to write Cython code that can handle all dtypes and arbitrary number of dimensions. The former is typically dealt with using templates, but what do people do about the latter?
There are number of ways to do it. NumPy's C API has an iterator that returns an axis on demand. Mine just collects an array with pointers to the first element in each axis. The latter is more friendly to parallelization (OpenMP or Python threads with released GIL), which is why I wrote it, otherwise it has no advantage over NumPy's. Sturla