summaryrefslogtreecommitdiff
path: root/numpy/doc/pyrex
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-07-01 20:54:24 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-07-01 20:54:24 +0000
commitc00b40099043644cca23b6044c276ad72e9b8591 (patch)
tree7034cfb9e3b48e283d37b75ff967a619c6e88b2a /numpy/doc/pyrex
parentb8030615d5b5bef97d212c7ef0ac7dff7e7d3bf6 (diff)
downloadnumpy-c00b40099043644cca23b6044c276ad72e9b8591.tar.gz
Improve c_numpy.pxd a bit. Re-name get_numpy_include() to get_include() and deprecate old name. Add PyArray_ZEROS and PyArray_EMPTY macros which take type-number instead of data-type object.
Diffstat (limited to 'numpy/doc/pyrex')
-rw-r--r--numpy/doc/pyrex/c_numpy.pxd65
1 files changed, 56 insertions, 9 deletions
diff --git a/numpy/doc/pyrex/c_numpy.pxd b/numpy/doc/pyrex/c_numpy.pxd
index 6482101a0..f78a4e609 100644
--- a/numpy/doc/pyrex/c_numpy.pxd
+++ b/numpy/doc/pyrex/c_numpy.pxd
@@ -4,7 +4,8 @@
cdef extern from "numpy/arrayobject.h":
- ctypedef enum PyArray_TYPES:
+
+ cdef enum PyArray_TYPES:
PyArray_BOOL
PyArray_BYTE
PyArray_UBYTE
@@ -14,8 +15,8 @@ cdef extern from "numpy/arrayobject.h":
PyArray_UINT
PyArray_LONG
PyArray_ULONG
- PyArray_LONGLONG
- PyArray_ULONGLONG
+ PyArray_LONGLONG
+ PyArray_ULONGLONG
PyArray_FLOAT
PyArray_DOUBLE
PyArray_LONGDOUBLE
@@ -29,12 +30,51 @@ cdef extern from "numpy/arrayobject.h":
PyArray_NTYPES
PyArray_NOTYPE
+ cdef enum requirements:
+ CONTIGUOUS
+ FORTRAN
+ OWNDATA
+ FORCECAST
+ ENSURECOPY
+ ENSUREARRAY
+ ELEMENTSTRIDES
+ ALIGNED
+ NOTSWAPPED
+ WRITEABLE
+ UPDATEIFCOPY
+ ARR_HAS_DESCR
+
+ BEHAVED_FLAGS
+ BEHAVED_NS_FLAGS
+ CARRAY_FLAGS
+ CARRAY_FLAGS_RO
+ FARRAY_FLAGS
+ FARRAY_FLAGS_RO
+ DEFAULT_FLAGS
+
+ IN_ARRAY
+ OUT_ARRAY
+ INOUT_ARRAY
+ IN_FARRAY
+ OUT_FARRAY
+ INOUT_FARRAY
+
+ UPDATE_ALL_FLAGS
+
+ ctypedef struct cdouble:
+ double real
+ double imag
+
+ ctypedef struct cfloat:
+ double real
+ double imag
+
ctypedef int intp
ctypedef extern class numpy.dtype [object PyArray_Descr]:
cdef int type_num, elsize, alignment
cdef char type, kind, byteorder, hasobject
- cdef object fields, typeobj
+ cdef object fields, typeobj
ctypedef extern class numpy.ndarray [object PyArrayObject]:
cdef char *data
@@ -45,15 +85,22 @@ cdef extern from "numpy/arrayobject.h":
cdef dtype descr
cdef int flags
- ndarray PyArray_SimpleNew(int ndims, intp* dims, int item_type)
+ object PyArray_ZEROS(int ndims, intp* dims, PyArray_TYPES type_num, int fortran)
+ object PyArray_EMPTY(int ndims, intp* dims, PyArray_TYPES type_num, int fortran)
+ dtype PyArray_DescrFromTypeNum(PyArray_TYPES type_num)
+ object PyArray_SimpleNew(int ndims, intp* dims, PyArray_TYPES type_num)
int PyArray_Check(object obj)
- ndarray PyArray_ContiguousFromObject(object obj, PyArray_TYPES type,
+ object PyArray_ContiguousFromAny(object obj, PyArray_TYPES type,
int mindim, int maxdim)
intp PyArray_SIZE(ndarray arr)
+ intp PyArray_NBYTES(ndarray arr)
void *PyArray_DATA(ndarray arr)
- ndarray PyArray_FromAny(object obj, dtype newtype, int mindim, int maxdim,
+ object PyArray_FromAny(object obj, dtype newtype, int mindim, int maxdim,
int requirements, object context)
- ndarray PyArray_NewFromDescr(object subtype, dtype newtype, int nd, intp* dims,
- intp* strides, void* data, int flags, object parent)
+ object PyArray_FROMANY(object obj, PyArray_TYPES type_num, int min,
+ int max, int requirements)
+ object PyArray_NewFromDescr(object subtype, dtype newtype, int nd,
+ intp* dims, intp* strides, void* data,
+ int flags, object parent)
void import_array()