Generated by Cython 0.13 on Fri Aug 19 11:14:22 2011
Raw output: _home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.c
1:
2: include "interrupt.pxi" # ctrl-c interrupt block support
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_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: import numpy as np
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":6 * * include "cdefs.pxi" * import numpy as np #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cimport numpy as np * */ __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: cimport numpy as np
8:
9: cdouble = np.double
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":9 * cimport numpy as np * * cdouble = np.double #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* ctypedef np.double_t cdouble_t * */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); 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_GetAttr(__pyx_t_1, __pyx_n_s__double); 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; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cdouble, __pyx_t_2)<
0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10: ctypedef np.double_t cdouble_t
11:
12: cpdef double inv_cross(np.ndarray x, int m,
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":12 * ctypedef np.double_t cdouble_t * * cpdef double inv_cross(np.ndarray x, int m, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* np.ndarray l_list, np.ndarray r_list, np.ndarray z_list): * cdef double k_f = x[0] */ static PyObject *__pyx_pf_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_inv_cross(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static double __pyx_f_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_inv_cross(PyArrayObject *__pyx_v_x, int __pyx_v_m, PyArrayObject *__pyx_v_l_list, PyArrayObject *__pyx_v_r_list, PyArrayObject *__pyx_v_z_list, int __pyx_skip_dispatch) { double __pyx_v_k_f; double __pyx_v_k_r; PyArrayObject *__pyx_v_I = 0; PyArrayObject *__pyx_v_coeffs = 0; PyArrayObject *__pyx_v_monoms = 0; unsigned int __pyx_v_i; double __pyx_v_l; double __pyx_v_r; double __pyx_v_z; Py_buffer __pyx_bstruct_monoms; Py_ssize_t __pyx_bstride_0_monoms = 0; Py_ssize_t __pyx_bshape_0_monoms = 0; Py_buffer __pyx_bstruct_I; Py_ssize_t __pyx_bstride_0_I = 0; Py_ssize_t __pyx_bshape_0_I = 0; Py_buffer __pyx_bstruct_coeffs; Py_ssize_t __pyx_bstride_0_coeffs = 0; Py_ssize_t __pyx_bshape_0_coeffs = 0; double __pyx_r; __Pyx_RefNannySetupContext("inv_cross"); __pyx_bstruct_I.buf = NULL; __pyx_bstruct_coeffs.buf = NULL; __pyx_bstruct_monoms.buf = NULL; /* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":12 * ctypedef np.double_t cdouble_t * * cpdef double inv_cross(np.ndarray x, int m, #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* np.ndarray l_list, np.ndarray r_list, np.ndarray z_list): * cdef double k_f = x[0] */ static PyObject *__pyx_pf_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_inv_cross(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_inv_cross[] = "File: _home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx (starting at line 12)"; static PyObject *__pyx_pf_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_inv_cross(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *__pyx_v_x = 0; int __pyx_v_m; PyArrayObject *__pyx_v_l_list = 0; PyArrayObject *__pyx_v_r_list = 0; PyArrayObject *__pyx_v_z_list = 0; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__m,&__pyx_n_s__l_list,&__pyx_n_s__r_list,&__pyx_n_s__z_list,0}; __Pyx_RefNannySetupContext("inv_cross"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[5] = {0,0,0,0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { 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__x); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__m); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("inv_cross", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__l_list); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("inv_cross", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__r_list); if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("inv_cross", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 4: values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__z_list); if (likely(values[4])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("inv_cross", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "inv_cross")<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_x = ((PyArrayObject *)values[0]); __pyx_v_m = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_l_list = ((PyArrayObject *)values[2]); __pyx_v_r_list = ((PyArrayObject *)values[3]); __pyx_v_z_list = ((PyArrayObject *)values[4]); } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { goto __pyx_L5_argtuple_error; } else { __pyx_v_x = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0)); __pyx_v_m = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_l_list = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 2)); __pyx_v_r_list = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3)); __pyx_v_z_list = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 4)); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("inv_cross", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.inv_cross"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1, "x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l_list), __pyx_ptype_5numpy_ndarray, 1, "l_list", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_r_list), __pyx_ptype_5numpy_ndarray, 1, "r_list", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_z_list), __pyx_ptype_5numpy_ndarray, 1, "z_list", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_f_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_inv_cross(__pyx_v_x, __pyx_v_m, __pyx_v_l_list, __pyx_v_r_list, __pyx_v_z_list, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __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_AddTraceback("_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.inv_cross"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; }
13: np.ndarray l_list, np.ndarray r_list, np.ndarray z_list):
14: cdef double k_f = x[0]
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":14 * cpdef double inv_cross(np.ndarray x, int m, * np.ndarray l_list, np.ndarray r_list, np.ndarray z_list): * cdef double k_f = x[0] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef double k_r = x[1] * cdef np.ndarray[cdouble_t] I = np.empty(m) */ __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_x), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_k_f = __pyx_t_2;
15: cdef double k_r = x[1]
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":15 * np.ndarray l_list, np.ndarray r_list, np.ndarray z_list): * cdef double k_f = x[0] * cdef double k_r = x[1] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef np.ndarray[cdouble_t] I = np.empty(m) * cdef np.ndarray[cdouble_t] coeffs = np.empty(5) */ __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_x), 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_k_r = __pyx_t_2;
16: cdef np.ndarray[cdouble_t] I = np.empty(m)
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":16 * cdef double k_f = x[0] * cdef double k_r = x[1] * cdef np.ndarray[cdouble_t] I = np.empty(m) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef np.ndarray[cdouble_t] coeffs = np.empty(5) * cdef np.ndarray[cdouble_t] monoms = np.empty(5) */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_I, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_cdouble_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) { __pyx_v_I = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_I.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_I = __pyx_bstruct_I.strides[0]; __pyx_bshape_0_I = __pyx_bstruct_I.shape[0]; } } __pyx_t_5 = 0; __pyx_v_I = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;
17: cdef np.ndarray[cdouble_t] coeffs = np.empty(5)
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":17 * cdef double k_r = x[1] * cdef np.ndarray[cdouble_t] I = np.empty(m) * cdef np.ndarray[cdouble_t] coeffs = np.empty(5) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef np.ndarray[cdouble_t] monoms = np.empty(5) * cdef unsigned int i, j */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__empty); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_5); __Pyx_GIVEREF(__pyx_int_5); __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_coeffs, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_cdouble_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_coeffs = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_coeffs.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_coeffs = __pyx_bstruct_coeffs.strides[0]; __pyx_bshape_0_coeffs = __pyx_bstruct_coeffs.shape[0]; } } __pyx_t_6 = 0; __pyx_v_coeffs = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0;
18: cdef np.ndarray[cdouble_t] monoms = np.empty(5)
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":18 * cdef np.ndarray[cdouble_t] I = np.empty(m) * cdef np.ndarray[cdouble_t] coeffs = np.empty(5) * cdef np.ndarray[cdouble_t] monoms = np.empty(5) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* cdef unsigned int i, j * cdef double l, r, z */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_5); __Pyx_GIVEREF(__pyx_int_5); __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); 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_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_monoms, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_cdouble_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_monoms = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_monoms.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_bstride_0_monoms = __pyx_bstruct_monoms.strides[0]; __pyx_bshape_0_monoms = __pyx_bstruct_monoms.shape[0]; } } __pyx_t_7 = 0; __pyx_v_monoms = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
19: cdef unsigned int i, j
20: cdef double l, r, z
21: for i from 0 <= i < m:
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":21 * cdef unsigned int i, j * cdef double l, r, z * for i from 0<
= i<
m: #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* l = l_list[i] * r = r_list[i] */ __pyx_t_8 = __pyx_v_m; for (__pyx_v_i = 0; __pyx_v_i<
__pyx_t_8; __pyx_v_i++) {
22: l = l_list[i]
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":22 * cdef double l, r, z * for i from 0<
= i<
m: * l = l_list[i] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* r = r_list[i] * z = z_list[i] */ __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_l_list), __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_l = __pyx_t_2;
23: r = r_list[i]
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":23 * for i from 0<
= i<
m: * l = l_list[i] * r = r_list[i] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* z = z_list[i] * coeffs = np.array([3*k_f, -3*k_f, -k_f, k_f, -k_r]) */ __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_r_list), __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_r = __pyx_t_2;
24: z = z_list[i]
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":24 * l = l_list[i] * r = r_list[i] * z = z_list[i] #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* coeffs = np.array([3*k_f, -3*k_f, -k_f, k_f, -k_r]) * monoms = np.array([l*r, l*z, r*z, z**2, z]) */ __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_z_list), __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_z = __pyx_t_2;
25: coeffs = np.array([3*k_f, -3*k_f, -k_f, k_f, -k_r])
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":25 * r = r_list[i] * z = z_list[i] * coeffs = np.array([3*k_f, -3*k_f, -k_f, k_f, -k_r]) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* monoms = np.array([l*r, l*z, r*z, z**2, z]) * I[i] = np.dot(coeffs,monoms) / np.max(coeffs*monoms) */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyFloat_FromDouble((3.0 * __pyx_v_k_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyFloat_FromDouble((-3.0 * __pyx_v_k_f)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyFloat_FromDouble((-__pyx_v_k_f)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyFloat_FromDouble(__pyx_v_k_f); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = PyFloat_FromDouble((-__pyx_v_k_r)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = PyList_New(5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_t_12)); __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __pyx_t_12 = PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_12); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coeffs); __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_coeffs, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_cdouble_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); if (unlikely(__pyx_t_13<
0)) { PyErr_Fetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_coeffs, (PyObject*)__pyx_v_coeffs, &__Pyx_TypeInfo_nn___pyx_t_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_cdouble_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_16); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_14, __pyx_t_15, __pyx_t_16); } } __pyx_bstride_0_coeffs = __pyx_bstruct_coeffs.strides[0]; __pyx_bshape_0_coeffs = __pyx_bstruct_coeffs.shape[0]; if (unlikely(__pyx_t_13<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_coeffs)); __pyx_v_coeffs = ((PyArrayObject *)__pyx_t_12); __pyx_t_12 = 0;
26: monoms = np.array([l*r, l*z, r*z, z**2, z])
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":26 * z = z_list[i] * coeffs = np.array([3*k_f, -3*k_f, -k_f, k_f, -k_r]) * monoms = np.array([l*r, l*z, r*z, z**2, z]) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* I[i] = np.dot(coeffs,monoms) / np.max(coeffs*monoms) * return np.linalg.norm(I) / np.sqrt(len(I)) */ __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__array); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyFloat_FromDouble((__pyx_v_l * __pyx_v_r)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_3 = PyFloat_FromDouble((__pyx_v_l * __pyx_v_z)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = PyFloat_FromDouble((__pyx_v_r * __pyx_v_z)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_9 = PyFloat_FromDouble(pow(__pyx_v_z, 2.0)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = PyFloat_FromDouble(__pyx_v_z); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyList_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); PyList_SET_ITEM(__pyx_t_4, 4, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_12 = 0; __pyx_t_3 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_t_11, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = ((PyArrayObject *)__pyx_t_4); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_monoms); __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_bstruct_monoms, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_cdouble_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack); if (unlikely(__pyx_t_13<
0)) { PyErr_Fetch(&__pyx_t_16, &__pyx_t_15, &__pyx_t_14); if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_monoms, (PyObject*)__pyx_v_monoms, &__Pyx_TypeInfo_nn___pyx_t_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_cdouble_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_16); Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); __Pyx_RaiseBufferFallbackError(); } else { PyErr_Restore(__pyx_t_16, __pyx_t_15, __pyx_t_14); } } __pyx_bstride_0_monoms = __pyx_bstruct_monoms.strides[0]; __pyx_bshape_0_monoms = __pyx_bstruct_monoms.shape[0]; if (unlikely(__pyx_t_13<
0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_monoms)); __pyx_v_monoms = ((PyArrayObject *)__pyx_t_4); __pyx_t_4 = 0;
27: I[i] = np.dot(coeffs,monoms) / np.max(coeffs*monoms)
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":27 * coeffs = np.array([3*k_f, -3*k_f, -k_f, k_f, -k_r]) * monoms = np.array([l*r, l*z, r*z, z**2, z]) * I[i] = np.dot(coeffs,monoms) / np.max(coeffs*monoms) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
* return np.linalg.norm(I) / np.sqrt(len(I)) */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__dot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_coeffs)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_coeffs)); __Pyx_GIVEREF(((PyObject *)__pyx_v_coeffs)); __Pyx_INCREF(((PyObject *)__pyx_v_monoms)); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_monoms)); __Pyx_GIVEREF(((PyObject *)__pyx_v_monoms)); __pyx_t_11 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_v_coeffs), ((PyObject *)__pyx_v_monoms)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_17 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_17 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_18 = __pyx_v_i; __pyx_t_13 = -1; if (unlikely(__pyx_t_18 >= (size_t)__pyx_bshape_0_I)) __pyx_t_13 = 0; if (unlikely(__pyx_t_13 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided1d(__pyx_t_69_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0_cdouble_t *, __pyx_bstruct_I.buf, __pyx_t_18, __pyx_bstride_0_I) = __pyx_t_17; }
28: return np.linalg.norm(I) / np.sqrt(len(I))
/* "/home/klho/.sage/temp/e6410/9442/spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx/_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.pyx":28 * monoms = np.array([l*r, l*z, r*z, z**2, z]) * I[i] = np.dot(coeffs,monoms) / np.max(coeffs*monoms) * return np.linalg.norm(I) / np.sqrt(len(I)) #<
<
<
<
<
<
<
<
<
<
<
<
<
<
*/ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__linalg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__norm); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_I)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_I)); __Pyx_GIVEREF(((PyObject *)__pyx_v_I)); __pyx_t_11 = PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__sqrt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_19 = PyObject_Length(((PyObject *)__pyx_v_I)); if (unlikely(__pyx_t_19 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_19); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_monoms); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_I); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coeffs); __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);} __Pyx_WriteUnraisable("_home_klho__sage_sage_notebook_sagenb_home_admin_1_code_sage77_spyx_0.inv_cross"); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer(&__pyx_bstruct_monoms); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_I); __Pyx_SafeReleaseBuffer(&__pyx_bstruct_coeffs); __pyx_L2:; __Pyx_XDECREF((PyObject *)__pyx_v_I); __Pyx_XDECREF((PyObject *)__pyx_v_coeffs); __Pyx_XDECREF((PyObject *)__pyx_v_monoms); __Pyx_RefNannyFinishContext(); return __pyx_r; }