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 "numpy/npy_3kcompat.h"
#include "common.h"
#include "scalartypes.h"
#include "descriptor.h"
#include "getset.h"

Defines

#define PY_SSIZE_T_CLEAN
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX

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 _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#define PY_SSIZE_T_CLEAN

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.

Referenced by array_real_get().

static PyObject* array_base_get ( PyArrayObject self) [static]

References PyArray_DescrNew().

static PyObject* array_ctypes_get ( PyArrayObject self) [static]
static PyObject* array_data_get ( PyArrayObject self) [static]
static int array_data_set ( PyArrayObject self,
PyObject *  op 
) [static]
static PyObject* array_dataptr_get ( PyArrayObject self) [static]

Referenced by array_ctypes_get().

static PyObject* array_descr_get ( PyArrayObject self) [static]

Referenced by array_transpose_get().

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.

Allow a void view
But no other flexible types
if it is compatible increase the size of the dimension at end (or at the front for FORTRAN)
Determine if last (or first if FORTRAN) 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

Referenced by array_transpose_get().

static PyObject* array_finalize_get ( PyArrayObject NPY_UNUSEDself) [static]
If this is None, no function call is made
--- default sub-class behavior
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
static int array_imag_set ( PyArrayObject self,
PyObject *  val 
) [static]
static PyObject* array_interface_get ( PyArrayObject self) [static]

dataptr

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]
static PyObject* array_protocol_descr_get ( PyArrayObject self) [static]

get default

static PyObject* array_protocol_strides_get ( PyArrayObject self) [static]

Referenced by array_ctypes_get().

static PyObject* array_real_get ( PyArrayObject self) [static]
For Object arrays, we need to get and set the
real part of each element.

References _get_part(), Py_TYPE, PyArray_ISCOMPLEX, PyArray_ISFORTRAN, and PyArray_NewFromDescr().

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 new->base or if that fails from the current new

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 ARR_HAS_DESCR, arraydescr_protocol_descr_get(), PyArrayInterface::descr, and PyArrayInterface::flags.

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

Variable Documentation

NPY_NO_EXPORT PyGetSetDef array_getsetlist[]