Generated by Cython 0.17pre on Wed Oct 10 13:53:36 2012
Raw output: _mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.c
1:
2: include "interrupt.pxi" # ctrl-c interrupt block support
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":2 * * include "interrupt.pxi" # ctrl-c interrupt block support #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* include "stdsage.pxi" # ctrl-c interrupt block support * */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1))<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3: include "stdsage.pxi" # ctrl-c interrupt block support
4:
5: include "cdefs.pxi"
6: import numpy as np
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":6 * * include "cdefs.pxi" * import numpy as np #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cimport numpy as np * */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__np, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7: cimport numpy as np
8:
9: def mandelbrot_cython(float x0,float x1,float y0,float y1,
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":9 * cimport numpy as np * * def mandelbrot_cython(float x0,float x1,float y0,float y1, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* int N=200, int L=50, float R=3): * '''returns an array NxN to be plotted with matrix_plot */ static PyObject *__pyx_pf_60_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0_mandelbrot_cython(CYTHON_UNUSED PyObject *__pyx_self, float __pyx_v_x0, float __pyx_v_x1, float __pyx_v_y0, float __pyx_v_y1, int __pyx_v_N, int __pyx_v_L, float __pyx_v_R) { __pyx_t_double_complex __pyx_v_c; __pyx_t_double_complex __pyx_v_z; __pyx_t_double_complex __pyx_v_I; float __pyx_v_deltax; float __pyx_v_deltay; float __pyx_v_R2; int __pyx_v_h; int __pyx_v_j; int __pyx_v_k; PyArrayObject *__pyx_v_m = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_m; __Pyx_Buffer __pyx_pybuffer_m; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mandelbrot_cython", 0); __pyx_pybuffer_m.pybuffer.buf = NULL; __pyx_pybuffer_m.refcount = 0; __pyx_pybuffernd_m.data = NULL; __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m; /* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":9 * cimport numpy as np * * def mandelbrot_cython(float x0,float x1,float y0,float y1, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* int N=200, int L=50, float R=3): * '''returns an array NxN to be plotted with matrix_plot */ __pyx_k_tuple_15 = PyTuple_New(17); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_15); __Pyx_INCREF(((PyObject *)__pyx_n_s__x0)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_n_s__x0)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x0)); __Pyx_INCREF(((PyObject *)__pyx_n_s__x1)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 1, ((PyObject *)__pyx_n_s__x1)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x1)); __Pyx_INCREF(((PyObject *)__pyx_n_s__y0)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 2, ((PyObject *)__pyx_n_s__y0)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__y0)); __Pyx_INCREF(((PyObject *)__pyx_n_s__y1)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 3, ((PyObject *)__pyx_n_s__y1)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__y1)); __Pyx_INCREF(((PyObject *)__pyx_n_s__N)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 4, ((PyObject *)__pyx_n_s__N)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__N)); __Pyx_INCREF(((PyObject *)__pyx_n_s__L)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 5, ((PyObject *)__pyx_n_s__L)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__L)); __Pyx_INCREF(((PyObject *)__pyx_n_s__R)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 6, ((PyObject *)__pyx_n_s__R)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__R)); __Pyx_INCREF(((PyObject *)__pyx_n_s__c)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 7, ((PyObject *)__pyx_n_s__c)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__c)); __Pyx_INCREF(((PyObject *)__pyx_n_s__z)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 8, ((PyObject *)__pyx_n_s__z)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__z)); __Pyx_INCREF(((PyObject *)__pyx_n_s__I)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 9, ((PyObject *)__pyx_n_s__I)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__I)); __Pyx_INCREF(((PyObject *)__pyx_n_s__deltax)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 10, ((PyObject *)__pyx_n_s__deltax)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltax)); __Pyx_INCREF(((PyObject *)__pyx_n_s__deltay)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 11, ((PyObject *)__pyx_n_s__deltay)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deltay)); __Pyx_INCREF(((PyObject *)__pyx_n_s__R2)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 12, ((PyObject *)__pyx_n_s__R2)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__R2)); __Pyx_INCREF(((PyObject *)__pyx_n_s__h)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 13, ((PyObject *)__pyx_n_s__h)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__h)); __Pyx_INCREF(((PyObject *)__pyx_n_s__j)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 14, ((PyObject *)__pyx_n_s__j)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__j)); __Pyx_INCREF(((PyObject *)__pyx_n_s__k)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 15, ((PyObject *)__pyx_n_s__k)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__k)); __Pyx_INCREF(((PyObject *)__pyx_n_s__m)); PyTuple_SET_ITEM(__pyx_k_tuple_15, 16, ((PyObject *)__pyx_n_s__m)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__m)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); /* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":9 * cimport numpy as np * * def mandelbrot_cython(float x0,float x1,float y0,float y1, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* int N=200, int L=50, float R=3): * '''returns an array NxN to be plotted with matrix_plot */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_60_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0_1mandelbrot_cython, NULL, __pyx_n_s_18); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__mandelbrot_cython, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10: int N=200, int L=50, float R=3):
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":10 * * def mandelbrot_cython(float x0,float x1,float y0,float y1, * int N=200, int L=50, float R=3): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* '''returns an array NxN to be plotted with matrix_plot * ''' */ __pyx_v_R = ((float)3.0); } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mandelbrot_cython", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.mandelbrot_cython", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_60_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0_mandelbrot_cython(__pyx_self, __pyx_v_x0, __pyx_v_x1, __pyx_v_y0, __pyx_v_y1, __pyx_v_N, __pyx_v_L, __pyx_v_R); __Pyx_RefNannyFinishContext(); return __pyx_r; }
11: '''returns an array NxN to be plotted with matrix_plot
12: '''
13: cdef double complex c, z, I
14: cdef float deltax, deltay, R2 = R*R
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":14 * ''' * cdef double complex c, z, I * cdef float deltax, deltay, R2 = R*R #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef int h, j, k * cdef np.ndarray[np.uint16_t, ndim=2] m */ __pyx_v_R2 = (__pyx_v_R * __pyx_v_R);
15: cdef int h, j, k
16: cdef np.ndarray[np.uint16_t, ndim=2] m
17: m = np.zeros((N,N), dtype=np.uint16)
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":17 * cdef int h, j, k * cdef np.ndarray[np.uint16_t, ndim=2] m * m = np.zeros((N,N), dtype=np.uint16) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* I = complex(0,1) * deltax = (x1-x0)/N */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__uint16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer); __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_7<
0)) { PyErr_Fetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_10); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_8, __pyx_t_9, __pyx_t_10); } } __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1]; if (unlikely(__pyx_t_7<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __pyx_v_m = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;
18: I = complex(0,1)
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":18 * cdef np.ndarray[np.uint16_t, ndim=2] m * m = np.zeros((N,N), dtype=np.uint16) * I = complex(0,1) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltax = (x1-x0)/N * deltay = (y1-y0)/N */ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyComplex_Type))), ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __Pyx_PyComplex_As___pyx_t_double_complex(__pyx_t_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_I = __pyx_t_11; /* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":18 * cdef np.ndarray[np.uint16_t, ndim=2] m * m = np.zeros((N,N), dtype=np.uint16) * I = complex(0,1) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltax = (x1-x0)/N * deltay = (y1-y0)/N */ __pyx_k_tuple_1 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_1); __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_k_tuple_1, 0, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __Pyx_INCREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_k_tuple_1, 1, __pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));
19: deltax = (x1-x0)/N
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":19 * m = np.zeros((N,N), dtype=np.uint16) * I = complex(0,1) * deltax = (x1-x0)/N #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* deltay = (y1-y0)/N * for j in range(N): */ __pyx_t_12 = (__pyx_v_x1 - __pyx_v_x0); if (unlikely(__pyx_v_N == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_deltax = (__pyx_t_12 / __pyx_v_N);
20: deltay = (y1-y0)/N
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":20 * I = complex(0,1) * deltax = (x1-x0)/N * deltay = (y1-y0)/N #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* for j in range(N): * for k in range(N): */ __pyx_t_12 = (__pyx_v_y1 - __pyx_v_y0); if (unlikely(__pyx_v_N == 0)) { PyErr_Format(PyExc_ZeroDivisionError, "float division"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_deltay = (__pyx_t_12 / __pyx_v_N);
21: for j in range(N):
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":21 * deltax = (x1-x0)/N * deltay = (y1-y0)/N * for j in range(N): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* for k in range(N): * c = (x0+j*deltax)+ I*(y0+k*deltay) */ __pyx_t_7 = __pyx_v_N; for (__pyx_t_13 = 0; __pyx_t_13<
__pyx_t_7; __pyx_t_13+=1) { __pyx_v_j = __pyx_t_13;
22: for k in range(N):
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":22 * deltay = (y1-y0)/N * for j in range(N): * for k in range(N): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* c = (x0+j*deltax)+ I*(y0+k*deltay) * z=0 */ __pyx_t_14 = __pyx_v_N; for (__pyx_t_15 = 0; __pyx_t_15<
__pyx_t_14; __pyx_t_15+=1) { __pyx_v_k = __pyx_t_15;
23: c = (x0+j*deltax)+ I*(y0+k*deltay)
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":23 * for j in range(N): * for k in range(N): * c = (x0+j*deltax)+ I*(y0+k*deltay) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* z=0 * h=0 */ __pyx_v_c = __Pyx_c_sum(__pyx_t_double_complex_from_parts((__pyx_v_x0 + (__pyx_v_j * __pyx_v_deltax)), 0), __Pyx_c_prod(__pyx_v_I, __pyx_t_double_complex_from_parts((__pyx_v_y0 + (__pyx_v_k * __pyx_v_deltay)), 0)));
24: z=0
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":24 * for k in range(N): * c = (x0+j*deltax)+ I*(y0+k*deltay) * z=0 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* h=0 * while (h<
L and */ __pyx_v_z = __pyx_t_double_complex_from_parts(0, 0);
25: h=0
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":25 * c = (x0+j*deltax)+ I*(y0+k*deltay) * z=0 * h=0 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* while (h<
L and * z.real**2 + z.imag**2<
R2): */ __pyx_v_h = 0;
26: while (h<L and
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":26 * z=0 * h=0 * while (h<
L and #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* z.real**2 + z.imag**2<
R2): * z=z*z+c */ while (1) { __pyx_t_16 = (__pyx_v_h<
__pyx_v_L); if (__pyx_t_16) {
27: z.real**2 + z.imag**2 < R2):
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":27 * h=0 * while (h<
L and * z.real**2 + z.imag**2<
R2): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* z=z*z+c * h+=1 */ __pyx_t_17 = ((pow(__Pyx_CREAL(__pyx_v_z), 2.0) + pow(__Pyx_CIMAG(__pyx_v_z), 2.0))<
__pyx_v_R2); __pyx_t_18 = __pyx_t_17; } else { __pyx_t_18 = __pyx_t_16; } if (!__pyx_t_18) break;
28: z=z*z+c
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":28 * while (h<
L and * z.real**2 + z.imag**2<
R2): * z=z*z+c #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* h+=1 * m[j,k]=h */ __pyx_v_z = __Pyx_c_sum(__Pyx_c_prod(__pyx_v_z, __pyx_v_z), __pyx_v_c);
29: h+=1
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":29 * z.real**2 + z.imag**2<
R2): * z=z*z+c * h+=1 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* m[j,k]=h * return m */ __pyx_v_h = (__pyx_v_h + 1); }
30: m[j,k]=h
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":30 * z=z*z+c * h+=1 * m[j,k]=h #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return m */ __pyx_t_19 = __pyx_v_j; __pyx_t_20 = __pyx_v_k; __pyx_t_21 = -1; if (__pyx_t_19<
0) { __pyx_t_19 += __pyx_pybuffernd_m.diminfo[0].shape; if (unlikely(__pyx_t_19<
0)) __pyx_t_21 = 0; } else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_m.diminfo[0].shape)) __pyx_t_21 = 0; if (__pyx_t_20<
0) { __pyx_t_20 += __pyx_pybuffernd_m.diminfo[1].shape; if (unlikely(__pyx_t_20<
0)) __pyx_t_21 = 1; } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_m.diminfo[1].shape)) __pyx_t_21 = 1; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_uint16_t *, __pyx_pybuffernd_m.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_m.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_m.diminfo[1].strides) = __pyx_v_h; } }
31: return m
/* "_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.pyx":31 * h+=1 * m[j,k]=h * return m #<
<
<
<
<
<
<
<
<
<
<
<
<
<
*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_m)); __pyx_r = ((PyObject *)__pyx_v_m); goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback("_mnt_sagenb_notebook_sagenb_home_wstein_1_code_sage12_spyx_0.mandelbrot_cython", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer); __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_m); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ static char __pyx_doc_5numpy_7ndarray___getbuffer__[] = "File: (starting at line 193)"; #if CYTHON_COMPILING_IN_CPYTHON struct wrapperbase __pyx_wrapperbase_5numpy_7ndarray___getbuffer__; #endif static int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); __Pyx_RefNannyFinishContext(); return __pyx_r; }