numpy 2.0.0
src/multiarray/shape.h File Reference

Go to the source code of this file.

Data Structures

struct  _npy_stride_sort_item

Functions

NPY_NO_EXPORT void PyArray_CreateSortedStridePerm (PyArrayObject *arr, _npy_stride_sort_item *strideperm)

Function Documentation

NPY_NO_EXPORT void PyArray_CreateSortedStridePerm ( PyArrayObject arr,
_npy_stride_sort_item strideperm 
)
This function populates the first PyArray_NDIM(arr) elements of strideperm with sorted descending by their absolute values. For example, the stride array (4, -2, 12) becomes [(2, 12), (0, 4), (1, -2)].

Set up the strideperm values
Sort them