numpy  2.0.0
src/multiarray/iterators.h File Reference

Go to the source code of this file.

Functions

NPY_NO_EXPORT int parse_index (PyArrayObject *self, PyObject *op, npy_intp *out_dimensions, npy_intp *out_strides, npy_intp *out_offset, int check_index)
NPY_NO_EXPORT PyObject * iter_subscript (PyArrayIterObject *, PyObject *)
NPY_NO_EXPORT int iter_ass_subscript (PyArrayIterObject *, PyObject *, PyObject *)

Function Documentation

NPY_NO_EXPORT int iter_ass_subscript ( PyArrayIterObject ,
PyObject *  ,
PyObject *   
)
Check for Boolean -- this is first becasue Bool is a subclass of Int
Check Slice
Integer
convert to INTP array if Integer array scalar or List
Check for Boolean object
Check for integer array
NPY_NO_EXPORT PyObject* iter_subscript ( PyArrayIterObject self,
PyObject *  ind 
)
Always returns arrays
Tuples >1d not accepted --- i.e. no newaxis Could implement this with adjusted strides and dimensions in iterator Check for Boolean -- this is first because Bool is a subclass of Int

<

empty array
Check for Integer or Slice

<

Integer
convert to INTP array if Integer array scalar or List
Check for Boolean object
Check for integer array
NPY_NO_EXPORT int parse_index ( PyArrayObject self,
PyObject *  op,
npy_intp out_dimensions,
npy_intp out_strides,
npy_intp out_offset,
int  check_index 
)
Parses an index that has no fancy indexing. Populates out_dimensions, out_strides, and out_offset.
this relies on the fact that n==1 for loop below

References ELLIPSIS_INDEX, NEWAXIS_INDEX, parse_index_entry(), PyArray_DIMS, PyArray_NDIM, PyArray_STRIDES, and SINGLE_INDEX.