numpy 2.0.0
include/numpy/ndarraytypes.h File Reference
#include "numpyconfig.h"
#include "npy_common.h"
#include "npy_endian.h"
#include "npy_cpu.h"
#include "utils.h"
#include "_neighborhood_iterator_imp.h"
#include "npy_deprecated_api.h"

Go to the source code of this file.

Data Structures

struct  PyArray_Dims
struct  PyArray_ArrFuncs
struct  _PyArray_Descr
struct  _arr_descr
struct  PyArrayObject
struct  PyArrayFlagsObject
struct  PyArray_Chunk
struct  PyArray_DatetimeMetaData
struct  npy_datetimestruct
struct  npy_timedeltastruct
struct  PyArrayIterObject_tag
struct  PyArrayMultiIterObject
struct  PyArrayMapIterObject
struct  PyArrayNeighborhoodIterObject
struct  NpyAuxData_tag
struct  PyArrayInterface

Defines

#define NPY_NO_EXPORT   static
#define NPY_ALLOW_THREADS   0
#define NPY_MAXDIMS   32
#define NPY_MAXARGS   32
#define NPY_FAIL   0
#define NPY_SUCCEED   1
#define NPY_VERSION   NPY_ABI_VERSION
#define NPY_FEATURE_VERSION   NPY_API_VERSION
#define NPY_METADATA_DTSTR   "__timeunit__"
#define NPY_PRIORITY   0.0
#define NPY_SUBTYPE_PRIORITY   1.0
#define NPY_SCALAR_PRIORITY   -1000000.0
#define NPY_NUM_FLOATTYPE   3
#define NPY_NSORTS   (NPY_MERGESORT + 1)
#define NPY_NSEARCHSIDES   (NPY_SEARCHRIGHT + 1)
#define NPY_NSCALARKINDS   (NPY_OBJECT_SCALAR + 1)
#define NPY_DATETIME_NAT   NPY_MIN_INT64
#define NPY_DATETIME_MAX_ISO8601_STRLEN   (21+3*5+1+3*6+6+1)
#define NPY_DATETIME_NUMUNITS   (NPY_FR_GENERIC + 1)
#define NPY_DATETIME_DEFAULTUNIT   NPY_FR_GENERIC
#define NPY_STR_Y   "Y"
#define NPY_STR_M   "M"
#define NPY_STR_W   "W"
#define NPY_STR_D   "D"
#define NPY_STR_h   "h"
#define NPY_STR_m   "m"
#define NPY_STR_s   "s"
#define NPY_STR_ms   "ms"
#define NPY_STR_us   "us"
#define NPY_STR_ns   "ns"
#define NPY_STR_ps   "ps"
#define NPY_STR_fs   "fs"
#define NPY_STR_as   "as"
#define NPY_ERR(str)   fprintf(stderr, #str); fflush(stderr);
#define NPY_ERR2(str)   fprintf(stderr, str); fflush(stderr);
#define NPY_STRINGIFY(x)   #x
#define NPY_TOSTRING(x)   NPY_STRINGIFY(x)
#define PyDataMem_NEW(size)   ((char *)malloc(size))
#define PyDataMem_FREE(ptr)   free(ptr)
#define PyDataMem_RENEW(ptr, size)   ((char *)realloc(ptr,size))
#define NPY_USE_PYMEM   1
#define PyArray_malloc   PyMem_Malloc
#define PyArray_free   PyMem_Free
#define PyArray_realloc   PyMem_Realloc
#define PyDimMem_NEW(size)   ((npy_intp *)PyArray_malloc(size*sizeof(npy_intp)))
#define PyDimMem_FREE(ptr)   PyArray_free(ptr)
#define PyDimMem_RENEW(ptr, size)   ((npy_intp *)PyArray_realloc(ptr,size*sizeof(npy_intp)))
#define NPY_ITEM_REFCOUNT   0x01
#define NPY_ITEM_HASOBJECT   0x01
#define NPY_LIST_PICKLE   0x02
#define NPY_ITEM_IS_POINTER   0x04
#define NPY_NEEDS_INIT   0x08
#define NPY_NEEDS_PYAPI   0x10
#define NPY_USE_GETITEM   0x20
#define NPY_USE_SETITEM   0x40
#define NPY_ALIGNED_STRUCT   0x80
#define NPY_FROM_FIELDS
#define NPY_OBJECT_DTYPE_FLAGS
#define PyDataType_FLAGCHK(dtype, flag)   (((dtype)->flags & (flag)) == (flag))
#define PyDataType_REFCHK(dtype)   PyDataType_FLAGCHK(dtype, NPY_ITEM_REFCOUNT)
#define NPY_ARRAY_C_CONTIGUOUS   0x0001
#define NPY_ARRAY_F_CONTIGUOUS   0x0002
#define NPY_ARRAY_OWNDATA   0x0004
#define NPY_ARRAY_FORCECAST   0x0010
#define NPY_ARRAY_ENSURECOPY   0x0020
#define NPY_ARRAY_ENSUREARRAY   0x0040
#define NPY_ARRAY_ELEMENTSTRIDES   0x0080
#define NPY_ARRAY_ALIGNED   0x0100
#define NPY_ARRAY_NOTSWAPPED   0x0200
#define NPY_ARRAY_WRITEABLE   0x0400
#define NPY_ARRAY_UPDATEIFCOPY   0x1000
#define NPY_ARRAY_BEHAVED
#define NPY_ARRAY_BEHAVED_NS
#define NPY_ARRAY_CARRAY
#define NPY_ARRAY_CARRAY_RO
#define NPY_ARRAY_FARRAY
#define NPY_ARRAY_FARRAY_RO
#define NPY_ARRAY_DEFAULT   (NPY_ARRAY_CARRAY)
#define NPY_ARRAY_IN_ARRAY   (NPY_ARRAY_CARRAY_RO)
#define NPY_ARRAY_OUT_ARRAY   (NPY_ARRAY_CARRAY)
#define NPY_ARRAY_INOUT_ARRAY
#define NPY_ARRAY_IN_FARRAY   (NPY_ARRAY_FARRAY_RO)
#define NPY_ARRAY_OUT_FARRAY   (NPY_ARRAY_FARRAY)
#define NPY_ARRAY_INOUT_FARRAY
#define NPY_ARRAY_UPDATE_ALL
#define NPY_ARR_HAS_DESCR   0x0800
#define NPY_MIN_BUFSIZE   ((int)sizeof(cdouble))
#define NPY_MAX_BUFSIZE   (((int)sizeof(cdouble))*1000000)
#define NPY_BUFSIZE   8192
#define PyArray_MAX(a, b)   (((a)>(b))?(a):(b))
#define PyArray_MIN(a, b)   (((a)<(b))?(a):(b))
#define PyArray_CLT(p, q)
#define PyArray_CGT(p, q)
#define PyArray_CLE(p, q)
#define PyArray_CGE(p, q)
#define PyArray_CEQ(p, q)   (((p).real==(q).real) && ((p).imag == (q).imag))
#define PyArray_CNE(p, q)   (((p).real!=(q).real) || ((p).imag != (q).imag))
#define PyArray_CHKFLAGS(m, FLAGS)   ((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS))
#define PyArray_ISCONTIGUOUS(m)   PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS)
#define PyArray_ISWRITEABLE(m)   PyArray_CHKFLAGS(m, NPY_ARRAY_WRITEABLE)
#define PyArray_ISALIGNED(m)   PyArray_CHKFLAGS(m, NPY_ARRAY_ALIGNED)
#define PyArray_IS_C_CONTIGUOUS(m)   PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS)
#define PyArray_IS_F_CONTIGUOUS(m)   PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS)
#define NPY_BEGIN_ALLOW_THREADS
#define NPY_END_ALLOW_THREADS
#define NPY_BEGIN_THREADS_DEF
#define NPY_BEGIN_THREADS
#define NPY_END_THREADS
#define NPY_BEGIN_THREADS_DESCR(dtype)
#define NPY_END_THREADS_DESCR(dtype)
#define NPY_ALLOW_C_API_DEF
#define NPY_ALLOW_C_API
#define NPY_DISABLE_C_API
#define NPY_ITER_C_INDEX   0x00000001
#define NPY_ITER_F_INDEX   0x00000002
#define NPY_ITER_MULTI_INDEX   0x00000004
#define NPY_ITER_EXTERNAL_LOOP   0x00000008
#define NPY_ITER_COMMON_DTYPE   0x00000010
#define NPY_ITER_REFS_OK   0x00000020
#define NPY_ITER_ZEROSIZE_OK   0x00000040
#define NPY_ITER_REDUCE_OK   0x00000080
#define NPY_ITER_RANGED   0x00000100
#define NPY_ITER_BUFFERED   0x00000200
#define NPY_ITER_GROWINNER   0x00000400
#define NPY_ITER_DELAY_BUFALLOC   0x00000800
#define NPY_ITER_DONT_NEGATE_STRIDES   0x00001000
#define NPY_ITER_READWRITE   0x00010000
#define NPY_ITER_READONLY   0x00020000
#define NPY_ITER_WRITEONLY   0x00040000
#define NPY_ITER_NBO   0x00080000
#define NPY_ITER_ALIGNED   0x00100000
#define NPY_ITER_CONTIG   0x00200000
#define NPY_ITER_COPY   0x00400000
#define NPY_ITER_UPDATEIFCOPY   0x00800000
#define NPY_ITER_ALLOCATE   0x01000000
#define NPY_ITER_NO_SUBTYPE   0x02000000
#define NPY_ITER_VIRTUAL   0x04000000
#define NPY_ITER_NO_BROADCAST   0x08000000
#define NPY_ITER_WRITEMASKED   0x10000000
#define NPY_ITER_ARRAYMASK   0x20000000
#define NPY_ITER_GLOBAL_FLAGS   0x0000ffff
#define NPY_ITER_PER_OP_FLAGS   0xffff0000
#define PyArrayIter_Check(op)   PyObject_TypeCheck(op, &PyArrayIter_Type)
#define _PyAIT(it)   ((PyArrayIterObject *)(it))
#define PyArray_ITER_RESET(it)
#define _PyArray_ITER_NEXT1(it)
#define _PyArray_ITER_NEXT2(it)
#define _PyArray_ITER_NEXT3(it)
#define PyArray_ITER_NEXT(it)
#define PyArray_ITER_GOTO(it, destination)
#define PyArray_ITER_GOTO1D(it, ind)
#define PyArray_ITER_DATA(it)   ((void *)(_PyAIT(it)->dataptr))
#define PyArray_ITER_NOTDONE(it)   (_PyAIT(it)->index < _PyAIT(it)->size)
#define _PyMIT(m)   ((PyArrayMultiIterObject *)(m))
#define PyArray_MultiIter_RESET(multi)
#define PyArray_MultiIter_NEXT(multi)
#define PyArray_MultiIter_GOTO(multi, dest)
#define PyArray_MultiIter_GOTO1D(multi, ind)
#define PyArray_MultiIter_DATA(multi, i)   ((void *)(_PyMIT(multi)->iters[i]->dataptr))
#define PyArray_MultiIter_NEXTi(multi, i)   PyArray_ITER_NEXT(_PyMIT(multi)->iters[i])
#define PyArray_MultiIter_NOTDONE(multi)   (_PyMIT(multi)->index < _PyMIT(multi)->size)
#define _NPY_INCLUDE_NEIGHBORHOOD_IMP
#define NPY_DEFAULT_TYPE   NPY_DOUBLE
#define PyArray_NDIM(obj)   (((PyArrayObject *)(obj))->nd)
#define PyArray_ISONESEGMENT(m)
#define PyArray_ISFORTRAN(m)
#define PyArray_FORTRAN_IF(m)
#define FORTRAN_IF   PyArray_FORTRAN_IF
#define PyArray_DATA(obj)   ((void *)(((PyArrayObject *)(obj))->data))
#define PyArray_BYTES(obj)   (((PyArrayObject *)(obj))->data)
#define PyArray_DIMS(obj)   (((PyArrayObject *)(obj))->dimensions)
#define PyArray_STRIDES(obj)   (((PyArrayObject *)(obj))->strides)
#define PyArray_DIM(obj, n)   (PyArray_DIMS(obj)[n])
#define PyArray_STRIDE(obj, n)   (PyArray_STRIDES(obj)[n])
#define PyArray_BASE(obj)   (((PyArrayObject *)(obj))->base)
#define PyArray_DESCR(obj)   (((PyArrayObject *)(obj))->descr)
#define PyArray_FLAGS(obj)   (((PyArrayObject *)(obj))->flags)
#define PyArray_ITEMSIZE(obj)   (((PyArrayObject *)(obj))->descr->elsize)
#define PyArray_TYPE(obj)   (((PyArrayObject *)(obj))->descr->type_num)
#define PyArray_GETITEM(obj, itemptr)
#define PyArray_SETITEM(obj, itemptr, v)
#define PyTypeNum_ISBOOL(type)   ((type) == NPY_BOOL)
#define PyTypeNum_ISUNSIGNED(type)
#define PyTypeNum_ISSIGNED(type)
#define PyTypeNum_ISINTEGER(type)
#define PyTypeNum_ISFLOAT(type)
#define PyTypeNum_ISNUMBER(type)
#define PyTypeNum_ISSTRING(type)
#define PyTypeNum_ISCOMPLEX(type)
#define PyTypeNum_ISPYTHON(type)
#define PyTypeNum_ISFLEXIBLE(type)
#define PyTypeNum_ISDATETIME(type)
#define PyTypeNum_ISUSERDEF(type)
#define PyTypeNum_ISEXTENDED(type)
#define PyTypeNum_ISOBJECT(type)   ((type) == NPY_OBJECT)
#define PyDataType_ISBOOL(obj)   PyTypeNum_ISBOOL(_PyADt(obj))
#define PyDataType_ISUNSIGNED(obj)   PyTypeNum_ISUNSIGNED(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISSIGNED(obj)   PyTypeNum_ISSIGNED(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISINTEGER(obj)   PyTypeNum_ISINTEGER(((PyArray_Descr*)(obj))->type_num )
#define PyDataType_ISFLOAT(obj)   PyTypeNum_ISFLOAT(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISNUMBER(obj)   PyTypeNum_ISNUMBER(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISSTRING(obj)   PyTypeNum_ISSTRING(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISCOMPLEX(obj)   PyTypeNum_ISCOMPLEX(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISPYTHON(obj)   PyTypeNum_ISPYTHON(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISFLEXIBLE(obj)   PyTypeNum_ISFLEXIBLE(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISDATETIME(obj)   PyTypeNum_ISDATETIME(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISUSERDEF(obj)   PyTypeNum_ISUSERDEF(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISEXTENDED(obj)   PyTypeNum_ISEXTENDED(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISOBJECT(obj)   PyTypeNum_ISOBJECT(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_HASFIELDS(obj)   (((PyArray_Descr *)(obj))->names != NULL)
#define PyDataType_HASSUBARRAY(dtype)   ((dtype)->subarray != NULL)
#define PyArray_ISBOOL(obj)   PyTypeNum_ISBOOL(PyArray_TYPE(obj))
#define PyArray_ISUNSIGNED(obj)   PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))
#define PyArray_ISSIGNED(obj)   PyTypeNum_ISSIGNED(PyArray_TYPE(obj))
#define PyArray_ISINTEGER(obj)   PyTypeNum_ISINTEGER(PyArray_TYPE(obj))
#define PyArray_ISFLOAT(obj)   PyTypeNum_ISFLOAT(PyArray_TYPE(obj))
#define PyArray_ISNUMBER(obj)   PyTypeNum_ISNUMBER(PyArray_TYPE(obj))
#define PyArray_ISSTRING(obj)   PyTypeNum_ISSTRING(PyArray_TYPE(obj))
#define PyArray_ISCOMPLEX(obj)   PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))
#define PyArray_ISPYTHON(obj)   PyTypeNum_ISPYTHON(PyArray_TYPE(obj))
#define PyArray_ISFLEXIBLE(obj)   PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))
#define PyArray_ISDATETIME(obj)   PyTypeNum_ISDATETIME(PyArray_TYPE(obj))
#define PyArray_ISUSERDEF(obj)   PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))
#define PyArray_ISEXTENDED(obj)   PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))
#define PyArray_ISOBJECT(obj)   PyTypeNum_ISOBJECT(PyArray_TYPE(obj))
#define PyArray_HASFIELDS(obj)   PyDataType_HASFIELDS(PyArray_DESCR(obj))
#define PyArray_ISVARIABLE(obj)   PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))
#define PyArray_SAFEALIGNEDCOPY(obj)   (PyArray_ISALIGNED(obj) && !PyArray_ISVARIABLE(obj))
#define NPY_LITTLE   '<'
#define NPY_BIG   '>'
#define NPY_NATIVE   '='
#define NPY_SWAP   's'
#define NPY_IGNORE   '|'
#define NPY_NATBYTE   NPY_LITTLE
#define NPY_OPPBYTE   NPY_BIG
#define PyArray_ISNBO(arg)   ((arg) != NPY_OPPBYTE)
#define PyArray_IsNativeByteOrder   PyArray_ISNBO
#define PyArray_ISNOTSWAPPED(m)   PyArray_ISNBO(PyArray_DESCR(m)->byteorder)
#define PyArray_ISBYTESWAPPED(m)   (!PyArray_ISNOTSWAPPED(m))
#define PyArray_FLAGSWAP(m, flags)
#define PyArray_ISCARRAY(m)   PyArray_FLAGSWAP(m, NPY_ARRAY_CARRAY)
#define PyArray_ISCARRAY_RO(m)   PyArray_FLAGSWAP(m, NPY_ARRAY_CARRAY_RO)
#define PyArray_ISFARRAY(m)   PyArray_FLAGSWAP(m, NPY_ARRAY_FARRAY)
#define PyArray_ISFARRAY_RO(m)   PyArray_FLAGSWAP(m, NPY_ARRAY_FARRAY_RO)
#define PyArray_ISBEHAVED(m)   PyArray_FLAGSWAP(m, NPY_ARRAY_BEHAVED)
#define PyArray_ISBEHAVED_RO(m)   PyArray_FLAGSWAP(m, NPY_ARRAY_ALIGNED)
#define PyDataType_ISNOTSWAPPED(d)   PyArray_ISNBO(((PyArray_Descr *)(d))->byteorder)
#define PyDataType_ISBYTESWAPPED(d)   (!PyDataType_ISNOTSWAPPED(d))
#define NPY_AUXDATA_FREE(auxdata)
#define NPY_AUXDATA_CLONE(auxdata)   ((auxdata)->clone(auxdata))
#define NPY_MASK   NPY_UINT8

