Defines |
#define | PY_SSIZE_T_CLEAN |
#define | NPY_NO_DEPRECATED_API NPY_API_VERSION |
#define | _MULTIARRAYMODULE |
#define | NEWAXIS_INDEX -1 |
#define | ELLIPSIS_INDEX -2 |
#define | SINGLE_INDEX -3 |
#define | _INF_SET_PTR(c) |
#define | _NPY_IS_EVEN(x) ((x) % 2 == 0) |
#define | _INF_SET_PTR_MIRROR(c) |
#define | _INF_SET_PTR_CIRCULAR(c) |
Functions |
static int | coerce_index (PyObject *o, npy_intp *v) |
NPY_NO_EXPORT npy_intp | parse_index_entry (PyObject *op, npy_intp *step_size, npy_intp *n_steps, npy_intp max, int axis, int check_index) |
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) |
static char * | get_ptr_simple (PyArrayIterObject *iter, npy_intp *coordinates) |
static PyObject * | array_iter_base_init (PyArrayIterObject *it, PyArrayObject *ao) |
static void | array_iter_base_dealloc (PyArrayIterObject *it) |
NPY_NO_EXPORT PyObject * | PyArray_IterNew (PyObject *obj) |
NPY_NO_EXPORT PyObject * | PyArray_BroadcastToShape (PyObject *obj, npy_intp *dims, int nd) |
NPY_NO_EXPORT PyObject * | PyArray_IterAllButAxis (PyObject *obj, int *inaxis) |
NPY_NO_EXPORT int | PyArray_RemoveSmallest (PyArrayMultiIterObject *multi) |
static PyObject * | arrayiter_next (PyArrayIterObject *it) |
static void | arrayiter_dealloc (PyArrayIterObject *it) |
static Py_ssize_t | iter_length (PyArrayIterObject *self) |
static PyArrayObject * | iter_subscript_Bool (PyArrayIterObject *self, PyArrayObject *ind) |
static PyObject * | iter_subscript_int (PyArrayIterObject *self, PyArrayObject *ind) |
NPY_NO_EXPORT PyObject * | iter_subscript (PyArrayIterObject *self, PyObject *ind) |
static int | iter_ass_sub_Bool (PyArrayIterObject *self, PyArrayObject *ind, PyArrayIterObject *val, int swap) |
static int | iter_ass_sub_int (PyArrayIterObject *self, PyArrayObject *ind, PyArrayIterObject *val, int swap) |
NPY_NO_EXPORT int | iter_ass_subscript (PyArrayIterObject *self, PyObject *ind, PyObject *val) |
static PyArrayObject * | iter_array (PyArrayIterObject *it, PyObject *NPY_UNUSED(op)) |
static PyObject * | iter_copy (PyArrayIterObject *it, PyObject *args) |
static PyObject * | iter_richcompare (PyArrayIterObject *self, PyObject *other, int cmp_op) |
static PyObject * | iter_coords_get (PyArrayIterObject *self) |
NPY_NO_EXPORT int | PyArray_Broadcast (PyArrayMultiIterObject *mit) |
NPY_NO_EXPORT PyObject * | PyArray_MultiIterFromObjects (PyObject **mps, int n, int nadd,...) |
NPY_NO_EXPORT PyObject * | PyArray_MultiIterNew (int n,...) |
static PyObject * | arraymultiter_new (PyTypeObject *NPY_UNUSED(subtype), PyObject *args, PyObject *kwds) |
static PyObject * | arraymultiter_next (PyArrayMultiIterObject *multi) |
static void | arraymultiter_dealloc (PyArrayMultiIterObject *multi) |
static PyObject * | arraymultiter_size_get (PyArrayMultiIterObject *self) |
static PyObject * | arraymultiter_index_get (PyArrayMultiIterObject *self) |
static PyObject * | arraymultiter_shape_get (PyArrayMultiIterObject *self) |
static PyObject * | arraymultiter_iters_get (PyArrayMultiIterObject *self) |
static PyObject * | arraymultiter_reset (PyArrayMultiIterObject *self, PyObject *args) |
static void | neighiter_dealloc (PyArrayNeighborhoodIterObject *iter) |
static char * | _set_constant (PyArrayNeighborhoodIterObject *iter, PyArrayObject *fill) |
static char * | get_ptr_constant (PyArrayIterObject *_iter, npy_intp *coordinates) |
static NPY_INLINE npy_intp | __npy_pos_remainder (npy_intp i, npy_intp n) |
static char * | get_ptr_mirror (PyArrayIterObject *_iter, npy_intp *coordinates) |
static NPY_INLINE npy_intp | __npy_euclidean_division (npy_intp i, npy_intp n) |
static char * | get_ptr_circular (PyArrayIterObject *_iter, npy_intp *coordinates) |
NPY_NO_EXPORT PyObject * | PyArray_NeighborhoodIterNew (PyArrayIterObject *x, npy_intp *bounds, int mode, PyArrayObject *fill) |
Variables |
static PyMappingMethods | iter_as_mapping |
static PyMethodDef | iter_methods [] |
static PyMemberDef | iter_members [] |
static PyGetSetDef | iter_getsets [] |
NPY_NO_EXPORT PyTypeObject | PyArrayIter_Type |
static PyGetSetDef | arraymultiter_getsetlist [] |
static PyMemberDef | arraymultiter_members [] |
static PyMethodDef | arraymultiter_methods [] |
NPY_NO_EXPORT PyTypeObject | PyArrayMultiIter_Type |
NPY_NO_EXPORT PyTypeObject | PyArrayNeighborhoodIter_Type |
For an array x of dimension n, and given index i, returns j, 0 <= j < n such as x[i] = x[j], with x assumed to be mirrored. For example, for x = {1, 2, 3} (n = 3)
index -5 -4 -3 -2 -1 0 1 2 3 4 5 6 value 2 3 3 2 1 1 2 3 3 2 1 1
_npy_pos_index_mirror(4, 3) will return 1, because x[4] = x[1]
Mirror i such as it is guaranteed to be positive
compute k and l such as i = k * n + l, 0 <= l < k
END of Array Iterator *
- Adjust dimensionality and strides for index object iterators
- --- i.e. broadcast
Discover the broadcast number of dimensions
Discover the broadcast shape in each dimension
This prepends 1 to shapes not already equal to nd
Reset the iterator dimensions and strides of each iterator object -- using 0 valued strides for broadcasting Need to check for overflow
If this dimension was added or shape of underlying array was 1
fill and x->ao should have equivalent types
A Neighborhood Iterator object.
Compute the neighborhood size and copy the shape
limits keep track of valid ranges for the neighborhood: if a bound of the neighborhood is outside the array, then limits is the same as boundaries. On the contrary, if a bound is strictly inside the array, then limits correspond to the array range. For example, for an array [1, 2, 3], if bounds are [-1, 3], limits will be [-1, 3], but if bounds are [1, 2], then limits will be [0, 2].
This is used by neighborhood iterators stacked on top of this one
New reference in returned value of _set_constant if array object
XXX: we force x iterator to be non contiguous because we need coordinates... Modifying the iterator here is not great