Generated by Cython 0.10.2 on Wed Apr 8 15:42:24 2009
Raw output: _Users_robert__sage_sage_notebook_worksheets_admin_22_code_sage414_spyx_0.c
1:
#if PY_MAJOR_VERSION < 3
return;
#else
return __pyx_m;
#endif
__pyx_L1_error:;
__Pyx_AddTraceback("_Users_robert__sage_sage_notebook_worksheets_admin_22_code_sage414_spyx_0");
#if PY_MAJOR_VERSION >= 3
return NULL;
#endif
}
union __pyx_t_4sage_3ext_9fast_eval_double_op_params {
void *func;
double c;
int n;
};
2: include "interrupt.pxi" # ctrl-c interrupt block support
3: include "stdsage.pxi" # ctrl-c interrupt block support
4:
5: include "cdefs.pxi"
6: from sage.ext.fast_eval cimport FastDoubleFunc
struct __pyx_t_4sage_3ext_9fast_eval_fast_double_op { char type; union __pyx_t_4sage_3ext_9fast_eval_double_op_params params; };
7:
8: def time_fastfloat(FastDoubleFunc f, double x, int N):
static PyObject *__pyx_pf_73_Users_robert__sage_sage_notebook_worksheets_admin_22_code_sage414_spyx_0_time_fastfloat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_73_Users_robert__sage_sage_notebook_worksheets_admin_22_code_sage414_spyx_0_time_fastfloat[] = "File: _Users_robert__sage_sage_notebook_worksheets_admin_22_code_sage414_spyx_0.pyx (starting at line 8)"; static PyObject *__pyx_pf_73_Users_robert__sage_sage_notebook_worksheets_admin_22_code_sage414_spyx_0_time_fastfloat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *__pyx_v_f = 0; double __pyx_v_x; int __pyx_v_N; int __pyx_v_i; PyObject *__pyx_r; static PyObject **__pyx_pyargnames[] = {&__pyx_kp_f,&__pyx_kp_x,&__pyx_kp_N,0}; __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { PyObject* values[3] = {0,0,0}; Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); switch (PyTuple_GET_SIZE(__pyx_args)) { 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_kp_f); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_x); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("time_fastfloat", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_N); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("time_fastfloat", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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), "time_fastfloat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_f = ((struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *)values[0]); __pyx_v_x = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_N = __pyx_PyInt_int(values[2]); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } else if (PyTuple_GET_SIZE(__pyx_args) != 3) { goto __pyx_L5_argtuple_error; } else { __pyx_v_f = ((struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *)PyTuple_GET_ITEM(__pyx_args, 0)); __pyx_v_x = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_v_N = __pyx_PyInt_int(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_N == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("time_fastfloat", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("_Users_robert__sage_sage_notebook_worksheets_admin_22_code_sage414_spyx_0.time_fastfloat"); return NULL; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_f), __pyx_ptype_4sage_3ext_9fast_eval_FastDoubleFunc, 1, "f", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9: cdef int i
10: for i from 0 <= i < N:
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_N; __pyx_v_i++) {
struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc {
PyObject_HEAD
struct __pyx_vtabstruct_4sage_3ext_9fast_eval_FastDoubleFunc *__pyx_vtab;
int max_height;
int nargs;
int nops;
struct __pyx_t_4sage_3ext_9fast_eval_fast_double_op *ops;
double *argv;
double *stack;
PyObject *py_funcs;
};
struct __pyx_vtabstruct_4sage_3ext_9fast_eval_FastDoubleFunc {
int (*allocate_stack)(struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *);
double (*_call_c)(struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *, double *);
int (*is_pure_c)(struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *, int __pyx_skip_dispatch);
struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *(*cfunc)(struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *, void *);
struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *(*unop)(struct __pyx_obj_4sage_3ext_9fast_eval_FastDoubleFunc *, char);
};
11: f._call_c(&x)
__pyx_1 = ((struct __pyx_vtabstruct_4sage_3ext_9fast_eval_FastDoubleFunc *)__pyx_v_f->__pyx_vtab)->_call_c(__pyx_v_f, (&__pyx_v_x)); if (unlikely(__pyx_1 == -2 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("_Users_robert__sage_sage_notebook_worksheets_admin_22_code_sage414_spyx_0.time_fastfloat"); __pyx_r = NULL; __pyx_L0:; return __pyx_r; }