numpy 2.0.0
src/multiarray/flagsobject.c File Reference
#include <Python.h>
#include "structmember.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_config.h"
#include "numpy/npy_3kcompat.h"
#include "common.h"

Defines

#define PY_SSIZE_T_CLEAN
#define NPY_NO_DEPRECATED_API
#define _MULTIARRAYMODULE
#define NPY_NO_PREFIX
#define _define_get(UPPER, lower)

Functions

static int _IsContiguous (PyArrayObject *ap)
static int _IsFortranContiguous (PyArrayObject *ap)
NPY_NO_EXPORT PyObject * PyArray_NewFlagsObject (PyObject *obj)
NPY_NO_EXPORT void PyArray_UpdateFlags (PyArrayObject *ret, int flagmask)
static void arrayflags_dealloc (PyArrayFlagsObject *self)
 _define_get (NPY_ARRAY_C_CONTIGUOUS, contiguous)
static PyObject * arrayflags_fnc_get (PyArrayFlagsObject *self)
static PyObject * arrayflags_farray_get (PyArrayFlagsObject *self)
static PyObject * arrayflags_num_get (PyArrayFlagsObject *self)
static int arrayflags_updateifcopy_set (PyArrayFlagsObject *self, PyObject *obj)
static int arrayflags_aligned_set (PyArrayFlagsObject *self, PyObject *obj)
static int arrayflags_writeable_set (PyArrayFlagsObject *self, PyObject *obj)
static PyObject * arrayflags_getitem (PyArrayFlagsObject *self, PyObject *ind)
static int arrayflags_setitem (PyArrayFlagsObject *self, PyObject *ind, PyObject *item)
static char * _torf_ (int flags, int val)
static PyObject * arrayflags_print (PyArrayFlagsObject *self)
static int arrayflags_compare (PyArrayFlagsObject *self, PyArrayFlagsObject *other)
static PyObject * arrayflags_richcompare (PyObject *self, PyObject *other, int cmp_op)
static PyObject * arrayflags_new (PyTypeObject *NPY_UNUSED(self), PyObject *args, PyObject *NPY_UNUSED(kwds))

Variables

static PyGetSetDef arrayflags_getsets []
static PyMappingMethods arrayflags_as_mapping
NPY_NO_EXPORT PyTypeObject PyArrayFlags_Type

Define Documentation

#define _define_get (   UPPER,
  lower 
)
Value:
static PyObject *                                                   \
    arrayflags_ ## lower ## _get(PyArrayFlagsObject *self)              \
    {                                                                   \
        PyObject *item;                                                 \
        item = ((self->flags & (UPPER)) == (UPPER)) ? Py_True : Py_False; \
        Py_INCREF(item);                                                \
        return item;                                                    \
    }
#define _MULTIARRAYMODULE
#define NPY_NO_DEPRECATED_API
#define NPY_NO_PREFIX
#define PY_SSIZE_T_CLEAN

Function Documentation

_define_get ( NPY_ARRAY_C_CONTIGUOUS  ,
contiguous   
)
static int _IsContiguous ( PyArrayObject ap) [static]
Check whether the given array is stored contiguously (row-wise) in memory.
0-strided arrays are not contiguous (even if dimension == 1)

contiguous by definition

Referenced by PyArray_UpdateFlags().

static int _IsFortranContiguous ( PyArrayObject ap) [static]
0-strided arrays are not contiguous (even if dimension == 1)

fortran contiguous by definition

Referenced by PyArray_UpdateFlags().

static char* _torf_ ( int  flags,
int  val 
) [static]
static int arrayflags_aligned_set ( PyArrayFlagsObject self,
PyObject *  obj 
) [static]
static int arrayflags_compare ( PyArrayFlagsObject self,
PyArrayFlagsObject other 
) [static]

References PyArrayFlags_Type.

static void arrayflags_dealloc ( PyArrayFlagsObject self) [static]
static PyObject* arrayflags_farray_get ( PyArrayFlagsObject self) [static]
static PyObject* arrayflags_fnc_get ( PyArrayFlagsObject self) [static]
static PyObject* arrayflags_getitem ( PyArrayFlagsObject self,
PyObject *  ind 
) [static]
static PyObject* arrayflags_new ( PyTypeObject *  NPY_UNUSEDself,
PyObject *  args,
PyObject *  NPY_UNUSEDkwds 
) [static]
static PyObject* arrayflags_num_get ( PyArrayFlagsObject self) [static]
static PyObject* arrayflags_print ( PyArrayFlagsObject self) [static]
static PyObject* arrayflags_richcompare ( PyObject *  self,
PyObject *  other,
int  cmp_op 
) [static]
static int arrayflags_setitem ( PyArrayFlagsObject self,
PyObject *  ind,
PyObject *  item 
) [static]
static int arrayflags_updateifcopy_set ( PyArrayFlagsObject self,
PyObject *  obj 
) [static]
relies on setflags order being write, align, uic
static int arrayflags_writeable_set ( PyArrayFlagsObject self,
PyObject *  obj 
) [static]
NPY_NO_EXPORT PyObject* PyArray_NewFlagsObject ( PyObject *  obj)
NPY_NO_EXPORT void PyArray_UpdateFlags ( PyArrayObject ret,
int  flagmask 
)
Update Several Flags at once.

This is not checked by default WRITEABLE is not part of UPDATE_ALL

References _IsAligned(), _IsContiguous(), _IsFortranContiguous(), _IsWriteable(), PyArrayObject::flags, PyArrayObject::nd, NPY_ARRAY_ALIGNED, NPY_ARRAY_C_CONTIGUOUS, NPY_ARRAY_F_CONTIGUOUS, and NPY_ARRAY_WRITEABLE.


Variable Documentation

PyMappingMethods arrayflags_as_mapping [static]
Initial value:
 {






    (inquiry)NULL,                       

    (binaryfunc)arrayflags_getitem,      
    (objobjargproc)arrayflags_setitem,   
}
PyGetSetDef arrayflags_getsets[] [static]
NPY_NO_EXPORT PyTypeObject PyArrayFlags_Type