Generated by Cython 0.13 on Sun Jun 12 16:03:48 2011

Raw output: _home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.c

 1: 
 2: include "interrupt.pxi"  # ctrl-c interrupt block support
  /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_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));
  __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__mandelbrot_cython); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_2), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  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
  /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":6
 * 
 * include "cdefs.pxi"
 * import 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 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0); 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: def mandelbrot_cython(float x0,float  x1,float  y0,float  y1,int N=200, int L=50, float R=3):
/* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":7
 * include "cdefs.pxi"
 * import 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_83_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0_mandelbrot_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_83_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0_mandelbrot_cython[] = "File: _home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx (starting at line 7)\nreturns an array NxN to be plotted with matrix_plot\n    ";
static PyObject *__pyx_pf_83_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0_mandelbrot_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  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;
  int __pyx_v_h;
  int __pyx_v_i;
  int __pyx_v_k;
  PyObject *__pyx_v_m;
  PyObject *__pyx_v_c;
  PyObject *__pyx_v_z;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x0,&__pyx_n_s__x1,&__pyx_n_s__y0,&__pyx_n_s__y1,&__pyx_n_s__N,&__pyx_n_s__L,&__pyx_n_s__R,0};
  __Pyx_RefNannySetupContext("mandelbrot_cython");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[7] = {0,0,0,0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x0);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x1);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("mandelbrot_cython", 0, 4, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y0);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("mandelbrot_cython", 0, 4, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  3:
      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y1);
      if (likely(values[3])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("mandelbrot_cython", 0, 4, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  4:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__N);
        if (value) { values[4] = value; kw_args--; }
      }
      case  5:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__L);
        if (value) { values[5] = value; kw_args--; }
      }
      case  6:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__R);
        if (value) { values[6] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "mandelbrot_cython") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_x0 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_x0 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_x1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_x1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y0 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_y0 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_y1 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_y1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[4]) {
      __pyx_v_N = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_N = ((int)200);
    }
    if (values[5]) {
      __pyx_v_L = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_L == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_L = ((int)50);
    }
    if (values[6]) {
      __pyx_v_R = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_R == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_R = ((float)3.0);
    }
  } else {
    __pyx_v_N = ((int)200);
    __pyx_v_L = ((int)50);
    __pyx_v_R = ((float)3.0);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  7:
      __pyx_v_R = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 6)); if (unlikely((__pyx_v_R == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  6:
      __pyx_v_L = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 5)); if (unlikely((__pyx_v_L == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  5:
      __pyx_v_N = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  4:
      __pyx_v_y1 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_y1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_y0 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_y0 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_x1 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_x1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_x0 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_x0 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  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 = 7; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.mandelbrot_cython");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_m = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_c = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_z = Py_None; __Pyx_INCREF(Py_None);
 8:     '''returns an array NxN to be plotted with matrix_plot
 9:     '''
 10:     cdef int h, i, k
 11:     m= np.zeros([N,N], dtype=np.int)
  /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":11
 *     '''
 *     cdef int h, i, k
 *     m= np.zeros([N,N], dtype=np.int)             # <<<<<<<<<<<<<<
 *     for i in range(N):
 *         for k in range(N):
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __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 = 11; __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 = 11; __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 = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_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 = 11; __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 = 11; __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 = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__int); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __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 = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_m);
  __pyx_v_m = __pyx_t_5;
  __pyx_t_5 = 0;
 12:     for i in range(N):
  /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":12
 *     cdef int h, i, k
 *     m= np.zeros([N,N], dtype=np.int)
 *     for i in range(N):             # <<<<<<<<<<<<<<
 *         for k in range(N):
 *             c=complex(x0+i*(x1-x0)/N, y0+k*(y1-y0)/N)
 */
  __pyx_t_6 = __pyx_v_N;
  for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;
 13:         for k in range(N):
    /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":13
 *     m= np.zeros([N,N], dtype=np.int)
 *     for i in range(N):
 *         for k in range(N):             # <<<<<<<<<<<<<<
 *             c=complex(x0+i*(x1-x0)/N, y0+k*(y1-y0)/N)
 *             z=complex(0,0)
 */
    __pyx_t_8 = __pyx_v_N;
    for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
      __pyx_v_k = __pyx_t_9;
 14:             c=complex(x0+i*(x1-x0)/N, y0+k*(y1-y0)/N)
      /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":14
 *     for i in range(N):
 *         for k in range(N):
 *             c=complex(x0+i*(x1-x0)/N, y0+k*(y1-y0)/N)             # <<<<<<<<<<<<<<
 *             z=complex(0,0)
 *             h=0
 */
      __pyx_t_10 = (__pyx_v_i * (__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 = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_5 = PyFloat_FromDouble((__pyx_v_x0 + (__pyx_t_10 / __pyx_v_N))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = (__pyx_v_k * (__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 = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = PyFloat_FromDouble((__pyx_v_y0 + (__pyx_t_10 / __pyx_v_N))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_5 = 0;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_Call(((PyObject*)&PyComplex_Type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_c);
      __pyx_v_c = __pyx_t_4;
      __pyx_t_4 = 0;
 15:             z=complex(0,0)
      /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":15
 *         for k in range(N):
 *             c=complex(x0+i*(x1-x0)/N, y0+k*(y1-y0)/N)
 *             z=complex(0,0)             # <<<<<<<<<<<<<<
 *             h=0
 *             while (h<L) and (abs(z)<R):
 */
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0);
      __Pyx_GIVEREF(__pyx_int_0);
      __pyx_t_3 = PyObject_Call(((PyObject*)&PyComplex_Type), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_v_z);
      __pyx_v_z = __pyx_t_3;
      __pyx_t_3 = 0;
 16:             h=0
      /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":16
 *             c=complex(x0+i*(x1-x0)/N, y0+k*(y1-y0)/N)
 *             z=complex(0,0)
 *             h=0             # <<<<<<<<<<<<<<
 *             while (h<L) and (abs(z)<R):
 *                 z=z*z+c
 */
      __pyx_v_h = 0;
 17:             while (h<L) and (abs(z)<R):
      /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":17
 *             z=complex(0,0)
 *             h=0
 *             while (h<L) and (abs(z)<R):             # <<<<<<<<<<<<<<
 *                 z=z*z+c
 *                 h+=1
 */
      while (1) {
        __pyx_t_11 = (__pyx_v_h < __pyx_v_L);
        if (__pyx_t_11) {
          __pyx_t_3 = PyNumber_Absolute(__pyx_v_z); 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 = PyFloat_FromDouble(__pyx_v_R); 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);
          __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); 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_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_12 < 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_13 = __pyx_t_12;
        } else {
          __pyx_t_13 = __pyx_t_11;
        }
        if (!__pyx_t_13) break;
 18:                 z=z*z+c
        /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":18
 *             h=0
 *             while (h<L) and (abs(z)<R):
 *                 z=z*z+c             # <<<<<<<<<<<<<<
 *                 h+=1
 *             m[i,k]=h
 */
        __pyx_t_5 = PyNumber_Multiply(__pyx_v_z, __pyx_v_z); 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_4 = PyNumber_Add(__pyx_t_5, __pyx_v_c); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_z);
        __pyx_v_z = __pyx_t_4;
        __pyx_t_4 = 0;
 19:                 h+=1
        /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":19
 *             while (h<L) and (abs(z)<R):
 *                 z=z*z+c
 *                 h+=1             # <<<<<<<<<<<<<<
 *             m[i,k]=h
 *     return m
 */
        __pyx_v_h += 1;
      }
 20:             m[i,k]=h
      /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":20
 *                 z=z*z+c
 *                 h+=1
 *             m[i,k]=h             # <<<<<<<<<<<<<<
 *     return m
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_5 = 0;
      __pyx_t_3 = 0;
      if (PyObject_SetItem(__pyx_v_m, __pyx_t_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
 21:     return m
  /* "/home/worksheet2/.sage/temp/sagenb/10560/spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx/_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.pyx":21
 *                 h+=1
 *             m[i,k]=h
 *     return m             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_m);
  __pyx_r = __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);
  __Pyx_AddTraceback("_home_sage_sagenb_sage_notebook_alpha_sagenb_home_calcpage123_20_code_sage25_spyx_0.mandelbrot_cython");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_m);
  __Pyx_DECREF(__pyx_v_c);
  __Pyx_DECREF(__pyx_v_z);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}