Typedefs

typedef PyObject *( PyArray_GetItemFunc )(void *, void *)
typedef int( PyArray_SetItemFunc )(PyObject *, void *, void *)
typedef void( PyArray_CopySwapNFunc )(void *, npy_intp, void *, npy_intp, npy_intp, int, void *)
typedef void( PyArray_CopySwapFunc )(void *, void *, int, void *)
typedef npy_boolPyArray_NonzeroFunc )(void *, void *)
typedef int( PyArray_CompareFunc )(const void *, const void *, void *)
typedef int( PyArray_ArgFunc )(void *, npy_intp, npy_intp *, void *)
typedef void( PyArray_DotFunc )(void *, npy_intp, void *, npy_intp, void *, npy_intp, void *)
typedef void( PyArray_VectorUnaryFunc )(void *, void *, npy_intp, void *, void *)
typedef int( PyArray_ScanFunc )(FILE *fp, void *dptr, char *ignore, struct _PyArray_Descr *)
typedef int( PyArray_FromStrFunc )(char *s, void *dptr, char **endptr, struct _PyArray_Descr *)
typedef int( PyArray_FillFunc )(void *, npy_intp, void *)
typedef int( PyArray_SortFunc )(void *, npy_intp, void *)
typedef int( PyArray_ArgSortFunc )(void *, npy_intp *, npy_intp, void *)
typedef int( PyArray_FillWithScalarFunc )(void *, npy_intp, void *, void *)
typedef int( PyArray_ScalarKindFunc )(void *)
typedef void( PyArray_FastClipFunc )(void *in, npy_intp n_in, void *min, void *max, void *out)
typedef void( PyArray_FastPutmaskFunc )(void *in, void *mask, npy_intp n_in, void *values, npy_intp nv)
typedef int( PyArray_FastTakeFunc )(void *dest, void *src, npy_intp *indarray, npy_intp nindarray, npy_intp n_outer, npy_intp m_middle, npy_intp nelem, NPY_CLIPMODE clipmode)
typedef struct _PyArray_Descr PyArray_Descr
typedef struct _arr_descr PyArray_ArrayDescr
typedef struct PyArrayObject PyArrayObject
typedef struct PyArrayFlagsObject PyArrayFlagsObject
typedef int( PyArray_FinalizeFunc )(PyArrayObject *, PyObject *)
typedef struct NpyIter_InternalOnly NpyIter
typedef int( NpyIter_IterNextFunc )(NpyIter *iter)
typedef void( NpyIter_GetMultiIndexFunc )(NpyIter *iter, npy_intp *outcoords)
typedef struct
PyArrayIterObject_tag 
PyArrayIterObject
typedef char *(* npy_iter_get_dataptr_t )(PyArrayIterObject *iter, npy_intp *)
typedef struct NpyAuxData_tag NpyAuxData
typedef void( NpyAuxData_FreeFunc )(NpyAuxData *)
typedef NpyAuxData *( NpyAuxData_CloneFunc )(NpyAuxData *)
typedef npy_uint8 npy_mask

