Generated by Cython 0.14.1 on Fri Oct 28 12:05:07 2011

Raw output: _home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.c

 1: 
 2: include "interrupt.pxi"  # ctrl-c interrupt block support
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":2
 * 
 * include "interrupt.pxi"  # ctrl-c interrupt block support             # <<<<<<<<<<<<<<
 * include "stdsage.pxi"  # ctrl-c interrupt block support
 * 
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 3: include "stdsage.pxi"  # ctrl-c interrupt block support
 4: 
 5: include "cdefs.pxi"
 6: from sage.rings.all import CC
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":6
 * 
 * include "cdefs.pxi"
 * from sage.rings.all import CC             # <<<<<<<<<<<<<<
 * 
 * def color(z):
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__CC));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__CC));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CC));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__CC); 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__CC, __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 7: 
 8: def color(z):
/* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":8
 * from sage.rings.all import CC
 * 
 * def color(z):             # <<<<<<<<<<<<<<
 *     cdef float x0 = z.real()
 *     cdef float y0 = z.imag()
 */

static PyObject *__pyx_pf_70_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0_color(PyObject *__pyx_self, PyObject *__pyx_v_z); /*proto*/
static char __pyx_doc_70_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0_color[] = "File: _home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx (starting at line 8)";
static PyMethodDef __pyx_mdef_70_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0_color = {__Pyx_NAMESTR("color"), (PyCFunction)__pyx_pf_70_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0_color, METH_O, __Pyx_DOCSTR(__pyx_doc_70_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0_color)};
static PyObject *__pyx_pf_70_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0_color(PyObject *__pyx_self, PyObject *__pyx_v_z) {
  float __pyx_v_x0;
  float __pyx_v_y0;
  float __pyx_v_x;
  float __pyx_v_y;
  int __pyx_v_iteration;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("color");
  __pyx_self = __pyx_self;

  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":8
 * from sage.rings.all import CC
 * 
 * def color(z):             # <<<<<<<<<<<<<<
 *     cdef float x0 = z.real()
 *     cdef float y0 = z.imag()
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_70_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0_color, NULL, __pyx_n_s_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__color, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 9:     cdef float x0 = z.real()
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":9
 * 
 * def color(z):
 *     cdef float x0 = z.real()             # <<<<<<<<<<<<<<
 *     cdef float y0 = z.imag()
 *     cdef float x=0
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_z, __pyx_n_s__real); 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);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_x0 = __pyx_t_3;
 10:     cdef float y0 = z.imag()
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":10
 * def color(z):
 *     cdef float x0 = z.real()
 *     cdef float y0 = z.imag()             # <<<<<<<<<<<<<<
 *     cdef float x=0
 *     cdef float y=0
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_z, __pyx_n_s__imag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_y0 = __pyx_t_3;
 11:     cdef float x=0
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":11
 *     cdef float x0 = z.real()
 *     cdef float y0 = z.imag()
 *     cdef float x=0             # <<<<<<<<<<<<<<
 *     cdef float y=0
 *     cdef int iteration
 */
  __pyx_v_x = 0.0;
 12:     cdef float y=0
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":12
 *     cdef float y0 = z.imag()
 *     cdef float x=0
 *     cdef float y=0             # <<<<<<<<<<<<<<
 *     cdef int iteration
 * 
 */
  __pyx_v_y = 0.0;
 13:     cdef int iteration
 14: 
 15:     for iteration from 0<=iteration<1000:
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":15
 *     cdef int iteration
 * 
 *     for iteration from 0<=iteration<1000:             # <<<<<<<<<<<<<<
 *         if x*x+y*y>4:
 *             break
 */
  for (__pyx_v_iteration = 0; __pyx_v_iteration < 1000; __pyx_v_iteration++) {
 16:         if x*x+y*y>4:
    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":16
 * 
 *     for iteration from 0<=iteration<1000:
 *         if x*x+y*y>4:             # <<<<<<<<<<<<<<
 *             break
 *         x,y=(x*x-y*y+x0, 2*x*y+y0)
 */
    __pyx_t_4 = (((__pyx_v_x * __pyx_v_x) + (__pyx_v_y * __pyx_v_y)) > 4.0);
    if (__pyx_t_4) {
 17:             break
      /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":17
 *     for iteration from 0<=iteration<1000:
 *         if x*x+y*y>4:
 *             break             # <<<<<<<<<<<<<<
 *         x,y=(x*x-y*y+x0, 2*x*y+y0)
 *     else:
 */
      goto __pyx_L6_break;
      goto __pyx_L7;
    }
    __pyx_L7:;
 18:         x,y=(x*x-y*y+x0, 2*x*y+y0)
    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":18
 *         if x*x+y*y>4:
 *             break
 *         x,y=(x*x-y*y+x0, 2*x*y+y0)             # <<<<<<<<<<<<<<
 *     else:
 *         return CC(0,0)
 */
    __pyx_t_3 = (((__pyx_v_x * __pyx_v_x) - (__pyx_v_y * __pyx_v_y)) + __pyx_v_x0);
    __pyx_t_5 = (((2.0 * __pyx_v_x) * __pyx_v_y) + __pyx_v_y0);
    __pyx_v_x = __pyx_t_3;
    __pyx_v_y = __pyx_t_5;
  }
  /*else*/ {
 19:     else:
 20:         return CC(0,0)
    /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":20
 *         x,y=(x*x-y*y+x0, 2*x*y+y0)
 *     else:
 *         return CC(0,0)             # <<<<<<<<<<<<<<
 *     return CC(0,iteration)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__CC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_1), NULL); 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);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L6_break:;
 21:     return CC(0,iteration)
  /* "_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.pyx":21
 *     else:
 *         return CC(0,0)
 *     return CC(0,iteration)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__CC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_iteration); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  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_6);
  __Pyx_AddTraceback("_home_notebook_sage_notebook_sagenb_home_kcrisman_75_code_sage2_spyx_0.color");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}