numpy  2.0.0
src/multiarray/shape.h
Go to the documentation of this file.
00001 #ifndef _NPY_ARRAY_SHAPE_H_
00002 #define _NPY_ARRAY_SHAPE_H_
00003 
00004 /*
00005  * Builds a string representation of the shape given in 'vals'.
00006  * A negative value in 'vals' gets interpreted as newaxis.
00007  */
00008 NPY_NO_EXPORT PyObject *
00009 build_shape_string(npy_intp n, npy_intp *vals);
00010 
00011 /*
00012  * Creates a sorted stride perm matching the KEEPORDER behavior
00013  * of the NpyIter object. Because this operates based on multiple
00014  * input strides, the 'stride' member of the npy_stride_sort_item
00015  * would be useless and we simply argsort a list of indices instead.
00016  *
00017  * The caller should have already validated that 'ndim' matches for
00018  * every array in the arrays list.
00019  */
00020 NPY_NO_EXPORT void
00021 PyArray_CreateMultiSortedStridePerm(int narrays, PyArrayObject **arrays,
00022                         int ndim, int *out_strideperm);
00023 
00024 /*
00025  * Just like PyArray_Squeeze, but allows the caller to select
00026  * a subset of the size-one dimensions to squeeze out.
00027  */
00028 NPY_NO_EXPORT PyObject *
00029 PyArray_SqueezeSelected(PyArrayObject *self, npy_bool *axis_flags);
00030 
00031 #endif