Enumerations

enum  NPY_TYPES {
  NPY_BOOL = 0, NPY_BYTE, NPY_UBYTE, NPY_SHORT,
  NPY_USHORT, NPY_INT, NPY_UINT, NPY_LONG,
  NPY_ULONG, NPY_LONGLONG, NPY_ULONGLONG, NPY_FLOAT,
  NPY_DOUBLE, NPY_LONGDOUBLE, NPY_CFLOAT, NPY_CDOUBLE,
  NPY_CLONGDOUBLE, NPY_OBJECT = 17, NPY_STRING, NPY_UNICODE,
  NPY_VOID, NPY_DATETIME, NPY_TIMEDELTA, NPY_HALF,
  NPY_NTYPES, NPY_NOTYPE, NPY_CHAR, NPY_USERDEF = 256,
  NPY_NTYPES_ABI_COMPATIBLE = 21
}
enum  NPY_TYPECHAR {
  NPY_BOOLLTR = '?', NPY_BYTELTR = 'b', NPY_UBYTELTR = 'B', NPY_SHORTLTR = 'h',
  NPY_USHORTLTR = 'H', NPY_INTLTR = 'i', NPY_UINTLTR = 'I', NPY_LONGLTR = 'l',
  NPY_ULONGLTR = 'L', NPY_LONGLONGLTR = 'q', NPY_ULONGLONGLTR = 'Q', NPY_HALFLTR = 'e',
  NPY_FLOATLTR = 'f', NPY_DOUBLELTR = 'd', NPY_LONGDOUBLELTR = 'g', NPY_CFLOATLTR = 'F',
  NPY_CDOUBLELTR = 'D', NPY_CLONGDOUBLELTR = 'G', NPY_OBJECTLTR = 'O', NPY_STRINGLTR = 'S',
  NPY_STRINGLTR2 = 'a', NPY_UNICODELTR = 'U', NPY_VOIDLTR = 'V', NPY_DATETIMELTR = 'M',
  NPY_TIMEDELTALTR = 'm', NPY_CHARLTR = 'c', NPY_INTPLTR = 'p', NPY_UINTPLTR = 'P',
  NPY_GENBOOLLTR = 'b', NPY_SIGNEDLTR = 'i', NPY_UNSIGNEDLTR = 'u', NPY_FLOATINGLTR = 'f',
  NPY_COMPLEXLTR = 'c'
}
enum  NPY_SORTKIND { NPY_QUICKSORT = 0, NPY_HEAPSORT = 1, NPY_MERGESORT = 2 }
enum  NPY_SEARCHSIDE { NPY_SEARCHLEFT = 0, NPY_SEARCHRIGHT = 1 }
enum  NPY_SCALARKIND {
  NPY_NOSCALAR = -1, NPY_BOOL_SCALAR, NPY_INTPOS_SCALAR, NPY_INTNEG_SCALAR,
  NPY_FLOAT_SCALAR, NPY_COMPLEX_SCALAR, NPY_OBJECT_SCALAR
}
enum  NPY_ORDER { NPY_ANYORDER = -1, NPY_CORDER = 0, NPY_FORTRANORDER = 1, NPY_KEEPORDER = 2 }
enum  NPY_CASTING {
  NPY_NO_CASTING = 0, NPY_EQUIV_CASTING = 1, NPY_SAFE_CASTING = 2, NPY_SAME_KIND_CASTING = 3,
  NPY_UNSAFE_CASTING = 4
}
enum  NPY_CLIPMODE { NPY_CLIP = 0, NPY_WRAP = 1, NPY_RAISE = 2 }
enum  NPY_DATETIMEUNIT {
  NPY_FR_Y, NPY_FR_M, NPY_FR_W, NPY_FR_D,
  NPY_FR_h, NPY_FR_m, NPY_FR_s, NPY_FR_ms,
  NPY_FR_us, NPY_FR_ns, NPY_FR_ps, NPY_FR_fs,
  NPY_FR_as, NPY_FR_GENERIC
}
enum  NPY_BUSDAY_ROLL {
  NPY_BUSDAY_FORWARD, NPY_BUSDAY_FOLLOWING = NPY_BUSDAY_FORWARD, NPY_BUSDAY_BACKWARD, NPY_BUSDAY_PRECEDING = NPY_BUSDAY_BACKWARD,
  NPY_BUSDAY_MODIFIEDFOLLOWING, NPY_BUSDAY_MODIFIEDPRECEDING, NPY_BUSDAY_NAT, NPY_BUSDAY_RAISE
}
enum  {
  NPY_NEIGHBORHOOD_ITER_ZERO_PADDING, NPY_NEIGHBORHOOD_ITER_ONE_PADDING, NPY_NEIGHBORHOOD_ITER_CONSTANT_PADDING, NPY_NEIGHBORHOOD_ITER_CIRCULAR_PADDING,
  NPY_NEIGHBORHOOD_ITER_MIRROR_PADDING
}

Functions

static NPY_INLINE int PyArrayNeighborhoodIter_Reset (PyArrayNeighborhoodIterObject *iter)
static NPY_INLINE int PyArrayNeighborhoodIter_Next (PyArrayNeighborhoodIterObject *iter)
static NPY_INLINE npy_bool NpyMask_IsExposed (npy_mask mask)
static NPY_INLINE npy_uint8 NpyMask_GetPayload (npy_mask mask)
static NPY_INLINE npy_mask NpyMask_Create (npy_bool exposed, npy_uint8 payload)

