Generated by Cython 0.19.1 on Sun Sep 22 21:53:28 2013
Raw output: _home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0.c
1:
2: include "cdefs.pxi"
3: #clang c++
4:
5: from libcpp.vector cimport vector
6:
7: def using_vector(data):
/* "_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0.pyx":7 * from libcpp.vector cimport vector * * def using_vector(data): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef vector[int] v * for x in data: */ static PyObject *__pyx_pf_73_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0_using_vector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) { std::vector<
int> __pyx_v_v; PyObject *__pyx_v_x = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("using_vector", 0); /* "_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0.pyx":7 * from libcpp.vector cimport vector * * def using_vector(data): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef vector[int] v * for x in data: */ __pyx_k_tuple_2 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__v), ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_k_tuple_2); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); /* "_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0.pyx":7 * from libcpp.vector cimport vector * * def using_vector(data): #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef vector[int] v * for x in data: */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_73_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0_1using_vector, NULL, __pyx_n_s_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s__using_vector, __pyx_t_1)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8: cdef vector[int] v
9: for x in data:
/* "_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0.pyx":9 * def using_vector(data): * cdef vector[int] v * for x in data: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* v.push_back(x) * return v.size() */ if (PyList_CheckExact(__pyx_v_data) || PyTuple_CheckExact(__pyx_v_data)) { __pyx_t_1 = __pyx_v_data; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_data); 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_3 = Py_TYPE(__pyx_t_1)->tp_iternext; } for (;;) { if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_COMPILING_IN_CPYTHON __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { if (PyErr_Occurred()) { if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear(); else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF(__pyx_v_x); __pyx_v_x = __pyx_t_4; __pyx_t_4 = 0;
10: v.push_back(x)
/* "_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0.pyx":10 * cdef vector[int] v * for x in data: * v.push_back(x) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return v.size() */ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_x); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_v.push_back(__pyx_t_5); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11: return v.size()
/* "_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0.pyx":11 * for x in data: * v.push_back(x) * return v.size() #<
<
<
<
<
<
<
<
<
<
<
<
<
<
*/ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_v.size()); 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_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_4); __Pyx_AddTraceback("_home_vbraun__sage_sage_notebook_sagenb_home_admin_16_code_sage177_spyx_0.using_vector", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_x); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }