annotate src/numeric_arrayobject.h @ 3194:9fcb7abf3185 default tip

Remove some gcc 4.7.2 compiler warnings
author Lenard Lindstrom <len-l@telus.net>
date Tue, 23 Apr 2013 19:53:36 -0700
parents 62e182c1c769
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
871
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
1 /*
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
2 * Imported Numeric-24.2 numeric/arrayobject.h header file to make the
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
3 * Numeric dependency obsolete.
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
4 */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
5
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
6 /*
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
7 * Legal Notice
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
8 *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
9 * *** Legal Notice for all LLNL-contributed files ***
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
10 *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
11 * Copyright (c) 1996. The Regents of the University of California. All
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
12 * rights reserved.
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
13 *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
14 * Permission to use, copy, modify, and distribute this software for any
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
15 * purpose without fee is hereby granted, provided that this entire
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
16 * notice is included in all copies of any software which is or includes
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
17 * a copy or modification of this software and in all copies of the
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
18 * supporting documentation for such software.
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
19 *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
20 * This work was produced at the University of California, Lawrence
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
21 * Livermore National Laboratory under contract no. W-7405-ENG-48
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
22 * between the U.S. Department of Energy and The Regents of the
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
23 * University of California for the operation of UC LLNL.
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
24 *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
25 * DISCLAIMER
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
26 *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
27 * This software was prepared as an account of work sponsored by an
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
28 * agency of the United States Government. Neither the United States
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
29 * Government nor the University of California nor any of their
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
30 * employees, makes any warranty, express or implied, or assumes any
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
31 * liability or responsibility for the accuracy, completeness, or
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
32 * usefulness of any information, apparatus, product, or process
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
33 * disclosed, or represents that its use would not infringe
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
34 * privately-owned rights. Reference herein to any specific commercial
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
35 * products, process, or service by trade name, trademark, manufacturer,
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
36 * or otherwise, does not necessarily constitute or imply its
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
37 * endorsement, recommendation, or favoring by the United States
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
38 * Government or the University of California. The views and opinions of
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
39 * authors expressed herein do not necessarily state or reflect those of
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
40 * the United States Government or the University of California, and
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
41 * shall not be used for advertising or product endorsement purposes.
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
42 */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
43
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
44 #ifndef Py_ARRAYOBJECT_H
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
45 #define Py_ARRAYOBJECT_H
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
46 #ifdef __cplusplus
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
47 extern "C" {
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
48 #endif
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
49
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
50 #define REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
51 #define MAX_ELSIZE 16
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
52
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
53 #define PyArray_UNSIGNED_TYPES
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
54
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
55 enum PyArray_TYPES { PyArray_CHAR, PyArray_UBYTE, PyArray_SBYTE,
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
56 PyArray_SHORT, PyArray_USHORT,
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
57 PyArray_INT, PyArray_UINT,
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
58 PyArray_LONG,
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
59 PyArray_FLOAT, PyArray_DOUBLE,
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
60 PyArray_CFLOAT, PyArray_CDOUBLE,
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
61 PyArray_OBJECT,
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
62 PyArray_NTYPES, PyArray_NOTYPE};
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
63
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
64 typedef void (PyArray_VectorUnaryFunc) (char *, int, char *, int, int);
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
65
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
66 typedef PyObject * (PyArray_GetItemFunc) (char *);
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
67 typedef int (PyArray_SetItemFunc) (PyObject *, char *);
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
68
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
69 typedef struct {
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
70 PyArray_VectorUnaryFunc *cast[PyArray_NTYPES]; /* Functions to cast to */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
71 /* all other types */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
72 PyArray_GetItemFunc *getitem;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
73 PyArray_SetItemFunc *setitem;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
74
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
75 int type_num, elsize;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
76 char *one, *zero;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
77 char type;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
78
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
79 } PyArray_Descr;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
80
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
81 /* Array flags */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
82 #define CONTIGUOUS 1
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
83 #define OWN_DIMENSIONS 2
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
84 #define OWN_STRIDES 4
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
85 #define OWN_DATA 8
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
86 #define SAVESPACE 16
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
87
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
88 /* type bit */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
89 #define SAVESPACEBIT 128
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
90
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
91 typedef struct {
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
92 PyObject_HEAD
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
93 char *data;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
94 int nd;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
95 int *dimensions, *strides;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
96 PyObject *base;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
97 PyArray_Descr *descr;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
98 int flags;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
99 PyObject *weakreflist;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
100 } PyArrayObject;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
101
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
102 /* Array Interface flags */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
103 #define FORTRAN 0x002
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
104 #define ALIGNED 0x100
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
105 #define NOTSWAPPED 0x200
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
106 #define WRITEABLE 0x400
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
107
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
108 typedef struct {
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
109 int version;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
110 int nd;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
111 char typekind;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
112 int itemsize;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
113 int flags;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
114 Py_intptr_t *shape;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
115 Py_intptr_t *strides;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
116 void *data;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
117 } PyArrayInterface;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
118
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
119
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
120 /*
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
121 * C API
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
122 */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
123
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
124 /* Type definitions */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
125
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
126 #define PyArray_Type_NUM 0
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
127
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
128 /* Function definitions */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
129
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
130 /* The following are not intended for use in user code, only needed by umath. */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
131 /* If you write your own match library, you might want this function. */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
132 #define PyArray_SetNumericOps_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
133 #define PyArray_SetNumericOps_PROTO (PyObject *)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
134 #define PyArray_SetNumericOps_NUM 1
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
135
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
136 #define PyArray_INCREF_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
137 #define PyArray_INCREF_PROTO (PyArrayObject *ap)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
138 #define PyArray_INCREF_NUM 2
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
139
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
140 #define PyArray_XDECREF_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
141 #define PyArray_XDECREF_PROTO (PyArrayObject *ap)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
142 #define PyArray_XDECREF_NUM 3
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
143
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
144 /* Export the array error object. Is this a good idea? */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
145 #define PyArrayError_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
146 #define PyArrayError_PROTO (void)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
147 #define PyArrayError_NUM 4
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
148
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
149 /* Set the array print function to be a python function */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
150 #define PyArray_SetStringFunction_RET void
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
151 #define PyArray_SetStringFunction_PROTO (PyObject *op, int repr)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
152 #define PyArray_SetStringFunction_NUM 5
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
153
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
154 /* Get the PyArray_Descr structure for a typecode */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
155 #define PyArray_DescrFromType_RET PyArray_Descr *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
156 #define PyArray_DescrFromType_PROTO (int)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
157 #define PyArray_DescrFromType_NUM 6
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
158
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
159 /* Cast an array to a different type */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
160 #define PyArray_Cast_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
161 #define PyArray_Cast_PROTO (PyArrayObject *, int)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
162 #define PyArray_Cast_NUM 7
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
163
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
164 /* Check the type coercion rules */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
165 #define PyArray_CanCastSafely_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
166 #define PyArray_CanCastSafely_PROTO (int fromtype, int totype)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
167 #define PyArray_CanCastSafely_NUM 8
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
168
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
169 /* Return the typecode to use for an object if it was an array */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
170 #define PyArray_ObjectType_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
171 #define PyArray_ObjectType_PROTO (PyObject *, int)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
172 #define PyArray_ObjectType_NUM 9
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
173
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
174 #define _PyArray_multiply_list_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
175 #define _PyArray_multiply_list_PROTO (int *lp, int n)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
176 #define _PyArray_multiply_list_NUM 10
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
177
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
178
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
179 /* The following defines the C API for the array object for most users */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
180
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
181 #define PyArray_SIZE(mp) (_PyArray_multiply_list((mp)->dimensions, (mp)->nd))
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
182 #define PyArray_NBYTES(mp) ((mp)->descr->elsize * PyArray_SIZE(mp))
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
183 /* Obviously this needs some work. */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
184 #define PyArray_ISCONTIGUOUS(m) ((m)->flags & CONTIGUOUS)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
185 #define PyArray_ISSPACESAVER(m) (((PyArrayObject *)m)->flags & SAVESPACE)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
186 #define PyScalarArray_Check(m) (PyArray_Check((m)) && (((PyArrayObject *)(m))->nd == 0))
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
187
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
188 /* Return the size in number of items of an array */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
189 #define PyArray_Size_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
190 #define PyArray_Size_PROTO (PyObject *)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
191 #define PyArray_Size_NUM 11
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
192
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
193
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
194 /* Array creation functions */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
195 /* new_array = PyArray_FromDims(n_dimensions, dimensions[n_dimensions], item_type); */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
196 #define PyArray_FromDims_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
197 #define PyArray_FromDims_PROTO (int, int *, int)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
198 #define PyArray_FromDims_NUM 12
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
199
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
200 /* array_from_existing_data = PyArray_FromDimsAndData(n_dims, dims[n_dims], item_type, old_data); */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
201 /* WARNING: using PyArray_FromDimsAndData is not reccommended! It should only be used to refer to */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
202 /* global arrays that will never be freed (like FORTRAN common blocks). */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
203 #define PyArray_FromDimsAndData_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
204 #define PyArray_FromDimsAndData_PROTO (int, int *, int, char *)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
205 #define PyArray_FromDimsAndData_NUM 13
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
206
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
207 /* Initialize from a python object. */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
208
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
209 /* PyArray_ContiguousFromObject(object, typecode, min_dimensions, max_dimensions) */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
210 /* if max_dimensions = 0, then any number of dimensions are allowed. */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
211 /* If you want an exact number of dimensions, you should use max_dimensions */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
212 /* = min_dimensions. */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
213
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
214 #define PyArray_ContiguousFromObject_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
215 #define PyArray_ContiguousFromObject_PROTO (PyObject *, int, int, int)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
216 #define PyArray_ContiguousFromObject_NUM 14
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
217
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
218 /* Same as contiguous, except guarantees a copy of the original data */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
219 #define PyArray_CopyFromObject_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
220 #define PyArray_CopyFromObject_PROTO (PyObject *, int, int, int)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
221 #define PyArray_CopyFromObject_NUM 15
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
222
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
223 /* Shouldn't be used unless you know what you're doing and are not scared by discontiguous arrays */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
224 #define PyArray_FromObject_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
225 #define PyArray_FromObject_PROTO (PyObject *, int, int, int)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
226 #define PyArray_FromObject_NUM 16
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
227
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
228 /* Return either an array, or if passed a 0d array return the appropriate python scalar */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
229 #define PyArray_Return_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
230 #define PyArray_Return_PROTO (PyArrayObject *)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
231 #define PyArray_Return_NUM 17
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
232
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
233 #define PyArray_Reshape_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
234 #define PyArray_Reshape_PROTO (PyArrayObject *ap, PyObject *shape)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
235 #define PyArray_Reshape_NUM 18
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
236
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
237 #define PyArray_Copy_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
238 #define PyArray_Copy_PROTO (PyArrayObject *ap)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
239 #define PyArray_Copy_NUM 19
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
240
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
241 #define PyArray_Take_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
242 #define PyArray_Take_PROTO (PyObject *ap, PyObject *items, int axis)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
243 #define PyArray_Take_NUM 20
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
244
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
245 /*Getting arrays in various useful forms. */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
246 #define PyArray_As1D_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
247 #define PyArray_As1D_PROTO (PyObject **op, char **ptr, int *d1, int typecode)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
248 #define PyArray_As1D_NUM 21
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
249
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
250 #define PyArray_As2D_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
251 #define PyArray_As2D_PROTO (PyObject **op, char ***ptr, int *d1, int *d2, int typecode)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
252 #define PyArray_As2D_NUM 22
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
253
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
254 #define PyArray_Free_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
255 #define PyArray_Free_PROTO (PyObject *op, char *ptr)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
256 #define PyArray_Free_NUM 23
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
257
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
258 /* array_from_existing_data = PyArray_FromDimsAndDataAndDescr(n_dims, dims[n_dims], descr, old_data); */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
259 /* WARNING: using PyArray_FromDimsAndDataAndDescr is not reccommended! It should only be used to refer to */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
260 /* global arrays that will never be freed (like FORTRAN common blocks). */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
261 #define PyArray_FromDimsAndDataAndDescr_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
262 #define PyArray_FromDimsAndDataAndDescr_PROTO (int, int *, PyArray_Descr *, char *)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
263 #define PyArray_FromDimsAndDataAndDescr_NUM 24
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
264
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
265 #define PyArray_Converter_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
266 #define PyArray_Converter_PROTO (PyObject *, PyObject **)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
267 #define PyArray_Converter_NUM 25
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
268
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
269 #define PyArray_Put_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
270 #define PyArray_Put_PROTO (PyObject *ap, PyObject *items, PyObject* values)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
271 #define PyArray_Put_NUM 26
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
272
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
273 #define PyArray_PutMask_RET PyObject *
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
274 #define PyArray_PutMask_PROTO (PyObject *ap, PyObject *mask, PyObject* values)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
275 #define PyArray_PutMask_NUM 27
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
276
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
277 #define PyArray_CopyArray_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
278 #define PyArray_CopyArray_PROTO (PyArrayObject *dest, PyArrayObject *src)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
279 #define PyArray_CopyArray_NUM 28
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
280
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
281 #define PyArray_ValidType_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
282 #define PyArray_ValidType_PROTO (int type)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
283 #define PyArray_ValidType_NUM 29
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
284
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
285 /* Convert a Python object to a C int, if possible. Checks for
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
286 potential overflow, which is important on machines where
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
287 sizeof(int) != sizeof(long) (note that a Python int is a C long).
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
288 Handles Python ints, Python longs, and any ArrayObject that
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
289 works in int(). */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
290 #define PyArray_IntegerAsInt_RET int
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
291 #define PyArray_IntegerAsInt_PROTO (PyObject *o)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
292 #define PyArray_IntegerAsInt_NUM 30
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
293
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
294 /* Total number of C API pointers */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
295 #define PyArray_API_pointers 31
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
296
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
297
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
298 #ifdef _ARRAY_MODULE
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
299
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
300 extern PyTypeObject PyArray_Type;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
301 #define PyArray_Check(op) ((op)->ob_type == &PyArray_Type)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
302
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
303 extern PyArray_SetNumericOps_RET PyArray_SetNumericOps \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
304 PyArray_SetNumericOps_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
305 extern PyArray_INCREF_RET PyArray_INCREF PyArray_INCREF_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
306 extern PyArray_XDECREF_RET PyArray_XDECREF PyArray_XDECREF_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
307 extern PyArrayError_RET PyArrayError PyArrayError_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
308 extern PyArray_SetStringFunction_RET PyArray_SetStringFunction \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
309 PyArray_SetStringFunction_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
310 extern PyArray_DescrFromType_RET PyArray_DescrFromType \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
311 PyArray_DescrFromType_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
312 extern PyArray_Cast_RET PyArray_Cast PyArray_Cast_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
313 extern PyArray_CanCastSafely_RET PyArray_CanCastSafely \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
314 PyArray_CanCastSafely_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
315 extern PyArray_ObjectType_RET PyArray_ObjectType PyArray_ObjectType_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
316 extern _PyArray_multiply_list_RET _PyArray_multiply_list \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
317 _PyArray_multiply_list_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
318 extern PyArray_Size_RET PyArray_Size PyArray_Size_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
319 extern PyArray_FromDims_RET PyArray_FromDims PyArray_FromDims_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
320 extern PyArray_FromDimsAndData_RET PyArray_FromDimsAndData \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
321 PyArray_FromDimsAndData_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
322 extern PyArray_FromDimsAndDataAndDescr_RET PyArray_FromDimsAndDataAndDescr \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
323 PyArray_FromDimsAndDataAndDescr_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
324 extern PyArray_ContiguousFromObject_RET PyArray_ContiguousFromObject \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
325 PyArray_ContiguousFromObject_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
326 extern PyArray_CopyFromObject_RET PyArray_CopyFromObject \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
327 PyArray_CopyFromObject_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
328 extern PyArray_FromObject_RET PyArray_FromObject PyArray_FromObject_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
329 extern PyArray_Return_RET PyArray_Return PyArray_Return_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
330 extern PyArray_Reshape_RET PyArray_Reshape PyArray_Reshape_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
331 extern PyArray_Copy_RET PyArray_Copy PyArray_Copy_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
332 extern PyArray_Take_RET PyArray_Take PyArray_Take_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
333 extern PyArray_As1D_RET PyArray_As1D PyArray_As1D_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
334 extern PyArray_As2D_RET PyArray_As2D PyArray_As2D_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
335 extern PyArray_Free_RET PyArray_Free PyArray_Free_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
336 extern PyArray_Converter_RET PyArray_Converter PyArray_Converter_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
337 extern PyArray_Put_RET PyArray_Put PyArray_Put_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
338 extern PyArray_PutMask_RET PyArray_PutMask PyArray_PutMask_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
339 extern PyArray_CopyArray_RET PyArray_CopyArray PyArray_CopyArray_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
340 extern PyArray_ValidType_RET PyArray_ValidType PyArray_ValidType_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
341 extern PyArray_IntegerAsInt_RET PyArray_IntegerAsInt PyArray_IntegerAsInt_PROTO;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
342
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
343 #else
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
344
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
345 #if defined(PY_ARRAY_UNIQUE_SYMBOL)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
346 #define PyArray_API PY_ARRAY_UNIQUE_SYMBOL
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
347 #endif
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
348
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
349 /* C API address pointer */
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
350 #if defined(NO_IMPORT) || defined(NO_IMPORT_ARRAY)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
351 extern void **PyArray_API;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
352 #else
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
353 #if defined(PY_ARRAY_UNIQUE_SYMBOL)
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
354 void **PyArray_API;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
355 #else
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
356 static void **PyArray_API;
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
357 #endif
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
358 #endif
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
359
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
360 #define PyArray_Check(op) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
361 ((op)->ob_type == (PyTypeObject *)PyArray_API[PyArray_Type_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
362 #define PyArray_Type *(PyTypeObject *)PyArray_API[PyArray_Type_NUM]
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
363
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
364 #define PyArray_SetNumericOps \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
365 (*(PyArray_SetNumericOps_RET (*)PyArray_SetNumericOps_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
366 PyArray_API[PyArray_SetNumericOps_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
367 #define PyArray_INCREF \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
368 (*(PyArray_INCREF_RET (*)PyArray_INCREF_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
369 PyArray_API[PyArray_INCREF_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
370 #define PyArray_XDECREF \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
371 (*(PyArray_XDECREF_RET (*)PyArray_XDECREF_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
372 PyArray_API[PyArray_XDECREF_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
373 #define PyArrayError \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
374 (*(PyArrayError_RET (*)PyArrayError_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
375 PyArray_API[PyArrayError_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
376 #define PyArray_SetStringFunction \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
377 (*(PyArray_SetStringFunction_RET (*)PyArray_SetStringFunction_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
378 PyArray_API[PyArray_SetStringFunction_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
379 #define PyArray_DescrFromType \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
380 (*(PyArray_DescrFromType_RET (*)PyArray_DescrFromType_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
381 PyArray_API[PyArray_DescrFromType_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
382 #define PyArray_Cast \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
383 (*(PyArray_Cast_RET (*)PyArray_Cast_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
384 PyArray_API[PyArray_Cast_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
385 #define PyArray_CanCastSafely \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
386 (*(PyArray_CanCastSafely_RET (*)PyArray_CanCastSafely_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
387 PyArray_API[PyArray_CanCastSafely_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
388 #define PyArray_ObjectType \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
389 (*(PyArray_ObjectType_RET (*)PyArray_ObjectType_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
390 PyArray_API[PyArray_ObjectType_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
391 #define _PyArray_multiply_list \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
392 (*(_PyArray_multiply_list_RET (*)_PyArray_multiply_list_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
393 PyArray_API[_PyArray_multiply_list_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
394 #define PyArray_Size \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
395 (*(PyArray_Size_RET (*)PyArray_Size_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
396 PyArray_API[PyArray_Size_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
397 #define PyArray_FromDims \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
398 (*(PyArray_FromDims_RET (*)PyArray_FromDims_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
399 PyArray_API[PyArray_FromDims_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
400 #define PyArray_FromDimsAndData \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
401 (*(PyArray_FromDimsAndData_RET (*)PyArray_FromDimsAndData_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
402 PyArray_API[PyArray_FromDimsAndData_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
403 #define PyArray_FromDimsAndDataAndDescr \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
404 (*(PyArray_FromDimsAndDataAndDescr_RET (*)PyArray_FromDimsAndDataAndDescr_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
405 PyArray_API[PyArray_FromDimsAndDataAndDescr_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
406 #define PyArray_ContiguousFromObject \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
407 (*(PyArray_ContiguousFromObject_RET (*)PyArray_ContiguousFromObject_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
408 PyArray_API[PyArray_ContiguousFromObject_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
409 #define PyArray_CopyFromObject \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
410 (*(PyArray_CopyFromObject_RET (*)PyArray_CopyFromObject_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
411 PyArray_API[PyArray_CopyFromObject_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
412 #define PyArray_FromObject \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
413 (*(PyArray_FromObject_RET (*)PyArray_FromObject_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
414 PyArray_API[PyArray_FromObject_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
415 #define PyArray_Return \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
416 (*(PyArray_Return_RET (*)PyArray_Return_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
417 PyArray_API[PyArray_Return_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
418 #define PyArray_Reshape \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
419 (*(PyArray_Reshape_RET (*)PyArray_Reshape_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
420 PyArray_API[PyArray_Reshape_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
421 #define PyArray_Copy \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
422 (*(PyArray_Copy_RET (*)PyArray_Copy_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
423 PyArray_API[PyArray_Copy_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
424 #define PyArray_Take \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
425 (*(PyArray_Take_RET (*)PyArray_Take_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
426 PyArray_API[PyArray_Take_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
427 #define PyArray_As1D \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
428 (*(PyArray_As1D_RET (*)PyArray_As1D_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
429 PyArray_API[PyArray_As1D_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
430 #define PyArray_As2D \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
431 (*(PyArray_As2D_RET (*)PyArray_As2D_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
432 PyArray_API[PyArray_As2D_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
433 #define PyArray_Free \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
434 (*(PyArray_Free_RET (*)PyArray_Free_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
435 PyArray_API[PyArray_Free_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
436 #define PyArray_Converter \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
437 (*(PyArray_Converter_RET (*)PyArray_Converter_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
438 PyArray_API[PyArray_Converter_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
439 #define PyArray_Put \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
440 (*(PyArray_Put_RET (*)PyArray_Put_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
441 PyArray_API[PyArray_Put_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
442 #define PyArray_PutMask \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
443 (*(PyArray_PutMask_RET (*)PyArray_PutMask_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
444 PyArray_API[PyArray_PutMask_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
445 #define PyArray_CopyArray \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
446 (*(PyArray_CopyArray_RET (*)PyArray_CopyArray_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
447 PyArray_API[PyArray_CopyArray_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
448 #define PyArray_ValidType \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
449 (*(PyArray_ValidType_RET (*)PyArray_ValidType_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
450 PyArray_API[PyArray_ValidType_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
451 #define PyArray_IntegerAsInt \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
452 (*(PyArray_IntegerAsInt_RET (*)PyArray_IntegerAsInt_PROTO) \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
453 PyArray_API[PyArray_IntegerAsInt_NUM])
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
454
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
455 #define import_array() \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
456 { \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
457 PyObject *numpy = PyImport_ImportModule("_numpy"); \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
458 if (numpy != NULL) { \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
459 PyObject *module_dict = PyModule_GetDict(numpy); \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
460 PyObject *c_api_object = PyDict_GetItemString(module_dict, "_ARRAY_API"); \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
461 if (PyCObject_Check(c_api_object)) { \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
462 PyArray_API = (void **)PyCObject_AsVoidPtr(c_api_object); \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
463 } \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
464 } \
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
465 }
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
466
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
467 #endif
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
468
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
469
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
470 #ifdef __cplusplus
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
471 }
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
472 #endif
62e182c1c769 Added numpy surface array module. Removed Numeric dependency and imported Numeric/arrayobject header.
marcus
parents:
diff changeset
473 #endif /* !Py_ARRAYOBJECT_H */