1
# :Author: Travis Oliphant
3
cdef extern from "numpy/arrayobject.h":
30
cdef enum requirements:
62
# Note: as of Pyrex 0.9.5, enums are type-checked more strictly, so this
63
# can't be used as an integer.
66
ctypedef struct npy_cdouble:
70
ctypedef struct npy_cfloat:
76
ctypedef extern class numpy.dtype [object PyArray_Descr]:
77
cdef int type_num, elsize, alignment
78
cdef char type, kind, byteorder, hasobject
79
cdef object fields, typeobj
81
ctypedef extern class numpy.ndarray [object PyArrayObject]:
84
cdef npy_intp *dimensions
85
cdef npy_intp *strides
90
ctypedef extern class numpy.flatiter [object PyArrayIterObject]:
92
cdef npy_intp index, size
96
ctypedef extern class numpy.broadcast [object PyArrayMultiIterObject]:
98
cdef npy_intp size, index
100
# These next two should be arrays of [NPY_MAXITER], but that is
101
# difficult to cleanly specify in Pyrex. Fortunately, it doesn't matter.
102
cdef npy_intp *dimensions
105
object PyArray_ZEROS(int ndims, npy_intp* dims, NPY_TYPES type_num, int fortran)
106
object PyArray_EMPTY(int ndims, npy_intp* dims, NPY_TYPES type_num, int fortran)
107
dtype PyArray_DescrFromTypeNum(NPY_TYPES type_num)
108
object PyArray_SimpleNew(int ndims, npy_intp* dims, NPY_TYPES type_num)
109
int PyArray_Check(object obj)
110
object PyArray_ContiguousFromAny(object obj, NPY_TYPES type,
111
int mindim, int maxdim)
112
npy_intp PyArray_SIZE(ndarray arr)
113
npy_intp PyArray_NBYTES(ndarray arr)
114
void *PyArray_DATA(ndarray arr)
115
object PyArray_FromAny(object obj, dtype newtype, int mindim, int maxdim,
116
int requirements, object context)
117
object PyArray_FROMANY(object obj, NPY_TYPES type_num, int min,
118
int max, int requirements)
119
object PyArray_NewFromDescr(object subtype, dtype newtype, int nd,
120
npy_intp* dims, npy_intp* strides, void* data,
121
int flags, object parent)
122
void* PyArray_GETPTR2(object obj, int i, int j)
124
void PyArray_ITER_NEXT(flatiter it)