Define Documentation

#define _NPY_INCLUDE_NEIGHBORHOOD_IMP
Include inline implementations - functions defined there are not considered public API
#define _PyAIT (   it)    ((PyArrayIterObject *)(it))
#define _PyArray_ITER_NEXT1 (   it)
Value:
{                                       \
        (it)->dataptr += _PyAIT(it)->strides[0];                        \
        (it)->coordinates[0]++;                                         \
}
#define _PyArray_ITER_NEXT2 (   it)
Value:
{                                       \
        if ((it)->coordinates[1] < (it)->dims_m1[1]) {                  \
                (it)->coordinates[1]++;                                 \
                (it)->dataptr += (it)->strides[1];                      \
        }                                                               \
        else {                                                          \
                (it)->coordinates[1] = 0;                               \
                (it)->coordinates[0]++;                                 \
                (it)->dataptr += (it)->strides[0] -                     \
                        (it)->backstrides[1];                           \
        }                                                               \
}
#define _PyArray_ITER_NEXT3 (   it)
Value:
{                                       \
        if ((it)->coordinates[2] < (it)->dims_m1[2]) {                  \
                (it)->coordinates[2]++;                                 \
                (it)->dataptr += (it)->strides[2];                      \
        }                                                               \
        else {                                                          \
                (it)->coordinates[2] = 0;                               \
                (it)->dataptr -= (it)->backstrides[2];                  \
                if ((it)->coordinates[1] < (it)->dims_m1[1]) {          \
                        (it)->coordinates[1]++;                         \
                        (it)->dataptr += (it)->strides[1];              \
                }                                                       \
                else {                                                  \
                        (it)->coordinates[1] = 0;                       \
                        (it)->coordinates[0]++;                         \
                        (it)->dataptr += (it)->strides[0] -             \
                                (it)->backstrides[1];                   \
                }                                                       \
        }                                                               \
}
#define _PyMIT (   m)    ((PyArrayMultiIterObject *)(m))
#define FORTRAN_IF   PyArray_FORTRAN_IF
#define NPY_ALIGNED_STRUCT   0x80
A sticky flag specifically for structured arrays
#define NPY_ALLOW_C_API
#define NPY_ALLOW_C_API_DEF

Referenced by NumPyOS_ascii_isalnum().

