summaryrefslogtreecommitdiff
path: root/numpy/doc/numpybook/comparison/pyrex/add.c
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/doc/numpybook/comparison/pyrex/add.c')
-rw-r--r--numpy/doc/numpybook/comparison/pyrex/add.c560
1 files changed, 560 insertions, 0 deletions
diff --git a/numpy/doc/numpybook/comparison/pyrex/add.c b/numpy/doc/numpybook/comparison/pyrex/add.c
new file mode 100644
index 000000000..d5e3bd725
--- /dev/null
+++ b/numpy/doc/numpybook/comparison/pyrex/add.c
@@ -0,0 +1,560 @@
+/* Generated by Pyrex 0.9.4.1 on Thu Aug 17 02:11:41 2006 */
+
+#include "Python.h"
+#include "structmember.h"
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+__PYX_EXTERN_C double pow(double, double);
+#include "numpy/arrayobject.h"
+
+
+typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
+typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
+static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/
+static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
+static int __Pyx_PrintItem(PyObject *); /*proto*/
+static int __Pyx_PrintNewline(void); /*proto*/
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static void __Pyx_ReRaise(void); /*proto*/
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+static PyObject *__Pyx_GetExcValue(void); /*proto*/
+static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
+static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
+static void __Pyx_WriteUnraisable(char *name); /*proto*/
+static void __Pyx_AddTraceback(char *funcname); /*proto*/
+static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
+static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
+static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
+static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_b;
+static int __pyx_lineno;
+static char *__pyx_filename;
+static char **__pyx_f;
+
+/* Declarations from c_numpy */
+
+static PyTypeObject *__pyx_ptype_7c_numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_7c_numpy_ndarray = 0;
+
+/* Declarations from add */
+
+
+/* Implementation of add */
+
+static PyObject *__pyx_n_c_numpy;
+static PyObject *__pyx_n_zadd;
+static PyObject *__pyx_n_cadd;
+static PyObject *__pyx_n_dadd;
+static PyObject *__pyx_n_sadd;
+
+static PyObject *__pyx_f_3add_zadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_3add_zadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_ao = 0;
+ PyObject *__pyx_v_bo = 0;
+ PyArrayObject *__pyx_v_c;
+ PyArrayObject *__pyx_v_a;
+ PyArrayObject *__pyx_v_b;
+ npy_intp __pyx_v_i;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ npy_intp __pyx_2;
+ static char *__pyx_argnames[] = {"ao","bo",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_ao, &__pyx_v_bo)) return 0;
+ Py_INCREF(__pyx_v_ao);
+ Py_INCREF(__pyx_v_bo);
+ __pyx_v_c = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":15 */
+ __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_ao,NPY_CDOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_a));
+ __pyx_v_a = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":16 */
+ __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_bo,NPY_CDOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_b));
+ __pyx_v_b = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":18 */
+ __pyx_1 = PyArray_SimpleNew(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_c));
+ __pyx_v_c = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":21 */
+ __pyx_2 = (__pyx_v_a->dimensions[0]);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":22 */
+ (((npy_cdouble (*))__pyx_v_c->data)[__pyx_v_i]).real = ((((npy_cdouble (*))__pyx_v_a->data)[__pyx_v_i]).real + (((npy_cdouble (*))__pyx_v_b->data)[__pyx_v_i]).real);
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":24 */
+ (((npy_cdouble (*))__pyx_v_c->data)[__pyx_v_i]).imag = ((((npy_cdouble (*))__pyx_v_a->data)[__pyx_v_i]).imag + (((npy_cdouble (*))__pyx_v_b->data)[__pyx_v_i]).imag);
+ __pyx_L2:;
+ }
+ __pyx_L3:;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":26 */
+ Py_INCREF(((PyObject *)__pyx_v_c));
+ __pyx_r = ((PyObject *)__pyx_v_c);
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_AddTraceback("add.zadd");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_c);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_b);
+ Py_DECREF(__pyx_v_ao);
+ Py_DECREF(__pyx_v_bo);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_f_3add_cadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_3add_cadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_ao = 0;
+ PyObject *__pyx_v_bo = 0;
+ PyArrayObject *__pyx_v_c;
+ PyArrayObject *__pyx_v_a;
+ PyArrayObject *__pyx_v_b;
+ npy_intp __pyx_v_i;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ npy_intp __pyx_2;
+ static char *__pyx_argnames[] = {"ao","bo",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_ao, &__pyx_v_bo)) return 0;
+ Py_INCREF(__pyx_v_ao);
+ Py_INCREF(__pyx_v_bo);
+ __pyx_v_c = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":32 */
+ __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_ao,NPY_CFLOAT,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_a));
+ __pyx_v_a = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":33 */
+ __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_bo,NPY_CFLOAT,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_b));
+ __pyx_v_b = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":35 */
+ __pyx_1 = PyArray_SimpleNew(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_c));
+ __pyx_v_c = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":38 */
+ __pyx_2 = (__pyx_v_a->dimensions[0]);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":39 */
+ (((npy_cfloat (*))__pyx_v_c->data)[__pyx_v_i]).real = ((((npy_cfloat (*))__pyx_v_a->data)[__pyx_v_i]).real + (((npy_cfloat (*))__pyx_v_b->data)[__pyx_v_i]).real);
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":41 */
+ (((npy_cfloat (*))__pyx_v_c->data)[__pyx_v_i]).imag = ((((npy_cfloat (*))__pyx_v_a->data)[__pyx_v_i]).imag + (((npy_cfloat (*))__pyx_v_b->data)[__pyx_v_i]).imag);
+ __pyx_L2:;
+ }
+ __pyx_L3:;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":43 */
+ Py_INCREF(((PyObject *)__pyx_v_c));
+ __pyx_r = ((PyObject *)__pyx_v_c);
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_AddTraceback("add.cadd");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_c);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_b);
+ Py_DECREF(__pyx_v_ao);
+ Py_DECREF(__pyx_v_bo);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_f_3add_dadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_3add_dadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_ao = 0;
+ PyObject *__pyx_v_bo = 0;
+ PyArrayObject *__pyx_v_c;
+ PyArrayObject *__pyx_v_a;
+ PyArrayObject *__pyx_v_b;
+ npy_intp __pyx_v_i;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ npy_intp __pyx_2;
+ static char *__pyx_argnames[] = {"ao","bo",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_ao, &__pyx_v_bo)) return 0;
+ Py_INCREF(__pyx_v_ao);
+ Py_INCREF(__pyx_v_bo);
+ __pyx_v_c = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":50 */
+ __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_ao,NPY_DOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_a));
+ __pyx_v_a = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":51 */
+ __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_bo,NPY_DOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_b));
+ __pyx_v_b = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":53 */
+ __pyx_1 = PyArray_SimpleNew(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_c));
+ __pyx_v_c = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":56 */
+ __pyx_2 = (__pyx_v_a->dimensions[0]);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":57 */
+ (((double (*))__pyx_v_c->data)[__pyx_v_i]) = ((((double (*))__pyx_v_a->data)[__pyx_v_i]) + (((double (*))__pyx_v_b->data)[__pyx_v_i]));
+ __pyx_L2:;
+ }
+ __pyx_L3:;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":59 */
+ Py_INCREF(((PyObject *)__pyx_v_c));
+ __pyx_r = ((PyObject *)__pyx_v_c);
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_AddTraceback("add.dadd");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_c);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_b);
+ Py_DECREF(__pyx_v_ao);
+ Py_DECREF(__pyx_v_bo);
+ return __pyx_r;
+}
+
+static PyObject *__pyx_f_3add_sadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_3add_sadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_ao = 0;
+ PyObject *__pyx_v_bo = 0;
+ PyArrayObject *__pyx_v_c;
+ PyArrayObject *__pyx_v_a;
+ PyArrayObject *__pyx_v_b;
+ npy_intp __pyx_v_i;
+ PyObject *__pyx_r;
+ PyObject *__pyx_1 = 0;
+ npy_intp __pyx_2;
+ static char *__pyx_argnames[] = {"ao","bo",0};
+ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_ao, &__pyx_v_bo)) return 0;
+ Py_INCREF(__pyx_v_ao);
+ Py_INCREF(__pyx_v_bo);
+ __pyx_v_c = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+ __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":66 */
+ __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_ao,NPY_FLOAT,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_a));
+ __pyx_v_a = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":67 */
+ __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_bo,NPY_FLOAT,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_b));
+ __pyx_v_b = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":69 */
+ __pyx_1 = PyArray_SimpleNew(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
+ if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_v_c));
+ __pyx_v_c = ((PyArrayObject *)__pyx_1);
+ __pyx_1 = 0;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":72 */
+ __pyx_2 = (__pyx_v_a->dimensions[0]);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":73 */
+ (((float (*))__pyx_v_c->data)[__pyx_v_i]) = ((((float (*))__pyx_v_a->data)[__pyx_v_i]) + (((float (*))__pyx_v_b->data)[__pyx_v_i]));
+ __pyx_L2:;
+ }
+ __pyx_L3:;
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":75 */
+ Py_INCREF(((PyObject *)__pyx_v_c));
+ __pyx_r = ((PyObject *)__pyx_v_c);
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; Py_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1:;
+ Py_XDECREF(__pyx_1);
+ __Pyx_AddTraceback("add.sadd");
+ __pyx_r = 0;
+ __pyx_L0:;
+ Py_DECREF(__pyx_v_c);
+ Py_DECREF(__pyx_v_a);
+ Py_DECREF(__pyx_v_b);
+ Py_DECREF(__pyx_v_ao);
+ Py_DECREF(__pyx_v_bo);
+ return __pyx_r;
+}
+
+static __Pyx_InternTabEntry __pyx_intern_tab[] = {
+ {&__pyx_n_c_numpy, "c_numpy"},
+ {&__pyx_n_cadd, "cadd"},
+ {&__pyx_n_dadd, "dadd"},
+ {&__pyx_n_sadd, "sadd"},
+ {&__pyx_n_zadd, "zadd"},
+ {0, 0}
+};
+
+static struct PyMethodDef __pyx_methods[] = {
+ {"zadd", (PyCFunction)__pyx_f_3add_zadd, METH_VARARGS|METH_KEYWORDS, 0},
+ {"cadd", (PyCFunction)__pyx_f_3add_cadd, METH_VARARGS|METH_KEYWORDS, 0},
+ {"dadd", (PyCFunction)__pyx_f_3add_dadd, METH_VARARGS|METH_KEYWORDS, 0},
+ {"sadd", (PyCFunction)__pyx_f_3add_sadd, METH_VARARGS|METH_KEYWORDS, 0},
+ {0, 0, 0, 0}
+};
+
+static void __pyx_init_filenames(void); /*proto*/
+
+PyMODINIT_FUNC initadd(void); /*proto*/
+PyMODINIT_FUNC initadd(void) {
+ __pyx_init_filenames();
+ __pyx_m = Py_InitModule4("add", __pyx_methods, 0, 0, PYTHON_API_VERSION);
+ if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
+ __pyx_b = PyImport_AddModule("__builtin__");
+ if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
+ if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
+ __pyx_ptype_7c_numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (!__pyx_ptype_7c_numpy_dtype) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 74; goto __pyx_L1;}
+ __pyx_ptype_7c_numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (!__pyx_ptype_7c_numpy_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; goto __pyx_L1;}
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":9 */
+ import_array();
+
+ /* "/Users/oliphant/numpybook/pyrex/add.pyx":62 */
+ return;
+ __pyx_L1:;
+ __Pyx_AddTraceback("add");
+}
+
+static char *__pyx_filenames[] = {
+ "add.pyx",
+ "c_numpy.pxd",
+};
+
+/* Runtime support code */
+
+static void __pyx_init_filenames(void) {
+ __pyx_f = __pyx_filenames;
+}
+
+static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (!type) {
+ PyErr_Format(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (obj == Py_None || PyObject_TypeCheck(obj, type))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
+ obj->ob_type->tp_name, type->tp_name);
+ return 0;
+}
+
+static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
+ while (t->p) {
+ *t->p = PyString_InternFromString(t->s);
+ if (!*t->p)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
+ long size)
+{
+ PyObject *py_module_name = 0;
+ PyObject *py_class_name = 0;
+ PyObject *py_name_list = 0;
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+
+ py_module_name = PyString_FromString(module_name);
+ if (!py_module_name)
+ goto bad;
+ py_class_name = PyString_FromString(class_name);
+ if (!py_class_name)
+ goto bad;
+ py_name_list = PyList_New(1);
+ if (!py_name_list)
+ goto bad;
+ Py_INCREF(py_class_name);
+ if (PyList_SetItem(py_name_list, 0, py_class_name) < 0)
+ goto bad;
+ py_module = __Pyx_Import(py_module_name, py_name_list);
+ if (!py_module)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_class_name);
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%s.%s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+ if (((PyTypeObject *)result)->tp_basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%s.%s does not appear to be the correct type object",
+ module_name, class_name);
+ goto bad;
+ }
+ goto done;
+bad:
+ Py_XDECREF(result);
+ result = 0;
+done:
+ Py_XDECREF(py_module_name);
+ Py_XDECREF(py_class_name);
+ Py_XDECREF(py_name_list);
+ return (PyTypeObject *)result;
+}
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
+ PyObject *__import__ = 0;
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
+ if (!__import__)
+ goto bad;
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ module = PyObject_CallFunction(__import__, "OOOO",
+ name, global_dict, empty_dict, list);
+bad:
+ Py_XDECREF(empty_list);
+ Py_XDECREF(__import__);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+
+static void __Pyx_AddTraceback(char *funcname) {
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ PyObject *py_globals = 0;
+ PyObject *empty_tuple = 0;
+ PyObject *empty_string = 0;
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+
+ py_srcfile = PyString_FromString(__pyx_filename);
+ if (!py_srcfile) goto bad;
+ py_funcname = PyString_FromString(funcname);
+ if (!py_funcname) goto bad;
+ py_globals = PyModule_GetDict(__pyx_m);
+ if (!py_globals) goto bad;
+ empty_tuple = PyTuple_New(0);
+ if (!empty_tuple) goto bad;
+ empty_string = PyString_FromString("");
+ if (!empty_string) goto bad;
+ py_code = PyCode_New(
+ 0, /*int argcount,*/
+ 0, /*int nlocals,*/
+ 0, /*int stacksize,*/
+ 0, /*int flags,*/
+ empty_string, /*PyObject *code,*/
+ empty_tuple, /*PyObject *consts,*/
+ empty_tuple, /*PyObject *names,*/
+ empty_tuple, /*PyObject *varnames,*/
+ empty_tuple, /*PyObject *freevars,*/
+ empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ __pyx_lineno, /*int firstlineno,*/
+ empty_string /*PyObject *lnotab*/
+ );
+ if (!py_code) goto bad;
+ py_frame = PyFrame_New(
+ PyThreadState_Get(), /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ py_globals, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ py_frame->f_lineno = __pyx_lineno;
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ Py_XDECREF(empty_tuple);
+ Py_XDECREF(empty_string);
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}