Using Cython, I try to do this:
cpdef myFun(double[:] array):
cdef int[:] sortIndices = np.argsort(array, kind='mergesort')
array = array[sortIndices]
The compiler complains:
Invalid index for memoryview specified, type int[:]
How do I index this memoryview using an integer array of some sort? Are only slices allowed? I could easily use 'array'-based indexing with the old NumPy array buffer support. (I just adapted my code to use memoryviews to see if it would improve performance, but it actually breaks...)