#define NPY_ALLOW_THREADS   0
Only use thread if configured in config and python supports it
#define NPY_ARR_HAS_DESCR   0x0800
This flag is for the array interface
#define NPY_ARRAY_ALIGNED   0x0100
Array data is aligned on the appropiate memory address for the type stored according to how the compiler would align things (e.g., an array of integers (4 bytes each) starts on a memory address that's a multiple of 4)

Referenced by array_trace(), new_array_for_sum(), PyArray_NewFlagsObject(), and PyArray_UpdateFlags().

#define NPY_ARRAY_BEHAVED
#define NPY_ARRAY_BEHAVED_NS
#define NPY_ARRAY_C_CONTIGUOUS   0x0001
Means c-style contiguous (last index varies the fastest). The data elements right after each other.

Referenced by _define_get(), PyArray_NewFlagsObject(), and PyArray_UpdateFlags().

#define NPY_ARRAY_CARRAY_RO
#define NPY_ARRAY_DEFAULT   (NPY_ARRAY_CARRAY)
#define NPY_ARRAY_ELEMENTSTRIDES   0x0080
Make sure that the strides are in units of the element size Needed for some operations with record-arrays.
#define NPY_ARRAY_ENSUREARRAY   0x0040
Make sure the returned array is a base-class ndarray

Referenced by _prepend_ones(), and einsum_sub_op_from_str().

#define NPY_ARRAY_ENSURECOPY   0x0020
Always copy the array. Returned arrays are always CONTIGUOUS, ALIGNED, and WRITEABLE.

Referenced by PyArray_TakeFrom().

#define NPY_ARRAY_F_CONTIGUOUS   0x0002
Set if array is a contiguous Fortran array: the first index varies the fastest in memory (strides array is reverse of C-contiguous array)

Referenced by PyArray_NewFlagsObject(), and PyArray_UpdateFlags().

#define NPY_ARRAY_FARRAY
#define NPY_ARRAY_FARRAY_RO
#define NPY_ARRAY_FORCECAST   0x0010
An array never has the next four set; they're only used as parameter flags to the the various FromAny functions
Cause a cast to occur regardless of whether or not it is safe.
#define NPY_ARRAY_IN_ARRAY   (NPY_ARRAY_CARRAY_RO)
#define NPY_ARRAY_IN_FARRAY   (NPY_ARRAY_FARRAY_RO)
#define NPY_ARRAY_INOUT_ARRAY
#define NPY_ARRAY_INOUT_FARRAY
#define NPY_ARRAY_NOTSWAPPED   0x0200
Array data has the native endianness
#define NPY_ARRAY_OUT_ARRAY   (NPY_ARRAY_CARRAY)
#define NPY_ARRAY_OUT_FARRAY   (NPY_ARRAY_FARRAY)
#define NPY_ARRAY_OWNDATA   0x0004
Note: all 0-d arrays are C_CONTIGUOUS and F_CONTIGUOUS. If a 1-d array is C_CONTIGUOUS it is also F_CONTIGUOUS
If set, the array owns the data: it will be free'd when the array is deleted.

Referenced by PyArray_CastScalarDirect(), and PyArray_NewFlagsObject().

#define NPY_ARRAY_UPDATE_ALL
#define NPY_ARRAY_UPDATEIFCOPY   0x1000
If this flag is set, then base contains a pointer to an array of the same size that should be updated with the current contents of this array when this array is deallocated

Referenced by array_clip(), PyArray_ArgMax(), and PyArray_TakeFrom().

#define NPY_ARRAY_WRITEABLE   0x0400
Array data is writeable

Referenced by PyArray_TypeNumFromName(), and PyArray_UpdateFlags().

#define NPY_AUXDATA_CLONE (   auxdata)    ((auxdata)->clone(auxdata))

Referenced by NpyIter_MultiNew().

#define NPY_BEGIN_ALLOW_THREADS

Referenced by PyArray_ToFile(), and PyArray_Zeros().

#define NPY_BEGIN_THREADS

Referenced by PyArray_ToFile().

#define NPY_BEGIN_THREADS_DEF
#define NPY_BEGIN_THREADS_DESCR (   dtype)

Referenced by PyArray_ArgMax().

#define NPY_BIG   '>'
#define NPY_BUFSIZE   8192
#define NPY_DATETIME_DEFAULTUNIT   NPY_FR_GENERIC
#define NPY_DATETIME_MAX_ISO8601_STRLEN   (21+3*5+1+3*6+6+1)
Upper bound on the length of a DATETIME ISO 8601 string
YEAR: 21 (64-bit year) MONTH: 3 DAY: 3 HOURS: 3 MINUTES: 3 SECONDS: 3 ATTOSECONDS: 1 + 3*6 TIMEZONE: 5 NULL TERMINATOR: 1
#define NPY_DATETIME_NUMUNITS   (NPY_FR_GENERIC + 1)
#define NPY_DEFAULT_TYPE   NPY_DOUBLE
The default array type
#define NPY_DISABLE_C_API
#define NPY_END_ALLOW_THREADS

Referenced by PyArray_ToFile().

#define NPY_END_THREADS

Referenced by PyArray_ToFile().

#define NPY_END_THREADS_DESCR (   dtype)

Referenced by PyArray_ArgMax().

#define NPY_ERR (   str)    fprintf(stderr, #str); fflush(stderr);
#define NPY_ERR2 (   str)    fprintf(stderr, str); fflush(stderr);
#define NPY_FEATURE_VERSION   NPY_API_VERSION
Minor API version. This number is increased whenever a change is made to the C-API -- whether it breaks binary compatibility or not. Some changes, such as adding a function pointer to the end of the function table, can be made without breaking binary compatibility. In this case, only the NPY_FEATURE_VERSION (not NPY_VERSION) would be increased. Whenever binary compatibility is broken, both NPY_VERSION and NPY_FEATURE_VERSION should be increased.
#define NPY_FROM_FIELDS
Value:
These are inherited for global data-type if any data-types in the
field have them
#define NPY_IGNORE   '|'
#define NPY_ITEM_HASOBJECT   0x01
Same as needing REFCOUNT

Referenced by array_nbytes_get().

#define NPY_ITEM_IS_POINTER   0x04
The item is a POINTER

Referenced by array_nbytes_get().

#define NPY_ITEM_REFCOUNT   0x01
The item must be reference counted when it is inserted or extracted.
#define NPY_ITER_ALIGNED   0x00100000
The operand's data must be aligned

Referenced by apply_business_day_count(), and business_day_offset().

#define NPY_ITER_ALLOCATE   0x01000000
Allocate the operand if it is NULL

Referenced by apply_business_day_count(), and business_day_offset().

#define NPY_ITER_ARRAYMASK   0x20000000
This array is the mask for all WRITEMASKED operands
#define NPY_ITER_BUFFERED   0x00000200
Enables buffering

Referenced by apply_business_day_count(), and business_day_offset().

#define NPY_ITER_C_INDEX   0x00000001
  • Global flags that may be passed to the iterator constructors **
Track an index representing C order
#define NPY_ITER_COMMON_DTYPE   0x00000010
Convert all the operands to a common data type
#define NPY_ITER_CONTIG   0x00200000
The operand's data must be contiguous (within the inner loop)
#define NPY_ITER_COPY   0x00400000
The operand may be copied to satisfy requirements
#define NPY_ITER_DELAY_BUFALLOC   0x00000800
Delay allocation of buffers until first Reset* call
#define NPY_ITER_DONT_NEGATE_STRIDES   0x00001000
When NPY_KEEPORDER is specified, disable reversing negative-stride axes
#define NPY_ITER_EXTERNAL_LOOP   0x00000008
User code external to the iterator does the 1-dimensional innermost loop

Referenced by apply_business_day_count(), and business_day_offset().

#define NPY_ITER_F_INDEX   0x00000002
Track an index representing Fortran order
#define NPY_ITER_GLOBAL_FLAGS   0x0000ffff
#define NPY_ITER_GROWINNER   0x00000400
When buffering is enabled, grows the inner loop if possible
#define NPY_ITER_MULTI_INDEX   0x00000004
Track a multi-index
#define NPY_ITER_NBO   0x00080000
The operand's data must be in native byte order
#define NPY_ITER_NO_BROADCAST   0x08000000
Require that the dimension match the iterator dimensions exactly
#define NPY_ITER_NO_SUBTYPE   0x02000000
If an operand is allocated, don't use any subtype
#define NPY_ITER_PER_OP_FLAGS   0xffff0000
#define NPY_ITER_RANGED   0x00000100
Enables sub-range iteration
#define NPY_ITER_READONLY   0x00020000
The operand will only be read from

Referenced by apply_business_day_count(), business_day_offset(), and npyiter_convert_ops().

#define NPY_ITER_READWRITE   0x00010000
  • Per-operand flags that may be passed to the iterator constructors **
The operand will be read from and written to
#define NPY_ITER_REDUCE_OK   0x00000080
Permits reductions (size-0 stride with dimension size > 1)

Referenced by npyiter_flip_negative_strides().

#define NPY_ITER_REFS_OK   0x00000020
Operands may hold references, requiring API access during iteration
#define NPY_ITER_UPDATEIFCOPY   0x00800000
The operand may be copied with UPDATEIFCOPY to satisfy requirements
#define NPY_ITER_VIRTUAL   0x04000000
This is a virtual array slot, operand is NULL but temporary data is there
#define NPY_ITER_WRITEMASKED   0x10000000
A mask is being used on this array, affects buffer -> array copy
#define NPY_ITER_WRITEONLY   0x00040000
The operand will only be written to

Referenced by apply_business_day_count(), and business_day_offset().

#define NPY_ITER_ZEROSIZE_OK   0x00000040
Zero-sized operands should be permitted, iteration checks IterSize for 0

Referenced by apply_business_day_count(), and business_day_offset().

#define NPY_LIST_PICKLE   0x02
Convert to list for pickling

Referenced by PyArray_ToFile().

#define NPY_LITTLE   '<'
#define NPY_MASK   NPY_UINT8
#define NPY_MAX_BUFSIZE   (((int)sizeof(cdouble))*1000000)
#define NPY_MAXDIMS   32
There are several places in the code where an array of dimensions is allocated statically. This is the size of that static allocation.
The array creation itself could have arbitrary dimensions but all the places where static allocation is used would need to be changed to dynamic (including inside of several structures)

Referenced by _strings_richcompare(), arraymultiter_dealloc(), arraymultiter_new(), NpyIter_Deallocate(), and npyiter_flip_negative_strides().

#define NPY_METADATA_DTSTR   "__timeunit__"
#define NPY_MIN_BUFSIZE   ((int)sizeof(cdouble))
Size of internal buffers used for alignment Make BUFSIZE a multiple of sizeof(cdouble) -- usually 16 so that ufunc buffers are aligned
#define NPY_NATBYTE   NPY_LITTLE
#define NPY_NATIVE   '='
#define NPY_NEEDS_INIT   0x08
memory needs to be initialized for this data-type

Referenced by get_nbo_cast_transfer_function().

#define NPY_NEEDS_PYAPI   0x10
operations need Python C-API so don't give-up thread.
#define NPY_NO_EXPORT   static
This is auto-generated by the installer

Referenced by npyiter_seq_ass_slice(), and PyUFunc_FromFuncAndDataAndSignature().

#define NPY_NSCALARKINDS   (NPY_OBJECT_SCALAR + 1)
#define NPY_NSEARCHSIDES   (NPY_SEARCHRIGHT + 1)
#define NPY_NSORTS   (NPY_MERGESORT + 1)
#define NPY_NUM_FLOATTYPE   3
How many floating point types are there (excluding half)
#define NPY_OPPBYTE   NPY_BIG
#define NPY_PRIORITY   0.0
basetype array priority
#define NPY_SCALAR_PRIORITY   -1000000.0
default scalar priority
#define NPY_STR_as   "as"
#define NPY_STR_D   "D"
#define NPY_STR_fs   "fs"
#define NPY_STR_h   "h"
#define NPY_STR_M   "M"
#define NPY_STR_m   "m"
#define NPY_STR_ms   "ms"
#define NPY_STR_ns   "ns"
#define NPY_STR_ps   "ps"
#define NPY_STR_s   "s"
#define NPY_STR_us   "us"
#define NPY_STR_W   "W"
#define NPY_STR_Y   "Y"
#define NPY_STRINGIFY (   x)    #x
#define NPY_SUBTYPE_PRIORITY   1.0
default subtype priority
#define NPY_SWAP   's'
#define NPY_TOSTRING (   x)    NPY_STRINGIFY(x)
#define NPY_USE_GETITEM   0x20
Use f.getitem when extracting elements of this data-type
#define NPY_USE_PYMEM   1
#define NPY_USE_SETITEM   0x40
Use f.setitem when setting creating 0-d array from this data-type.
#define NPY_VERSION   NPY_ABI_VERSION
Binary compatibility version number. This number is increased whenever the C-API is changed such that binary compatibility is broken, i.e. whenever a recompile of extension modules is needed.
#define PyArray_BASE (   obj)    (((PyArrayObject *)(obj))->base)
#define PyArray_BYTES (   obj)    (((PyArrayObject *)(obj))->data)
#define PyArray_CEQ (   p,
 
)    (((p).real==(q).real) && ((p).imag == (q).imag))
#define PyArray_CGE (   p,
 
)
Value:
((((p).real==(q).real) ? ((p).imag >= (q).imag) : \
                               ((p).real >= (q).real)))
#define PyArray_CGT (   p,
 
)
Value:
((((p).real==(q).real) ? ((p).imag > (q).imag) : \
                               ((p).real > (q).real)))
#define PyArray_CHKFLAGS (   m,
  FLAGS 
)    ((((PyArrayObject *)(m))->flags & (FLAGS)) == (FLAGS))
C API: consists of Macros and functions. The MACROS are defined here.
#define PyArray_CLE (   p,
 
)
Value:
((((p).real==(q).real) ? ((p).imag <= (q).imag) : \
                               ((p).real <= (q).real)))
#define PyArray_CLT (   p,
 
)
Value:
((((p).real==(q).real) ? ((p).imag < (q).imag) : \
                               ((p).real < (q).real)))
#define PyArray_CNE (   p,
 
)    (((p).real!=(q).real) || ((p).imag != (q).imag))
#define PyArray_DATA (   obj)    ((void *)(((PyArrayObject *)(obj))->data))
#define PyArray_DIM (   obj,
 
)    (PyArray_DIMS(obj)[n])

Referenced by PyArray_Arange(), and recursive_tolist().

#define PyArray_DIMS (   obj)    (((PyArrayObject *)(obj))->dimensions)
#define PyArray_FLAGS (   obj)    (((PyArrayObject *)(obj))->flags)

Referenced by PyArray_NewFlagsObject().

#define PyArray_FLAGSWAP (   m,
  flags 
)
Value:
#define PyArray_FORTRAN_IF (   m)
#define PyArray_GETITEM (   obj,
  itemptr 
)
Value:
((PyArrayObject *)(obj))->descr->f->getitem((char *)(itemptr),        \
                                                 (PyArrayObject *)(obj))
#define PyArray_HASFIELDS (   obj)    PyDataType_HASFIELDS(PyArray_DESCR(obj))
#define PyArray_IS_C_CONTIGUOUS (   m)    PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS)
#define PyArray_IS_F_CONTIGUOUS (   m)    PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS)
#define PyArray_ISALIGNED (   m)    PyArray_CHKFLAGS(m, NPY_ARRAY_ALIGNED)
#define PyArray_ISBEHAVED (   m)    PyArray_FLAGSWAP(m, NPY_ARRAY_BEHAVED)
#define PyArray_ISBEHAVED_RO (   m)    PyArray_FLAGSWAP(m, NPY_ARRAY_ALIGNED)
#define PyArray_ISBOOL (   obj)    PyTypeNum_ISBOOL(PyArray_TYPE(obj))

