numpy  2.0.0
src/multiarray/array_assign.c File Reference
#include <Python.h>
#include <numpy/ndarraytypes.h>
#include "npy_config.h"
#include "npy_pycompat.h"
#include "shape.h"
#include "array_assign.h"

Defines

#define PY_SSIZE_T_CLEAN
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define _MULTIARRAYMODULE

Functions

NPY_NO_EXPORT int broadcast_strides (int ndim, npy_intp *shape, int strides_ndim, npy_intp *strides_shape, npy_intp *strides, char *strides_name, npy_intp *out_strides)
NPY_NO_EXPORT int raw_array_is_aligned (int ndim, char *data, npy_intp *strides, int alignment)
NPY_NO_EXPORT void get_array_memory_extents (PyArrayObject *arr, npy_uintp *out_start, npy_uintp *out_end)
NPY_NO_EXPORT int arrays_overlap (PyArrayObject *arr1, PyArrayObject *arr2)

Define Documentation

#define NPY_NO_DEPRECATED_API   NPY_API_VERSION

Function Documentation

Returns 1 if the arrays have overlapping data, 0 otherwise
NPY_NO_EXPORT int broadcast_strides ( int  ndim,
npy_intp shape,
int  strides_ndim,
npy_intp strides_shape,
npy_intp strides,
char *  strides_name,
npy_intp out_strides 
)
See array_assign.h for parameter documentation
Can't broadcast to fewer dimensions
Process from the end to the start, so that 'strides' and 'out_strides' can point to the same memory.
If it doesn't have dimension one, it must match
New dimensions get a zero stride

References build_shape_string(), PyUString_ConcatAndDel, PyUString_FromFormat, and PyUString_FromString.

NPY_NO_EXPORT void get_array_memory_extents ( PyArrayObject arr,
npy_uintp out_start,
npy_uintp out_end 
)
Gets a half-open range [start, end) which contains the array data
Calculate with a closed range [start, end]
If the array size is zero, return an empty range
Expand either upwards or downwards depending on stride
Return a half-open range
NPY_NO_EXPORT int raw_array_is_aligned ( int  ndim,
char *  data,
npy_intp strides,
int  alignment 
)
See array_assign.h for parameter documentation

References PyArray_DATA, PyArray_DIMS, PyArray_NDIM, and PyArray_STRIDES.

Referenced by raw_array_assign_array(), and raw_array_assign_scalar().