Generated by Cython 0.11.1 on Thu Jun 18 03:51:50 2009
Raw output: _Users_wstein__sage_sage_notebook_worksheets_admin_187_code_sage280_spyx_0.c
1:
goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_1); __Pyx_AddTraceback("_Users_wstein__sage_sage_notebook_worksheets_admin_187_code_sage280_spyx_0"); Py_DECREF(__pyx_m); __pyx_m = 0; __pyx_L0:; __Pyx_FinishRefcountContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } struct __pyx_obj_4sage_9structure_11sage_object_SageObject { PyObject_HEAD };
2: include "interrupt.pxi" # ctrl-c interrupt block support
3: include "stdsage.pxi" # ctrl-c interrupt block support
struct __pyx_obj_4sage_9structure_10generators_Generators { struct __pyx_obj_4sage_9structure_11sage_object_SageObject __pyx_base; struct __pyx_vtabstruct_4sage_9structure_10generators_Generators *__pyx_vtab; PyObject *_obj; PyObject *_index_set; PyObject *_category; }; struct __pyx_vtabstruct_4sage_9structure_10generators_Generators { PyObject *(*get_from_index)(struct __pyx_obj_4sage_9structure_10generators_Generators *, PyObject *, int __pyx_skip_dispatch); PyObject *(*index_set)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch); PyObject *(*category)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch); PyObject *(*obj)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch); PyObject *(*count)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch); PyObject *(*list)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_4sage_9structure_10generators_Generators *__pyx_vtabptr_4sage_9structure_10generators_Generators;
4:
struct __pyx_obj_4sage_10categories_3map_Map { struct __pyx_obj_4sage_9structure_7element_Element __pyx_base; struct __pyx_obj_4sage_9structure_6parent_Parent *_domain; struct __pyx_obj_4sage_9structure_6parent_Parent *_codomain; int _coerce_cost; PyObject *_repr_type_str; }; struct __pyx_vtabstruct_4sage_10categories_3map_Map { struct __pyx_vtabstruct_4sage_9structure_7element_Element __pyx_base; PyObject *(*_update_slots)(struct __pyx_obj_4sage_10categories_3map_Map *, PyObject *); PyObject *(*_extra_slots)(struct __pyx_obj_4sage_10categories_3map_Map *, PyObject *); struct __pyx_obj_4sage_9structure_7element_Element *(*_call_)(struct __pyx_obj_4sage_10categories_3map_Map *, PyObject *, int __pyx_skip_dispatch); struct __pyx_obj_4sage_9structure_7element_Element *(*_call_with_args)(struct __pyx_obj_4sage_10categories_3map_Map *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4sage_10categories_3map_3Map__call_with_args *__pyx_optional_args); PyObject *(*domain)(struct __pyx_obj_4sage_10categories_3map_Map *, int __pyx_skip_dispatch); PyObject *(*codomain)(struct __pyx_obj_4sage_10categories_3map_Map *, int __pyx_skip_dispatch); }; static struct __pyx_vtabstruct_4sage_10categories_3map_Map *__pyx_vtabptr_4sage_10categories_3map_Map;
5: include "cdefs.pxi"
struct __pyx_obj_4sage_10categories_8morphism_Morphism { struct __pyx_obj_4sage_10categories_3map_Map __pyx_base; }; struct __pyx_vtabstruct_4sage_10categories_8morphism_Morphism { struct __pyx_vtabstruct_4sage_10categories_3map_Map __pyx_base; }; static struct __pyx_vtabstruct_4sage_10categories_8morphism_Morphism *__pyx_vtabptr_4sage_10categories_8morphism_Morphism;
6: from sage.rings.integer cimport Integer
7: def mysum_mpir(Integer N):
static PyObject *__pyx_pf_74_Users_wstein__sage_sage_notebook_worksheets_admin_187_code_sage280_spyx_0_mysum_mpir(PyObject *__pyx_self, PyObject *__pyx_v_N); /*proto*/ static char __pyx_doc_74_Users_wstein__sage_sage_notebook_worksheets_admin_187_code_sage280_spyx_0_mysum_mpir[] = "File: _Users_wstein__sage_sage_notebook_worksheets_admin_187_code_sage280_spyx_0.pyx (starting at line 7)"; static PyObject *__pyx_pf_74_Users_wstein__sage_sage_notebook_worksheets_admin_187_code_sage280_spyx_0_mysum_mpir(PyObject *__pyx_self, PyObject *__pyx_v_N) { int __pyx_v_k; mpz_t __pyx_v_s; struct __pyx_obj_4sage_5rings_7integer_Integer *__pyx_v_ans = 0; PyObject *__pyx_r = NULL; __Pyx_SetupRefcountContext("mysum_mpir"); __pyx_self = __pyx_self; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_N), __pyx_ptype_4sage_5rings_7integer_Integer, 1, "N", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8: cdef int k
struct __pyx_obj_4sage_10categories_8morphism_SetMorphism { struct __pyx_obj_4sage_10categories_8morphism_Morphism __pyx_base; PyObject *_function; }; struct __pyx_vtabstruct_4sage_10categories_8morphism_SetMorphism { struct __pyx_vtabstruct_4sage_10categories_8morphism_Morphism __pyx_base; }; static struct __pyx_vtabstruct_4sage_10categories_8morphism_SetMorphism *__pyx_vtabptr_4sage_10categories_8morphism_SetMorphism;
9: cdef mpz_t s
struct __pyx_obj_4sage_5rings_7integer_Integer { struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement __pyx_base; mpz_t value; }; struct __pyx_vtabstruct_4sage_5rings_7integer_Integer { struct __pyx_vtabstruct_4sage_9structure_7element_EuclideanDomainElement __pyx_base; void (*_to_ZZ)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct ZZ *); void (*set_from_mpz)(struct __pyx_obj_4sage_5rings_7integer_Integer *, mpz_t); mpz_t *(*get_value)(struct __pyx_obj_4sage_5rings_7integer_Integer *); PyObject *(*hash_c)(struct __pyx_obj_4sage_5rings_7integer_Integer *); PyObject *(*_pari_c)(struct __pyx_obj_4sage_5rings_7integer_Integer *); PyObject *(*_lshift)(struct __pyx_obj_4sage_5rings_7integer_Integer *, long); PyObject *(*_rshift_)(struct __pyx_obj_4sage_5rings_7integer_Integer *, long, int __pyx_skip_dispatch); PyObject *(*_and)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *); PyObject *(*_or)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *); PyObject *(*_xor)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *); PyObject *(*_floordiv)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *); size_t (*_exact_log_log2_iter)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *, int __pyx_skip_dispatch); size_t (*_exact_log_mpfi_log)(struct __pyx_obj_4sage_5rings_7integer_Integer *, PyObject *, int __pyx_skip_dispatch); struct __pyx_obj_4sage_9structure_7element_RingElement *(*_valuation)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *, int __pyx_skip_dispatch); PyObject *(*_val_unit)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *); struct __pyx_obj_4sage_5rings_7integer_Integer *(*_divide_knowing_divisible_by)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *); int (*_is_power_of)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *); PyObject *(*_reduce_set)(struct __pyx_obj_4sage_5rings_7integer_Integer *, PyObject *); }; static struct __pyx_vtabstruct_4sage_5rings_7integer_Integer *__pyx_vtabptr_4sage_5rings_7integer_Integer;
10: mpz_init(s); mpz_set_si(s,0)
mpz_init(__pyx_v_s); mpz_set_si(__pyx_v_s, 0);
11: for k in range(N):
__pyx_t_1 = __Pyx_PyInt_AsLong(__pyx_v_N); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_k = __pyx_t_2;
12: mpz_add(s, s, N.value)
mpz_add(__pyx_v_s, __pyx_v_s, ((struct __pyx_obj_4sage_5rings_7integer_Integer *)__pyx_v_N)->value); } struct __pyx_obj_4sage_9structure_7element_Element { struct __pyx_obj_4sage_9structure_11sage_object_SageObject __pyx_base; struct __pyx_vtabstruct_4sage_9structure_7element_Element *__pyx_vtab; struct __pyx_obj_4sage_9structure_6parent_Parent *_parent; }; struct __pyx_vtabstruct_4sage_9structure_7element_Element { PyObject *(*_richcmp_c_impl)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_7element_Element *, int); int (*_cmp_c_impl)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_7element_Element *); PyObject *(*_richcmp)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int); PyObject *(*_cmp)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *); PyObject *(*_set_parent_c)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_6parent_Parent *); PyObject *(*base_extend_c)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_6parent_Parent *); PyObject *(*base_extend_c_impl)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_6parent_Parent *); PyObject *(*_rich_to_bool)(struct __pyx_obj_4sage_9structure_7element_Element *, int, int); }; static struct __pyx_vtabstruct_4sage_9structure_7element_Element *__pyx_vtabptr_4sage_9structure_7element_Element;
13: cdef Integer ans = Integer()
__pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4sage_5rings_7integer_Integer)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4sage_5rings_7integer_Integer))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_ans = ((struct __pyx_obj_4sage_5rings_7integer_Integer *)__pyx_t_3); __pyx_t_3 = 0; struct __pyx_obj_4sage_9structure_6parent_Parent { struct __pyx_obj_4sage_9structure_15category_object_CategoryObject __pyx_base; struct __pyx_vtabstruct_4sage_9structure_6parent_Parent *__pyx_vtab; PyObject *_element_constructor; PyObject *_convert_method_name; int _element_init_pass_parent; PyObject *_initial_coerce_list; PyObject *_initial_action_list; PyObject *_initial_convert_list; PyObject *__an_element; PyObject *_coerce_from_list; PyObject *_coerce_from_hash; PyObject *_action_list; PyObject *_action_hash; PyObject *_convert_from_list; PyObject *_convert_from_hash; PyObject *_embedding; }; struct __pyx_vtabstruct_4sage_9structure_6parent_Parent { int (*_richcmp_helper)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int, int __pyx_skip_dispatch); int (*is_exact)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int __pyx_skip_dispatch); int (*init_coerce)(struct __pyx_obj_4sage_9structure_6parent_Parent *, struct __pyx_opt_args_4sage_9structure_6parent_6Parent_init_coerce *__pyx_optional_args); int (*has_coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch); PyObject *(*coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch); PyObject *(*_coerce_map_from_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch); PyObject *(*convert_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch); PyObject *(*_convert_map_from_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch); PyObject *(*get_action)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4sage_9structure_6parent_6Parent_get_action *__pyx_optional_args); PyObject *(*_get_action_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, PyObject *, int, int __pyx_skip_dispatch); PyObject *(*coerce)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch); PyObject *(*an_element)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int __pyx_skip_dispatch); PyObject *(*_an_element_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int __pyx_skip_dispatch); PyObject *(*_generic_convert_map)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch); PyObject *(*discover_coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *); PyObject *(*discover_convert_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *); PyObject *(*discover_action)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, PyObject *, int); }; static struct __pyx_vtabstruct_4sage_9structure_6parent_Parent *__pyx_vtabptr_4sage_9structure_6parent_Parent;
14: mpz_set(ans.value, s)
mpz_set(__pyx_v_ans->value, __pyx_v_s);
15: return ans
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_ans)); __pyx_r = ((PyObject *)__pyx_v_ans); 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_worksheets_admin_187_code_sage280_spyx_0.mysum_mpir"); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF((PyObject *)__pyx_v_ans); __Pyx_XGIVEREF(__pyx_r); __Pyx_FinishRefcountContext(); return __pyx_r; }