Referenced by count_new_axes_0d().

#define PyArray_ISBYTESWAPPED (   m)    (!PyArray_ISNOTSWAPPED(m))
#define PyArray_ISCARRAY (   m)    PyArray_FLAGSWAP(m, NPY_ARRAY_CARRAY)
#define PyArray_ISCARRAY_RO (   m)    PyArray_FLAGSWAP(m, NPY_ARRAY_CARRAY_RO)
#define PyArray_ISCOMPLEX (   obj)    PyTypeNum_ISCOMPLEX(PyArray_TYPE(obj))

Referenced by array_real_get().

#define PyArray_ISCONTIGUOUS (   m)    PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS)

Referenced by PyArray_ToFile().

#define PyArray_ISDATETIME (   obj)    PyTypeNum_ISDATETIME(PyArray_TYPE(obj))
#define PyArray_ISEXTENDED (   obj)    PyTypeNum_ISEXTENDED(PyArray_TYPE(obj))

Referenced by dump_data().

#define PyArray_ISFARRAY (   m)    PyArray_FLAGSWAP(m, NPY_ARRAY_FARRAY)
#define PyArray_ISFARRAY_RO (   m)    PyArray_FLAGSWAP(m, NPY_ARRAY_FARRAY_RO)
#define PyArray_ISFLEXIBLE (   obj)    PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))
#define PyArray_ISFLOAT (   obj)    PyTypeNum_ISFLOAT(PyArray_TYPE(obj))
#define PyArray_ISFORTRAN (   m)
Value:

Referenced by array_real_get().

#define PyArray_ISINTEGER (   obj)    PyTypeNum_ISINTEGER(PyArray_TYPE(obj))
#define PyArray_IsNativeByteOrder   PyArray_ISNBO

Referenced by _invalid_metadata_check().

#define PyArray_ISNOTSWAPPED (   m)    PyArray_ISNBO(PyArray_DESCR(m)->byteorder)

Referenced by LONGDOUBLE_setitem().

#define PyArray_ISNUMBER (   obj)    PyTypeNum_ISNUMBER(PyArray_TYPE(obj))
#define PyArray_ISOBJECT (   obj)    PyTypeNum_ISOBJECT(PyArray_TYPE(obj))
#define PyArray_ISONESEGMENT (   m)
#define PyArray_ISPYTHON (   obj)    PyTypeNum_ISPYTHON(PyArray_TYPE(obj))
#define PyArray_ISSIGNED (   obj)    PyTypeNum_ISSIGNED(PyArray_TYPE(obj))
#define PyArray_ISSTRING (   obj)    PyTypeNum_ISSTRING(PyArray_TYPE(obj))
#define PyArray_ISUNSIGNED (   obj)    PyTypeNum_ISUNSIGNED(PyArray_TYPE(obj))
#define PyArray_ISUSERDEF (   obj)    PyTypeNum_ISUSERDEF(PyArray_TYPE(obj))
#define PyArray_ISVARIABLE (   obj)    PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj))
FIXME: This should check for a flag on the data-type that states whether or not it is variable length. Because the ISFLEXIBLE check is hard-coded to the built-in data-types.
#define PyArray_ISWRITEABLE (   m)    PyArray_CHKFLAGS(m, NPY_ARRAY_WRITEABLE)

Referenced by array_item_nice(), and PyArray_New().

#define PyArray_ITEMSIZE (   obj)    (((PyArrayObject *)(obj))->descr->elsize)
#define PyArray_ITER_DATA (   it)    ((void *)(_PyAIT(it)->dataptr))
#define PyArray_ITER_GOTO (   it,
  destination 
)
Value:
{                            \
        int __npy_i;                                                    \
        _PyAIT(it)->index = 0;                                          \
        _PyAIT(it)->dataptr = _PyAIT(it)->ao->data;                     \
        for (__npy_i = _PyAIT(it)->nd_m1; __npy_i>=0; __npy_i--) {      \
                if (destination[__npy_i] < 0) {                         \
                        destination[__npy_i] +=                         \
                                _PyAIT(it)->dims_m1[__npy_i]+1;         \
                }                                                       \
                _PyAIT(it)->dataptr += destination[__npy_i] *           \
                        _PyAIT(it)->strides[__npy_i];                   \
                _PyAIT(it)->coordinates[__npy_i] =                      \
                        destination[__npy_i];                           \
                _PyAIT(it)->index += destination[__npy_i] *             \
                        ( __npy_i==_PyAIT(it)->nd_m1 ? 1 :              \
                          _PyAIT(it)->dims_m1[__npy_i+1]+1) ;           \
        }                                                               \
}
#define PyArray_ITER_GOTO1D (   it,
  ind 
)
Value:
{                                     \
        int __npy_i;                                                       \
        npy_intp __npy_ind = (npy_intp) (ind);                             \
        if (__npy_ind < 0) __npy_ind += _PyAIT(it)->size;                  \
        _PyAIT(it)->index = __npy_ind;                                     \
        if (_PyAIT(it)->nd_m1 == 0) {                                      \
                _PyAIT(it)->dataptr = _PyAIT(it)->ao->data +               \
                        __npy_ind * _PyAIT(it)->strides[0];                \
        }                                                                  \
        else if (_PyAIT(it)->contiguous)                                   \
                _PyAIT(it)->dataptr = _PyAIT(it)->ao->data +               \
                        __npy_ind * _PyAIT(it)->ao->descr->elsize;         \
        else {                                                             \
                _PyAIT(it)->dataptr = _PyAIT(it)->ao->data;                \
                for (__npy_i = 0; __npy_i<=_PyAIT(it)->nd_m1;              \
                     __npy_i++) {                                          \
                        _PyAIT(it)->dataptr +=                             \
                                (__npy_ind / _PyAIT(it)->factors[__npy_i]) \
                                * _PyAIT(it)->strides[__npy_i];            \
                        __npy_ind %= _PyAIT(it)->factors[__npy_i];         \
                }                                                          \
        }                                                                  \
}

Referenced by iter_ass_subscript().

#define PyArray_ITER_NEXT (   it)
Value:
{                                            \
        _PyAIT(it)->index++;                                               \
        if (_PyAIT(it)->nd_m1 == 0) {                                      \
                _PyArray_ITER_NEXT1(_PyAIT(it));                           \
        }                                                                  \
        else if (_PyAIT(it)->contiguous)                                   \
                _PyAIT(it)->dataptr += _PyAIT(it)->ao->descr->elsize;      \
        else if (_PyAIT(it)->nd_m1 == 1) {                                 \
                _PyArray_ITER_NEXT2(_PyAIT(it));                           \
        }                                                                  \
        else {                                                             \
                int __npy_i;                                               \
                for (__npy_i=_PyAIT(it)->nd_m1; __npy_i >= 0; __npy_i--) { \
                        if (_PyAIT(it)->coordinates[__npy_i] <             \
                            _PyAIT(it)->dims_m1[__npy_i]) {                \
                                _PyAIT(it)->coordinates[__npy_i]++;        \
                                _PyAIT(it)->dataptr +=                     \
                                        _PyAIT(it)->strides[__npy_i];      \
                                break;                                     \
                        }                                                  \
                        else {                                             \
                                _PyAIT(it)->coordinates[__npy_i] = 0;      \
                                _PyAIT(it)->dataptr -=                     \
                                        _PyAIT(it)->backstrides[__npy_i];  \
                        }                                                  \
                }                                                          \
        }                                                                  \
}

Referenced by _new_sort(), copy_object(), iter_ass_subscript(), PyArray_Byteswap(), PyArray_INCREF(), PyArray_RemoveSmallest(), PyArray_ToFile(), and type().

#define PyArray_ITER_NOTDONE (   it)    (_PyAIT(it)->index < _PyAIT(it)->size)
#define PyArray_ITER_RESET (   it)
Value:
{                                        \
        _PyAIT(it)->index = 0;                                          \
        _PyAIT(it)->dataptr = _PyAIT(it)->ao->data;                     \
        memset(_PyAIT(it)->coordinates, 0,                              \
               (_PyAIT(it)->nd_m1+1)*sizeof(npy_intp));                 \
}

Referenced by iter_ass_subscript().

