numpy  2.0.0
src/multiarray/item_selection.h
Go to the documentation of this file.
00001 #ifndef _NPY_PRIVATE__ITEM_SELECTION_H_
00002 #define _NPY_PRIVATE__ITEM_SELECTION_H_
00003 
00004 /*
00005  * Counts the number of True values in a raw boolean array. This
00006  * is a low-overhead function which does no heap allocations.
00007  *
00008  * Returns -1 on error.
00009  */
00010 NPY_NO_EXPORT npy_intp
00011 count_boolean_trues(int ndim, char *data, npy_intp *ashape, npy_intp *astrides);
00012 
00013 /*
00014  * Gets a single item from the array, based on a single multi-index
00015  * array of values, which must be of length PyArray_NDIM(self).
00016  */
00017 NPY_NO_EXPORT PyObject *
00018 PyArray_MultiIndexGetItem(PyArrayObject *self, npy_intp *multi_index);
00019 
00020 /*
00021  * Sets a single item in the array, based on a single multi-index
00022  * array of values, which must be of length PyArray_NDIM(self).
00023  *
00024  * Returns 0 on success, -1 on failure.
00025  */
00026 NPY_NO_EXPORT int
00027 PyArray_MultiIndexSetItem(PyArrayObject *self, npy_intp *multi_index,
00028                                                 PyObject *obj);
00029 
00030 #endif