~ubuntu-branches/ubuntu/trusty/python-enable/trusty

« back to all changes in this revision

Viewing changes to enthought/kiva/mac/c_numpy.pxd

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-04-05 21:54:28 UTC
  • mfrom: (1.1.5 upstream)
  • mto: (8.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20110405215428-1x2wtubz3ok2kxaq
Tags: upstream-3.4.1
ImportĀ upstreamĀ versionĀ 3.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# :Author:    Travis Oliphant
2
 
 
3
 
cdef extern from "numpy/arrayobject.h":
4
 
 
5
 
    cdef enum NPY_TYPES:
6
 
        NPY_BOOL
7
 
        NPY_BYTE
8
 
        NPY_UBYTE
9
 
        NPY_SHORT
10
 
        NPY_USHORT 
11
 
        NPY_INT
12
 
        NPY_UINT 
13
 
        NPY_LONG
14
 
        NPY_ULONG
15
 
        NPY_LONGLONG
16
 
        NPY_ULONGLONG
17
 
        NPY_FLOAT
18
 
        NPY_DOUBLE 
19
 
        NPY_LONGDOUBLE
20
 
        NPY_CFLOAT
21
 
        NPY_CDOUBLE
22
 
        NPY_CLONGDOUBLE
23
 
        NPY_OBJECT
24
 
        NPY_STRING
25
 
        NPY_UNICODE
26
 
        NPY_VOID
27
 
        NPY_NTYPES
28
 
        NPY_NOTYPE
29
 
 
30
 
    cdef enum requirements:
31
 
        NPY_CONTIGUOUS
32
 
        NPY_FORTRAN
33
 
        NPY_OWNDATA
34
 
        NPY_FORCECAST
35
 
        NPY_ENSURECOPY
36
 
        NPY_ENSUREARRAY
37
 
        NPY_ELEMENTSTRIDES
38
 
        NPY_ALIGNED
39
 
        NPY_NOTSWAPPED
40
 
        NPY_WRITEABLE
41
 
        NPY_UPDATEIFCOPY
42
 
        NPY_ARR_HAS_DESCR
43
 
 
44
 
        NPY_BEHAVED
45
 
        NPY_BEHAVED_NS
46
 
        NPY_CARRAY
47
 
        NPY_CARRAY_RO
48
 
        NPY_FARRAY
49
 
        NPY_FARRAY_RO
50
 
        NPY_DEFAULT
51
 
 
52
 
        NPY_IN_ARRAY
53
 
        NPY_OUT_ARRAY
54
 
        NPY_INOUT_ARRAY
55
 
        NPY_IN_FARRAY
56
 
        NPY_OUT_FARRAY
57
 
        NPY_INOUT_FARRAY
58
 
 
59
 
        NPY_UPDATE_ALL 
60
 
 
61
 
    cdef enum defines:
62
 
        # Note: as of Pyrex 0.9.5, enums are type-checked more strictly, so this
63
 
        # can't be used as an integer.
64
 
        NPY_MAXDIMS
65
 
 
66
 
    ctypedef struct npy_cdouble:
67
 
        double real
68
 
        double imag
69
 
 
70
 
    ctypedef struct npy_cfloat:
71
 
        double real
72
 
        double imag
73
 
 
74
 
    ctypedef int npy_intp 
75
 
 
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
80
 
 
81
 
    ctypedef extern class numpy.ndarray [object PyArrayObject]:
82
 
        cdef char *data
83
 
        cdef int nd
84
 
        cdef npy_intp *dimensions
85
 
        cdef npy_intp *strides
86
 
        cdef object base
87
 
        cdef dtype descr
88
 
        cdef int flags
89
 
 
90
 
    ctypedef extern class numpy.flatiter [object PyArrayIterObject]:
91
 
        cdef int  nd_m1
92
 
        cdef npy_intp index, size
93
 
        cdef ndarray ao
94
 
        cdef char *dataptr
95
 
        
96
 
    ctypedef extern class numpy.broadcast [object PyArrayMultiIterObject]:
97
 
        cdef int numiter
98
 
        cdef npy_intp size, index
99
 
        cdef int nd
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
103
 
        cdef void **iters
104
 
 
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)
123
 
 
124
 
    void PyArray_ITER_NEXT(flatiter it)
125
 
 
126
 
    void import_array()