#define PyArray_MAX (   a,
 
)    (((a)>(b))?(a):(b))
buffer stress test size:
#define NPY_BUFSIZE 17
#define PyArray_MIN (   a,
 
)    (((a)<(b))?(a):(b))
#define PyArray_MultiIter_DATA (   multi,
 
)    ((void *)(_PyMIT(multi)->iters[i]->dataptr))
#define PyArray_MultiIter_GOTO (   multi,
  dest 
)
Value:
{                               \
        int __npy_mi;                                                       \
        for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) {   \
                PyArray_ITER_GOTO(_PyMIT(multi)->iters[__npy_mi], dest);    \
        }                                                                   \
        _PyMIT(multi)->index = _PyMIT(multi)->iters[0]->index;              \
}
#define PyArray_MultiIter_GOTO1D (   multi,
  ind 
)
Value:
{                             \
        int __npy_mi;                                                      \
        for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter; __npy_mi++) {  \
                PyArray_ITER_GOTO1D(_PyMIT(multi)->iters[__npy_mi], ind);  \
        }                                                                  \
        _PyMIT(multi)->index = _PyMIT(multi)->iters[0]->index;             \
}
#define PyArray_MultiIter_NEXT (   multi)
Value:
{                                       \
        int __npy_mi;                                                         \
        _PyMIT(multi)->index++;                                               \
        for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter;   __npy_mi++) {   \
                PyArray_ITER_NEXT(_PyMIT(multi)->iters[__npy_mi]);            \
        }                                                                     \
}
#define PyArray_MultiIter_NEXTi (   multi,
 
)    PyArray_ITER_NEXT(_PyMIT(multi)->iters[i])
#define PyArray_MultiIter_NOTDONE (   multi)    (_PyMIT(multi)->index < _PyMIT(multi)->size)
#define PyArray_MultiIter_RESET (   multi)
Value:
{                                      \
        int __npy_mi;                                                         \
        _PyMIT(multi)->index = 0;                                             \
        for (__npy_mi=0; __npy_mi < _PyMIT(multi)->numiter;  __npy_mi++) {    \
                PyArray_ITER_RESET(_PyMIT(multi)->iters[__npy_mi]);           \
        }                                                                     \
}
#define PyArray_NDIM (   obj)    (((PyArrayObject *)(obj))->nd)
#define PyArray_realloc   PyMem_Realloc
#define PyArray_SAFEALIGNEDCOPY (   obj)    (PyArray_ISALIGNED(obj) && !PyArray_ISVARIABLE(obj))
#define PyArray_SETITEM (   obj,
  itemptr,
 
)
Value:
((PyArrayObject *)(obj))->descr->f->setitem((PyObject *)(v),          \
                                                    (char *)(itemptr),        \
                                                    (PyArrayObject *)(obj))
#define PyArray_STRIDE (   obj,
 
)    (PyArray_STRIDES(obj)[n])
#define PyArray_STRIDES (   obj)    (((PyArrayObject *)(obj))->strides)

Referenced by byte_swap_vector().

#define PyArray_TYPE (   obj)    (((PyArrayObject *)(obj))->descr->type_num)
#define PyArrayIter_Check (   op)    PyObject_TypeCheck(op, &PyArrayIter_Type)
Iterator API
#define PyDataMem_FREE (   ptr)    free(ptr)

Referenced by _new_sort(), and suff().

#define PyDataMem_NEW (   size)    ((char *)malloc(size))
Macros to define how array, and dimension/strides data is allocated.
Data buffer

Referenced by _new_sort(), and suff().

#define PyDataMem_RENEW (   ptr,
  size 
)    ((char *)realloc(ptr,size))

Referenced by PyArray_Arange(), and PyArray_Empty().

#define PyDataType_FLAGCHK (   dtype,
  flag 
)    (((dtype)->flags & (flag)) == (flag))
#define PyDataType_HASSUBARRAY (   dtype)    ((dtype)->subarray != NULL)
#define PyDataType_ISBOOL (   obj)    PyTypeNum_ISBOOL(_PyADt(obj))
#define PyDataType_ISBYTESWAPPED (   d)    (!PyDataType_ISNOTSWAPPED(d))
#define PyDataType_ISCOMPLEX (   obj)    PyTypeNum_ISCOMPLEX(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISDATETIME (   obj)    PyTypeNum_ISDATETIME(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISEXTENDED (   obj)    PyTypeNum_ISEXTENDED(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISFLEXIBLE (   obj)    PyTypeNum_ISFLEXIBLE(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISFLOAT (   obj)    PyTypeNum_ISFLOAT(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISINTEGER (   obj)    PyTypeNum_ISINTEGER(((PyArray_Descr*)(obj))->type_num )
#define PyDataType_ISNOTSWAPPED (   d)    PyArray_ISNBO(((PyArray_Descr *)(d))->byteorder)
#define PyDataType_ISNUMBER (   obj)    PyTypeNum_ISNUMBER(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISOBJECT (   obj)    PyTypeNum_ISOBJECT(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISPYTHON (   obj)    PyTypeNum_ISPYTHON(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISSIGNED (   obj)    PyTypeNum_ISSIGNED(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISSTRING (   obj)    PyTypeNum_ISSTRING(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISUNSIGNED (   obj)    PyTypeNum_ISUNSIGNED(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_ISUSERDEF (   obj)    PyTypeNum_ISUSERDEF(((PyArray_Descr*)(obj))->type_num)
#define PyDataType_REFCHK (   dtype)    PyDataType_FLAGCHK(dtype, NPY_ITEM_REFCOUNT)
#define PyDimMem_FREE (   ptr)    PyArray_free(ptr)
#define PyDimMem_NEW (   size)    ((npy_intp *)PyArray_malloc(size*sizeof(npy_intp)))
Dimensions and strides
#define PyDimMem_RENEW (   ptr,
  size 
)    ((npy_intp *)PyArray_realloc(ptr,size*sizeof(npy_intp)))
#define PyTypeNum_ISBOOL (   type)    ((type) == NPY_BOOL)
#define PyTypeNum_ISCOMPLEX (   type)
Value:
(((type) >= NPY_CFLOAT) &&   \
                                ((type) <= NPY_CLONGDOUBLE))
#define PyTypeNum_ISDATETIME (   type)
#define PyTypeNum_ISEXTENDED (   type)
#define PyTypeNum_ISFLEXIBLE (   type)
Value:
(((type) >=NPY_STRING) &&  \
                                    ((type) <=NPY_VOID))
#define PyTypeNum_ISFLOAT (   type)
Value:
((((type) >= NPY_FLOAT) && \
                              ((type) <= NPY_LONGDOUBLE)) || \
                              ((type) == NPY_HALF))

Referenced by PyUFunc_MultiplicationTypeResolution().

#define PyTypeNum_ISINTEGER (   type)
Value:
(((type) >= NPY_BYTE) &&     \
                                ((type) <= NPY_ULONGLONG))

Referenced by PyUFunc_MultiplicationTypeResolution().

#define PyTypeNum_ISNUMBER (   type)
Value:
(((type) <= NPY_CLONGDOUBLE) || \
                                  ((type) == NPY_HALF))
#define PyTypeNum_ISOBJECT (   type)    ((type) == NPY_OBJECT)
#define PyTypeNum_ISPYTHON (   type)
Value:
(((type) == NPY_LONG) ||      \
                                  ((type) == NPY_DOUBLE) ||    \
                                  ((type) == NPY_CDOUBLE) ||   \
                                  ((type) == NPY_BOOL) ||      \
                                  ((type) == NPY_OBJECT ))
#define PyTypeNum_ISSIGNED (   type)
Value:
(((type) == NPY_BYTE) ||      \
                               ((type) == NPY_SHORT) ||        \
                               ((type) == NPY_INT) ||          \
                               ((type) == NPY_LONG) ||         \
                               ((type) == NPY_LONGLONG))
#define PyTypeNum_ISSTRING (   type)
Value:
(((type) == NPY_STRING) ||    \
                                  ((type) == NPY_UNICODE))
#define PyTypeNum_ISUNSIGNED (   type)
Value:
(((type) == NPY_UBYTE) ||   \
                                 ((type) == NPY_USHORT) ||     \
                                 ((type) == NPY_UINT) ||       \
                                 ((type) == NPY_ULONG) ||      \
                                 ((type) == NPY_ULONGLONG))
#define PyTypeNum_ISUSERDEF (   type)
Value:

Referenced by _signbit_set().


Typedef Documentation

type of the function which translates a set of coordinates to a pointer to the data
typedef npy_uint8 npy_mask

NumPy functions for dealing with masks, such as in masked iteration

System Message: WARNING/2 (<string>, line 1)
Title overline too short.

 NumPy functions for dealing with masks, such as in masked iteration
 
typedef struct NpyAuxData_tag NpyAuxData

NumPy Auxiliary Data for inner loops, sort functions, etc.

System Message: WARNING/2 (<string>, line 1)
Title overline too short.

 NumPy Auxiliary Data for inner loops, sort functions, etc.
 
When creating an auxiliary data struct, this should always appear as the first member, like this:

typedef struct {
NpyAuxData base; double constant;
System Message: WARNING/2 (<string>, line 7) Definition list ends without a blank line; unexpected unindent.
} constant_multiplier_aux_data;
typedef void( NpyAuxData_FreeFunc)(NpyAuxData *)
Function pointers for freeing or cloning auxiliary data
typedef struct NpyIter_InternalOnly NpyIter

New iterator object

