Generated by Cython 0.14.1 on Wed Jul 13 09:53:05 2011
Raw output: _Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.c
1:
2: include "interrupt.pxi" # ctrl-c interrupt block support
/* "_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_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: def cython_sum2(long n):
/* "_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.pyx":6 * * include "cdefs.pxi" * def cython_sum2(long n): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef long i, s = 0 * for i in range(1, n+1): */ static PyObject *__pyx_pf_75_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0_cython_sum2(PyObject *__pyx_self, PyObject *__pyx_arg_n); /*proto*/ static char __pyx_doc_75_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0_cython_sum2[] = "File: _Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.pyx (starting at line 6)"; static PyMethodDef __pyx_mdef_75_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0_cython_sum2 = {__Pyx_NAMESTR("cython_sum2"), (PyCFunction)__pyx_pf_75_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0_cython_sum2, METH_O, __Pyx_DOCSTR(__pyx_doc_75_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0_cython_sum2)}; static PyObject *__pyx_pf_75_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0_cython_sum2(PyObject *__pyx_self, PyObject *__pyx_arg_n) { long __pyx_v_n; long __pyx_v_i; long __pyx_v_s; PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("cython_sum2"); __pyx_self = __pyx_self; assert(__pyx_arg_n); { __pyx_v_n = __Pyx_PyInt_AsLong(__pyx_arg_n); if (unlikely((__pyx_v_n == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; __Pyx_AddTraceback("_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.cython_sum2"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.pyx":6 * * include "cdefs.pxi" * def cython_sum2(long n): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef long i, s = 0 * for i in range(1, n+1): */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_75_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0_cython_sum2, NULL, __pyx_n_s_2); 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__cython_sum2, __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: cdef long i, s = 0
/* "_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.pyx":7 * include "cdefs.pxi" * def cython_sum2(long n): * cdef long i, s = 0 #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* for i in range(1, n+1): * s += i*i */ __pyx_v_s = 0;
8: for i in range(1, n+1):
/* "_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.pyx":8 * def cython_sum2(long n): * cdef long i, s = 0 * for i in range(1, n+1): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* s += i*i * return s */ __pyx_t_1 = (__pyx_v_n + 1); for (__pyx_t_2 = 1; __pyx_t_2<
__pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2;
9: s += i*i
/* "_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.pyx":9 * cdef long i, s = 0 * for i in range(1, n+1): * s += i*i #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return s */ __pyx_v_s = (__pyx_v_s + (__pyx_v_i * __pyx_v_i)); }
10: return s
/* "_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.pyx":10 * for i in range(1, n+1): * s += i*i * return s #<
<
<
<
<
<
<
<
<
<
<
<
<
<
*/ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyInt_FromLong(__pyx_v_s); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("_Users_wstein__sage_sage_notebook_sagenb_home_admin_720_code_sage297_spyx_0.cython_sum2"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }