numpy  2.0.0
src/multiarray/item_selection.h File Reference

Go to the source code of this file.

Functions

NPY_NO_EXPORT npy_intp count_boolean_trues (int ndim, char *data, npy_intp *ashape, npy_intp *astrides)
NPY_NO_EXPORT PyObject * PyArray_MultiIndexGetItem (PyArrayObject *self, npy_intp *multi_index)
NPY_NO_EXPORT int PyArray_MultiIndexSetItem (PyArrayObject *self, npy_intp *multi_index, PyObject *obj)

Function Documentation

NPY_NO_EXPORT npy_intp count_boolean_trues ( int  ndim,
char *  data,
npy_intp ashape,
npy_intp astrides 
)
Counts the number of True values in a raw boolean array. This is a low-overhead function which does no heap allocations.
Returns -1 on error.
Use raw iteration with no heap memory allocation
Handle zero-sized array
Special case for contiguous inner loop
Process the innermost dimension
General inner loop
Process the innermost dimension
NPY_NO_EXPORT PyObject* PyArray_MultiIndexGetItem ( PyArrayObject self,
npy_intp multi_index 
)
Gets a single item from the array, based on a single multi-index array of values, which must be of length PyArray_NDIM(self).
Get the data pointer
NPY_NO_EXPORT int PyArray_MultiIndexSetItem ( PyArrayObject self,
npy_intp multi_index,
PyObject *  obj 
)
Sets a single item in the array, based on a single multi-index array of values, which must be of length PyArray_NDIM(self).
Returns 0 on success, -1 on failure.
Get the data pointer