The actual structure of the iterator is an internal detail
typedef void( NpyIter_GetMultiIndexFunc)(NpyIter *iter, npy_intp *outcoords)
typedef int( NpyIter_IterNextFunc)(NpyIter *iter)
Iterator function pointers that may be specialized
typedef int( PyArray_ArgFunc)(void *, npy_intp, npy_intp *, void *)
typedef int( PyArray_ArgSortFunc)(void *, npy_intp *, npy_intp, void *)
typedef int( PyArray_CompareFunc)(const void *, const void *, void *)
These assume aligned and notswapped data -- a buffer will be used before or contiguous data will be obtained
typedef void( PyArray_CopySwapFunc)(void *, void *, int, void *)
typedef void( PyArray_CopySwapNFunc)(void *, npy_intp, void *, npy_intp, npy_intp, int, void *)
typedef struct _PyArray_Descr PyArray_Descr
typedef void( PyArray_DotFunc)(void *, npy_intp, void *, npy_intp, void *, npy_intp, void *)
typedef void( PyArray_FastClipFunc)(void *in, npy_intp n_in, void *min, void *max, void *out)
typedef void( PyArray_FastPutmaskFunc)(void *in, void *mask, npy_intp n_in, void *values, npy_intp nv)
typedef int( PyArray_FastTakeFunc)(void *dest, void *src, npy_intp *indarray, npy_intp nindarray, npy_intp n_outer, npy_intp m_middle, npy_intp nelem, NPY_CLIPMODE clipmode)
typedef int( PyArray_FillFunc)(void *, npy_intp, void *)
typedef int( PyArray_FillWithScalarFunc)(void *, npy_intp, void *, void *)
typedef int( PyArray_FinalizeFunc)(PyArrayObject *, PyObject *)
typedef int( PyArray_FromStrFunc)(char *s, void *dptr, char **endptr, struct _PyArray_Descr *)
typedef PyObject*( PyArray_GetItemFunc)(void *, void *)
These must deal with unaligned and swapped data if necessary
typedef npy_bool( PyArray_NonzeroFunc)(void *, void *)
typedef int( PyArray_ScalarKindFunc)(void *)
typedef int( PyArray_ScanFunc)(FILE *fp, void *dptr, char *ignore, struct _PyArray_Descr *)
XXX the ignore argument should be removed next time the API version is bumped. It used to be the separator.
typedef int( PyArray_SetItemFunc)(PyObject *, void *, void *)
typedef int( PyArray_SortFunc)(void *, npy_intp, void *)
typedef void( PyArray_VectorUnaryFunc)(void *, void *, npy_intp, void *, void *)
Array Flags Object

Basic iterator object

FWD declaration
typedef struct PyArrayObject PyArrayObject
The main array object structure. It is recommended to use the macros defined below (PyArray_DATA and friends) access fields here, instead of the members themselves.

Enumeration Type Documentation

anonymous enum
Enumerator:
NPY_NEIGHBORHOOD_ITER_ZERO_PADDING 
NPY_NEIGHBORHOOD_ITER_ONE_PADDING 
NPY_NEIGHBORHOOD_ITER_CONSTANT_PADDING 
NPY_NEIGHBORHOOD_ITER_CIRCULAR_PADDING 
NPY_NEIGHBORHOOD_ITER_MIRROR_PADDING 
Business day conventions for mapping invalid business days to valid business days.
Enumerator:
NPY_BUSDAY_FORWARD 
Go forward in time to the following business day.
NPY_BUSDAY_FOLLOWING 
NPY_BUSDAY_BACKWARD 
Go backward in time to the preceding business day.
NPY_BUSDAY_PRECEDING 
NPY_BUSDAY_MODIFIEDFOLLOWING 
Go forward in time to the following business day, unless it crosses a month boundary, in which case go backward
NPY_BUSDAY_MODIFIEDPRECEDING 
Go backward in time to the preceding business day, unless it crosses a month boundary, in which case go forward.
NPY_BUSDAY_NAT 
Produce a NaT for non-business days.
NPY_BUSDAY_RAISE 
Raise an exception for non-business days.
For specifying allowed casting in operations which support it
Enumerator:
NPY_NO_CASTING 
Only allow identical types
NPY_EQUIV_CASTING 
Allow identical and byte swapped types
NPY_SAFE_CASTING 
Only allow safe casts
NPY_SAME_KIND_CASTING 
Allow safe casts or casts within the same kind
NPY_UNSAFE_CASTING 
Allow any casts
Enumerator:
NPY_CLIP 
NPY_WRAP 
NPY_RAISE 
Enumerator:
NPY_FR_Y 
Years
NPY_FR_M 
Months
NPY_FR_W 
Weeks
NPY_FR_D 
Days
NPY_FR_h 
hours
NPY_FR_m 
minutes
NPY_FR_s 
seconds
NPY_FR_ms 
milliseconds
NPY_FR_us 
microseconds
NPY_FR_ns 
nanoseconds
NPY_FR_ps 
picoseconds
NPY_FR_fs 
femtoseconds
NPY_FR_as 
attoseconds
NPY_FR_GENERIC 
Generic, unbound units, can convert to anything
enum NPY_ORDER
For specifying array memory layout or iteration order
Enumerator:
NPY_ANYORDER 
Fortran order if inputs are all Fortran, C otherwise
NPY_CORDER 
C order
NPY_FORTRANORDER 
Fortran order
NPY_KEEPORDER 
An order as close to the inputs as possible
Enumerator:
NPY_NOSCALAR 
NPY_BOOL_SCALAR 
NPY_INTPOS_SCALAR 
NPY_INTNEG_SCALAR 
NPY_FLOAT_SCALAR 
NPY_COMPLEX_SCALAR 
NPY_OBJECT_SCALAR 
Enumerator:
NPY_SEARCHLEFT 
NPY_SEARCHRIGHT 
Enumerator:
NPY_QUICKSORT 
NPY_HEAPSORT 
NPY_MERGESORT 
These characters correspond to the array type and the struct module
Enumerator:
NPY_BOOLLTR 
NPY_BYTELTR 
NPY_UBYTELTR 
NPY_SHORTLTR 
NPY_USHORTLTR 
NPY_INTLTR 
NPY_UINTLTR 
NPY_LONGLTR 
NPY_ULONGLTR 
NPY_LONGLONGLTR 
NPY_ULONGLONGLTR 
NPY_HALFLTR 
NPY_FLOATLTR 
NPY_DOUBLELTR 
NPY_LONGDOUBLELTR 
NPY_CFLOATLTR 
NPY_CDOUBLELTR 
NPY_CLONGDOUBLELTR 
NPY_OBJECTLTR 
NPY_STRINGLTR 
NPY_STRINGLTR2 
NPY_UNICODELTR 
NPY_VOIDLTR 
NPY_DATETIMELTR 
NPY_TIMEDELTALTR 
NPY_CHARLTR 
NPY_INTPLTR 
No Descriptor, just a define -- this let's Python users specify an array of integers large enough to hold a pointer on the platform
NPY_UINTPLTR 
NPY_GENBOOLLTR 
These are for dtype 'kinds', not dtype 'typecodes' as the above are for.
NPY_SIGNEDLTR 
NPY_UNSIGNEDLTR 
NPY_FLOATINGLTR 
NPY_COMPLEXLTR 
enum NPY_TYPES
Enumerator:
NPY_BOOL 
NPY_BYTE 
NPY_UBYTE 
NPY_SHORT 
NPY_USHORT 
NPY_INT 
NPY_UINT 
NPY_LONG 
NPY_ULONG 
NPY_LONGLONG 
NPY_ULONGLONG 
NPY_FLOAT 
NPY_DOUBLE 
NPY_LONGDOUBLE 
NPY_CFLOAT 
NPY_CDOUBLE 
NPY_CLONGDOUBLE 
NPY_OBJECT 
NPY_STRING 
NPY_UNICODE 
NPY_VOID 
NPY_DATETIME 
New 1.6 types appended, may be integrated into the above in 2.0.
NPY_TIMEDELTA 
NPY_HALF 
NPY_NTYPES 
NPY_NOTYPE 
NPY_CHAR 
special flag
NPY_USERDEF 
leave room for characters
NPY_NTYPES_ABI_COMPATIBLE 
The number of types not including the new 1.6 types

Function Documentation

static NPY_INLINE npy_mask NpyMask_Create ( npy_bool  exposed,
npy_uint8  payload 
) [static]
static NPY_INLINE npy_uint8 NpyMask_GetPayload ( npy_mask  mask) [static]
Bits 1 through 7 of the mask contain the payload.
static NPY_INLINE npy_bool NpyMask_IsExposed ( npy_mask  mask) [static]
Bit 0 of the mask indicates whether a value is exposed or hidden. This is compatible with a 'where=' boolean mask, because NumPy booleans are 1 byte, and contain either the value 0 or 1.
static NPY_INLINE int PyArrayNeighborhoodIter_Next ( PyArrayNeighborhoodIterObject iter) [static]
static NPY_INLINE int PyArrayNeighborhoodIter_Reset ( PyArrayNeighborhoodIterObject iter) [static]
Neighborhood iterator API
General: those work for any mode