numpy  2.0.0
src/multiarray/getset.c File Reference
#include <Python.h>
#include "structmember.h"
#include "numpy/arrayobject.h"
#include "npy_config.h"
#include "npy_pycompat.h"
#include "npy_import.h"
#include "common.h"
#include "scalartypes.h"
#include "descriptor.h"
#include "getset.h"
#include "arrayobject.h"
#include "mem_overlap.h"

Defines

#define PY_SSIZE_T_CLEAN
#define NPY_NO_DEPRECATED_API   NPY_API_VERSION
#define _MULTIARRAYMODULE

Functions

static PyObject * array_ndim_get (PyArrayObject *self)
static PyObject * array_flags_get (PyArrayObject *self)
static PyObject * array_shape_get (PyArrayObject *self)
static int array_shape_set (PyArrayObject *self, PyObject *val)
static PyObject * array_strides_get (PyArrayObject *self)
static int array_strides_set (PyArrayObject *self, PyObject *obj)
static PyObject * array_priority_get (PyArrayObject *self)
static PyObject * array_typestr_get (PyArrayObject *self)
static PyObject * array_descr_get (PyArrayObject *self)
static PyObject * array_protocol_descr_get (PyArrayObject *self)
static PyObject * array_protocol_strides_get (PyArrayObject *self)
static PyObject * array_dataptr_get (PyArrayObject *self)
static PyObject * array_ctypes_get (PyArrayObject *self)
static PyObject * array_interface_get (PyArrayObject *self)
static PyObject * array_data_get (PyArrayObject *self)
static int array_data_set (PyArrayObject *self, PyObject *op)
static PyObject * array_itemsize_get (PyArrayObject *self)
static PyObject * array_size_get (PyArrayObject *self)
static PyObject * array_nbytes_get (PyArrayObject *self)
static int array_descr_set (PyArrayObject *self, PyObject *arg)
static PyObject * array_struct_get (PyArrayObject *self)
static PyObject * array_base_get (PyArrayObject *self)
static PyArrayObject_get_part (PyArrayObject *self, int imag)
static PyObject * array_real_get (PyArrayObject *self)
static int array_real_set (PyArrayObject *self, PyObject *val)
static PyObject * array_imag_get (PyArrayObject *self)
static int array_imag_set (PyArrayObject *self, PyObject *val)
static PyObject * array_flat_get (PyArrayObject *self)
static int array_flat_set (PyArrayObject *self, PyObject *val)
static PyObject * array_transpose_get (PyArrayObject *self)
static PyObject * array_finalize_get (PyArrayObject *NPY_UNUSED(self))

Variables

NPY_NO_EXPORT PyGetSetDef array_getsetlist []

Define Documentation

#define NPY_NO_DEPRECATED_API   NPY_API_VERSION

Function Documentation

static PyArrayObject* _get_part ( PyArrayObject self,
int  imag 
) [static]
Create a view of a complex array with an equivalent data-type except it is real instead of complex.

References PyArray_ISCOMPLEX.

static PyObject* array_base_get ( PyArrayObject self) [static]
static PyObject* array_ctypes_get ( PyArrayObject self) [static]

Referenced by array_transpose_get().

static PyObject* array_data_get ( PyArrayObject self) [static]

References DEPRECATE.

static int array_data_set ( PyArrayObject self,
PyObject *  op 
) [static]
2016-19-02, 1.12
static PyObject* array_dataptr_get ( PyArrayObject self) [static]
static PyObject* array_descr_get ( PyArrayObject self) [static]
static int array_descr_set ( PyArrayObject self,
PyObject *  arg 
) [static]
If the type is changed. Also needing change: strides, itemsize
Either itemsize is exactly the same or the array is single-segment (contiguous or fortran) with compatibile dimensions The shape and strides will be adjusted in that case as well.
check that we are not reinterpreting memory containing Objects.
Allow a void view
But no other flexible types
Deprecate not C contiguous and a dimension changes
11/27/2015 1.11.0
if it is compatible increase the size of the dimension at end (or at the front for NPY_ARRAY_F_CONTIGUOUS)
Determine if last (or first if NPY_ARRAY_F_CONTIGUOUS) dimension is compatible
fall through -- adjust type
create new array object from data and update dimensions, strides and descr from it
We would decref newtype here. temp will steal a reference to it
Fool deallocator not to delete these
static PyObject* array_finalize_get ( PyArrayObject NPY_UNUSEDself) [static]
If this is None, no function call is made
--- default sub-class behavior

References array_priority_get().

static PyObject* array_flags_get ( PyArrayObject self) [static]
static PyObject* array_flat_get ( PyArrayObject self) [static]
static int array_flat_set ( PyArrayObject self,
PyObject *  val 
) [static]
static PyObject* array_imag_get ( PyArrayObject self) [static]
For Object arrays we need to get
and set the imaginary part of each element

References NPY_ARRAY_FORCECAST, PyArray_DESCR, PyArray_FailUnlessWriteable(), PyArray_FORTRAN_IF, PyArray_FromAny(), and PyArray_IterNew().

static int array_imag_set ( PyArrayObject self,
PyObject *  val 
) [static]
static PyObject* array_interface_get ( PyArrayObject self) [static]
dataptr

Referenced by array_transpose_get().

static PyObject* array_itemsize_get ( PyArrayObject self) [static]
static PyObject* array_nbytes_get ( PyArrayObject self) [static]
static PyObject* array_ndim_get ( PyArrayObject self) [static]
************* array attribute get and set routines *************
static PyObject* array_priority_get ( PyArrayObject self) [static]

References PyArray_DESCR.

Referenced by array_finalize_get().

static PyObject* array_protocol_descr_get ( PyArrayObject self) [static]
get default
static PyObject* array_protocol_strides_get ( PyArrayObject self) [static]

References PyArray_DATA.

static PyObject* array_real_get ( PyArrayObject self) [static]
For Object arrays, we need to get and set the
real part of each element.
static int array_real_set ( PyArrayObject self,
PyObject *  val 
) [static]
static PyObject* array_shape_get ( PyArrayObject self) [static]
static int array_shape_set ( PyArrayObject self,
PyObject *  val 
) [static]
Assumes C-order
Free old dimensions and strides
create new dimensions and strides
static PyObject* array_size_get ( PyArrayObject self) [static]
static PyObject* array_strides_get ( PyArrayObject self) [static]
static int array_strides_set ( PyArrayObject self,
PyObject *  obj 
) [static]
Get the available memory through the buffer interface on PyArray_BASE(new) or if that fails from the current new
numbytes == 0 is special here, but the 0-size array case always works
static PyObject* array_struct_get ( PyArrayObject self) [static]
reset unused flags
<blockquote> Copy shape and strides over since these can be reset</blockquote>

System Message: WARNING/2 (<string>, line 2) Block quote ends without a blank line; unexpected unindent.
when the array is "reshaped".

References PyArrayInterface::descr.

static PyObject* array_transpose_get ( PyArrayObject self) [static]
static PyObject* array_typestr_get ( PyArrayObject self) [static]

Variable Documentation