2443 lines
104 KiB
C
Executable file
2443 lines
104 KiB
C
Executable file
/* Generated by Pyrex 0.9.8.2 on Wed Aug 27 16:46:37 2008 */
|
|
|
|
#define PY_SSIZE_T_CLEAN
|
|
#include "Python.h"
|
|
#include "structmember.h"
|
|
#ifndef PY_LONG_LONG
|
|
#define PY_LONG_LONG LONG_LONG
|
|
#endif
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
typedef int Py_ssize_t;
|
|
#define PY_SSIZE_T_MAX INT_MAX
|
|
#define PY_SSIZE_T_MIN INT_MIN
|
|
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
|
|
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
|
|
#endif
|
|
#ifndef WIN32
|
|
#ifndef __stdcall
|
|
#define __stdcall
|
|
#endif
|
|
#ifndef __cdecl
|
|
#define __cdecl
|
|
#endif
|
|
#endif
|
|
#ifdef __cplusplus
|
|
#define __PYX_EXTERN_C extern "C"
|
|
#else
|
|
#define __PYX_EXTERN_C extern
|
|
#endif
|
|
#include <math.h>
|
|
#include "math.h"
|
|
|
|
|
|
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
|
|
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
|
|
|
|
static PyObject *__pyx_m;
|
|
static PyObject *__pyx_b;
|
|
static int __pyx_lineno;
|
|
static char *__pyx_filename;
|
|
static char **__pyx_f;
|
|
|
|
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
|
|
|
|
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
|
|
|
|
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
|
|
|
|
static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/
|
|
|
|
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
|
|
|
|
static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
|
|
static int __Pyx_EndUnpack(PyObject *); /*proto*/
|
|
|
|
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
|
|
|
|
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
|
|
|
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
|
|
|
|
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
|
|
|
|
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
|
|
|
|
static void __Pyx_AddTraceback(char *funcname); /*proto*/
|
|
|
|
/* Declarations from Scientific_vector */
|
|
|
|
struct __pyx_obj_17Scientific_vector_vector {
|
|
PyObject_HEAD
|
|
struct __pyx_vtabstruct_17Scientific_vector_vector *__pyx_vtab;
|
|
double xv;
|
|
double yv;
|
|
double zv;
|
|
};
|
|
|
|
struct __pyx_obj_17Scientific_vector_Vector {
|
|
struct __pyx_obj_17Scientific_vector_vector __pyx_base;
|
|
};
|
|
|
|
|
|
struct __pyx_vtabstruct_17Scientific_vector_vector {
|
|
void (*set)(struct __pyx_obj_17Scientific_vector_vector *,double,double,double);
|
|
};
|
|
static struct __pyx_vtabstruct_17Scientific_vector_vector *__pyx_vtabptr_17Scientific_vector_vector;
|
|
|
|
|
|
struct __pyx_vtabstruct_17Scientific_vector_Vector {
|
|
struct __pyx_vtabstruct_17Scientific_vector_vector __pyx_base;
|
|
};
|
|
static struct __pyx_vtabstruct_17Scientific_vector_Vector *__pyx_vtabptr_17Scientific_vector_Vector;
|
|
|
|
static PyTypeObject *__pyx_ptype_17Scientific_vector_vector = 0;
|
|
static PyTypeObject *__pyx_ptype_17Scientific_vector_Vector = 0;
|
|
static PyObject *__pyx_k3;
|
|
static PyObject *__pyx_k4;
|
|
static PyObject *__pyx_k5;
|
|
static PyObject *__pyx_k6;
|
|
static PyObject *__pyx_k7;
|
|
|
|
|
|
/* Implementation of Scientific_vector */
|
|
|
|
|
|
static PyObject *__pyx_n_Scientific;
|
|
static PyObject *__pyx_n_N;
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_9is_vector___get__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_9is_vector___get__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.is_vector.__get__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_n_array;
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_5array___get__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_5array___get__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
PyObject *__pyx_3 = 0;
|
|
PyObject *__pyx_4 = 0;
|
|
PyObject *__pyx_5 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_N); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
|
|
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
|
|
__pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
|
|
__pyx_5 = PyList_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
|
|
PyList_SET_ITEM(__pyx_5, 0, __pyx_1);
|
|
PyList_SET_ITEM(__pyx_5, 1, __pyx_3);
|
|
PyList_SET_ITEM(__pyx_5, 2, __pyx_4);
|
|
__pyx_1 = 0;
|
|
__pyx_3 = 0;
|
|
__pyx_4 = 0;
|
|
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_5);
|
|
__pyx_5 = 0;
|
|
__pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_r = __pyx_3;
|
|
__pyx_3 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_3);
|
|
Py_XDECREF(__pyx_4);
|
|
Py_XDECREF(__pyx_5);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.array.__get__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_18__array_priority_____get__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_18__array_priority_____get__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(10.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; goto __pyx_L1;}
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__array_priority__.__get__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___array_wrap__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___array_wrap__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_array = 0;
|
|
PyObject *__pyx_v_result;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
double __pyx_2;
|
|
double __pyx_3;
|
|
double __pyx_4;
|
|
static char *__pyx_argnames[] = {"array",0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_array)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_array);
|
|
__pyx_v_result = Py_None; Py_INCREF(Py_None);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":43 */
|
|
__pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_1;
|
|
__pyx_1 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":44 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
|
|
__pyx_1 = __Pyx_GetItemInt(__pyx_v_array, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
|
|
__pyx_2 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_1 = __Pyx_GetItemInt(__pyx_v_array, 1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_1 = __Pyx_GetItemInt(__pyx_v_array, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
|
|
__pyx_4 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),__pyx_2,__pyx_3,__pyx_4);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":45 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__array_wrap__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_result);
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_array);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_memo = 0;
|
|
PyObject *__pyx_r;
|
|
static char *__pyx_argnames[] = {"memo",0};
|
|
__pyx_v_memo = __pyx_k3;
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_memo)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_memo);
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_r = __pyx_v_self;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_memo);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_memo = 0;
|
|
PyObject *__pyx_r;
|
|
static char *__pyx_argnames[] = {"memo",0};
|
|
__pyx_v_memo = __pyx_k4;
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_memo)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_memo);
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_r = __pyx_v_self;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_memo);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___getstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
PyObject *__pyx_3 = 0;
|
|
PyObject *__pyx_4 = 0;
|
|
static char *__pyx_argnames[] = {0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
|
|
__pyx_4 = PyList_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;}
|
|
PyList_SET_ITEM(__pyx_4, 0, __pyx_1);
|
|
PyList_SET_ITEM(__pyx_4, 1, __pyx_2);
|
|
PyList_SET_ITEM(__pyx_4, 2, __pyx_3);
|
|
__pyx_1 = 0;
|
|
__pyx_2 = 0;
|
|
__pyx_3 = 0;
|
|
__pyx_r = __pyx_4;
|
|
__pyx_4 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_3);
|
|
Py_XDECREF(__pyx_4);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__getstate__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___setstate__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_state = 0;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
double __pyx_3;
|
|
static char *__pyx_argnames[] = {"state",0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_state);
|
|
__pyx_1 = PyObject_GetIter(__pyx_v_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
|
|
__pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv = __pyx_3;
|
|
__pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv = __pyx_3;
|
|
__pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv = __pyx_3;
|
|
if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__setstate__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_state);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___reduce__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
PyObject *__pyx_3 = 0;
|
|
PyObject *__pyx_4 = 0;
|
|
static char *__pyx_argnames[] = {0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
|
|
__pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
|
|
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
|
|
PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
|
|
__pyx_1 = 0;
|
|
__pyx_2 = 0;
|
|
__pyx_3 = 0;
|
|
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
|
|
Py_INCREF(((PyObject *)__pyx_ptype_17Scientific_vector_Vector));
|
|
PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)__pyx_ptype_17Scientific_vector_Vector));
|
|
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_4);
|
|
__pyx_4 = 0;
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_3);
|
|
Py_XDECREF(__pyx_4);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__reduce__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static void __pyx_f_17Scientific_vector_6vector_set(struct __pyx_obj_17Scientific_vector_vector *__pyx_v_self,double __pyx_v_x,double __pyx_v_y,double __pyx_v_z) {
|
|
Py_INCREF(__pyx_v_self);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":63 */
|
|
__pyx_v_self->xv = __pyx_v_x;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":64 */
|
|
__pyx_v_self->yv = __pyx_v_y;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":65 */
|
|
__pyx_v_self->zv = __pyx_v_z;
|
|
|
|
Py_DECREF(__pyx_v_self);
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_x(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_x[] = "Returns the x coordinate.";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_x(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
static char *__pyx_argnames[] = {0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.x");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_y(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_y[] = "Returns the y coordinate.";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_y(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
static char *__pyx_argnames[] = {0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;}
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.y");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_z(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_z[] = "Returns the z coordinate.";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_z(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
static char *__pyx_argnames[] = {0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;}
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.z");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_k8p;
|
|
|
|
static char __pyx_k8[] = "Vector(%f,%f,%f)";
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___repr__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___repr__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
PyObject *__pyx_3 = 0;
|
|
PyObject *__pyx_4 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
|
|
__pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
|
|
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
|
|
PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
|
|
__pyx_1 = 0;
|
|
__pyx_2 = 0;
|
|
__pyx_3 = 0;
|
|
__pyx_1 = PyNumber_Remainder(__pyx_k8p, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_3);
|
|
Py_XDECREF(__pyx_4);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__repr__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___str__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___str__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
PyObject *__pyx_3 = 0;
|
|
PyObject *__pyx_4 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
|
|
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
|
|
__pyx_4 = PyList_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
|
|
PyList_SET_ITEM(__pyx_4, 0, __pyx_1);
|
|
PyList_SET_ITEM(__pyx_4, 1, __pyx_2);
|
|
PyList_SET_ITEM(__pyx_4, 2, __pyx_3);
|
|
__pyx_1 = 0;
|
|
__pyx_2 = 0;
|
|
__pyx_3 = 0;
|
|
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_4);
|
|
__pyx_4 = 0;
|
|
__pyx_2 = PyObject_CallObject(((PyObject *)(&PyString_Type)), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_r = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_3);
|
|
Py_XDECREF(__pyx_4);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__str__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
|
|
PyObject *__pyx_v_result;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_other);
|
|
__pyx_v_result = Py_None; Py_INCREF(Py_None);
|
|
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_17Scientific_vector_vector, 1, "self")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
|
|
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_17Scientific_vector_vector, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;}
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":86 */
|
|
__pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_1;
|
|
__pyx_1 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":87 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv + ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_other)->xv),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv + ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_other)->yv),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv + ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_other)->zv));
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":89 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__add__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_result);
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_other);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___neg__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___neg__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_v_result;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_v_result = Py_None; Py_INCREF(Py_None);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":92 */
|
|
__pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_1;
|
|
__pyx_1 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":93 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),(-((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv),(-((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv),(-((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv));
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":94 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__neg__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_result);
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
|
|
PyObject *__pyx_v_result;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_other);
|
|
__pyx_v_result = Py_None; Py_INCREF(Py_None);
|
|
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_17Scientific_vector_vector, 1, "self")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
|
|
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_17Scientific_vector_vector, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":97 */
|
|
__pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_1;
|
|
__pyx_1 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":98 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv - ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_other)->xv),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv - ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_other)->yv),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv - ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_other)->zv));
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":100 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__sub__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_result);
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_other);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_n_Geometry;
|
|
static PyObject *__pyx_n_isTensor;
|
|
static PyObject *__pyx_n_dot;
|
|
static PyObject *__pyx_n_Tensor;
|
|
static PyObject *__pyx_n_rank;
|
|
static PyObject *__pyx_n__product_with_vector;
|
|
static PyObject *__pyx_n_self;
|
|
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___mul__(PyObject *__pyx_v_x, PyObject *__pyx_v_y); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___mul__(PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
|
|
struct __pyx_obj_17Scientific_vector_vector *__pyx_v_v1;
|
|
struct __pyx_obj_17Scientific_vector_vector *__pyx_v_v2;
|
|
int __pyx_v_rmul;
|
|
PyObject *__pyx_v_Geometry;
|
|
PyObject *__pyx_v_product;
|
|
PyObject *__pyx_v_result;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
int __pyx_3;
|
|
PyObject *__pyx_4 = 0;
|
|
PyObject *__pyx_5 = 0;
|
|
PyObject *__pyx_6 = 0;
|
|
double __pyx_7;
|
|
double __pyx_8;
|
|
double __pyx_9;
|
|
Py_INCREF(__pyx_v_x);
|
|
Py_INCREF(__pyx_v_y);
|
|
__pyx_v_v1 = ((struct __pyx_obj_17Scientific_vector_vector *)Py_None); Py_INCREF(Py_None);
|
|
__pyx_v_v2 = ((struct __pyx_obj_17Scientific_vector_vector *)Py_None); Py_INCREF(Py_None);
|
|
__pyx_v_Geometry = Py_None; Py_INCREF(Py_None);
|
|
__pyx_v_product = Py_None; Py_INCREF(Py_None);
|
|
__pyx_v_result = Py_None; Py_INCREF(Py_None);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":105 */
|
|
__pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_n_Geometry);
|
|
PyList_SET_ITEM(__pyx_1, 0, __pyx_n_Geometry);
|
|
__pyx_2 = __Pyx_Import(__pyx_n_Scientific, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_Geometry); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_Geometry);
|
|
__pyx_v_Geometry = __pyx_1;
|
|
__pyx_1 = 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":106 */
|
|
__pyx_v_rmul = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":107 */
|
|
__pyx_3 = PyObject_IsInstance(__pyx_v_y,((PyObject *)__pyx_ptype_17Scientific_vector_vector)); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
|
|
if (__pyx_3) {
|
|
__pyx_3 = PyObject_IsInstance(__pyx_v_x,((PyObject *)__pyx_ptype_17Scientific_vector_vector)); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
|
|
if (__pyx_3) {
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":109 */
|
|
if (!__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_v_x);
|
|
Py_DECREF(((PyObject *)__pyx_v_v1));
|
|
__pyx_v_v1 = ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_x);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":110 */
|
|
if (!__Pyx_TypeTest(__pyx_v_y, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_v_y);
|
|
Py_DECREF(((PyObject *)__pyx_v_v2));
|
|
__pyx_v_v2 = ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_y);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":111 */
|
|
__pyx_2 = PyFloat_FromDouble((((__pyx_v_v1->xv * __pyx_v_v2->xv) + (__pyx_v_v1->yv * __pyx_v_v2->yv)) + (__pyx_v_v1->zv * __pyx_v_v2->zv))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
|
|
__pyx_r = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":113 */
|
|
__pyx_1 = __pyx_v_y;
|
|
Py_INCREF(__pyx_1);
|
|
__pyx_2 = __pyx_v_x;
|
|
Py_INCREF(__pyx_2);
|
|
Py_DECREF(__pyx_v_x);
|
|
__pyx_v_x = __pyx_1;
|
|
__pyx_1 = 0;
|
|
Py_DECREF(__pyx_v_y);
|
|
__pyx_v_y = __pyx_2;
|
|
__pyx_2 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":114 */
|
|
__pyx_v_rmul = 1;
|
|
}
|
|
__pyx_L3:;
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_L2:;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":115 */
|
|
__pyx_1 = PyObject_GetAttr(__pyx_v_Geometry, __pyx_n_isTensor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
|
|
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_v_y);
|
|
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_y);
|
|
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
__pyx_3 = PyObject_IsTrue(__pyx_4); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
if (__pyx_3) {
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":116 */
|
|
__pyx_3 = __pyx_v_rmul;
|
|
if (__pyx_3) {
|
|
__pyx_1 = PyObject_GetAttr(__pyx_v_y, __pyx_n_dot); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
|
|
__pyx_2 = PyObject_GetAttr(__pyx_v_Geometry, __pyx_n_Tensor); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
|
|
__pyx_4 = PyObject_GetAttr(__pyx_v_x, __pyx_n_array); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
|
|
__pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
|
|
__pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
|
|
PyTuple_SET_ITEM(__pyx_6, 1, __pyx_5);
|
|
__pyx_4 = 0;
|
|
__pyx_5 = 0;
|
|
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
Py_DECREF(__pyx_6); __pyx_6 = 0;
|
|
__pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
|
|
__pyx_4 = 0;
|
|
__pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
Py_DECREF(__pyx_v_product);
|
|
__pyx_v_product = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L5;
|
|
}
|
|
/*else*/ {
|
|
__pyx_6 = PyObject_GetAttr(__pyx_v_Geometry, __pyx_n_Tensor); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
|
|
__pyx_4 = PyObject_GetAttr(__pyx_v_x, __pyx_n_array); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
|
|
__pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
|
|
__pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
|
|
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);
|
|
__pyx_4 = 0;
|
|
__pyx_1 = 0;
|
|
__pyx_2 = PyObject_CallObject(__pyx_6, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_6); __pyx_6 = 0;
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
__pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_dot); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_v_y);
|
|
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_y);
|
|
__pyx_6 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
Py_DECREF(__pyx_v_product);
|
|
__pyx_v_product = __pyx_6;
|
|
__pyx_6 = 0;
|
|
}
|
|
__pyx_L5:;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":120 */
|
|
__pyx_5 = PyObject_GetAttr(__pyx_v_product, __pyx_n_rank); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
|
|
__pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
|
|
if (PyObject_Cmp(__pyx_5, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
|
|
__pyx_3 = __pyx_3 == 0;
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
if (__pyx_3) {
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":121 */
|
|
__pyx_4 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_4;
|
|
__pyx_4 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":122 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
|
|
__pyx_1 = PyObject_GetAttr(__pyx_v_product, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
|
|
__pyx_6 = __Pyx_GetItemInt(__pyx_1, 0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_7 = PyFloat_AsDouble(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_6); __pyx_6 = 0;
|
|
__pyx_5 = PyObject_GetAttr(__pyx_v_product, __pyx_n_array); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
|
|
__pyx_2 = __Pyx_GetItemInt(__pyx_5, 1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
__pyx_8 = PyFloat_AsDouble(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
__pyx_4 = PyObject_GetAttr(__pyx_v_product, __pyx_n_array); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
|
|
__pyx_1 = __Pyx_GetItemInt(__pyx_4, 2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
__pyx_9 = PyFloat_AsDouble(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),__pyx_7,__pyx_8,__pyx_9);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":124 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
goto __pyx_L6;
|
|
}
|
|
/*else*/ {
|
|
Py_INCREF(__pyx_v_product);
|
|
__pyx_r = __pyx_v_product;
|
|
goto __pyx_L0;
|
|
}
|
|
__pyx_L6:;
|
|
goto __pyx_L4;
|
|
}
|
|
__pyx_3 = PyObject_HasAttr(__pyx_v_y,__pyx_n__product_with_vector); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}
|
|
if (__pyx_3) {
|
|
__pyx_6 = PyObject_GetAttr(__pyx_v_y, __pyx_n__product_with_vector); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;}
|
|
__pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_self); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;}
|
|
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
|
|
__pyx_5 = 0;
|
|
__pyx_4 = PyObject_CallObject(__pyx_6, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_6); __pyx_6 = 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
__pyx_r = __pyx_4;
|
|
__pyx_4 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L4;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":130 */
|
|
if (!__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_v_x);
|
|
Py_DECREF(((PyObject *)__pyx_v_v1));
|
|
__pyx_v_v1 = ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_x);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":131 */
|
|
__pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_1;
|
|
__pyx_1 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":132 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
__pyx_5 = PyFloat_FromDouble(__pyx_v_v1->xv); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
__pyx_6 = PyNumber_Multiply(__pyx_5, __pyx_v_y); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
__pyx_7 = PyFloat_AsDouble(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_6); __pyx_6 = 0;
|
|
__pyx_2 = PyFloat_FromDouble(__pyx_v_v1->yv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_v_y); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
__pyx_8 = PyFloat_AsDouble(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
__pyx_1 = PyFloat_FromDouble(__pyx_v_v1->zv); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
__pyx_5 = PyNumber_Multiply(__pyx_1, __pyx_v_y); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_9 = PyFloat_AsDouble(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),__pyx_7,__pyx_8,__pyx_9);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":133 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
}
|
|
__pyx_L4:;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_4);
|
|
Py_XDECREF(__pyx_5);
|
|
Py_XDECREF(__pyx_6);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__mul__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_v1);
|
|
Py_DECREF(__pyx_v_v2);
|
|
Py_DECREF(__pyx_v_Geometry);
|
|
Py_DECREF(__pyx_v_product);
|
|
Py_DECREF(__pyx_v_result);
|
|
Py_DECREF(__pyx_v_x);
|
|
Py_DECREF(__pyx_v_y);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___div__(PyObject *__pyx_v_self, PyObject *__pyx_arg_factor); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___div__(PyObject *__pyx_v_self, PyObject *__pyx_arg_factor) {
|
|
double __pyx_v_factor;
|
|
PyObject *__pyx_v_result;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_v_result = Py_None; Py_INCREF(Py_None);
|
|
__pyx_v_factor = PyFloat_AsDouble(__pyx_arg_factor); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
|
|
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_17Scientific_vector_vector, 1, "self")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":136 */
|
|
__pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_1;
|
|
__pyx_1 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":137 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;}
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv / __pyx_v_factor),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv / __pyx_v_factor),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv / __pyx_v_factor));
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":138 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__div__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_result);
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_n_NotImplemented;
|
|
static PyObject *__pyx_n_x;
|
|
static PyObject *__pyx_n_y;
|
|
static PyObject *__pyx_n_z;
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
|
|
PyObject *__pyx_v_eq;
|
|
PyObject *__pyx_r;
|
|
int __pyx_1;
|
|
PyObject *__pyx_2 = 0;
|
|
PyObject *__pyx_3 = 0;
|
|
PyObject *__pyx_4 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_other);
|
|
__pyx_v_eq = Py_None; Py_INCREF(Py_None);
|
|
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_17Scientific_vector_vector, 1, "self")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":141 */
|
|
__pyx_1 = (__pyx_v_op != 2);
|
|
if (__pyx_1) {
|
|
__pyx_1 = (__pyx_v_op != 3);
|
|
}
|
|
if (__pyx_1) {
|
|
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplemented); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
|
|
__pyx_r = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_L2:;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":143 */
|
|
__pyx_1 = PyObject_IsInstance(__pyx_v_other,((PyObject *)__pyx_ptype_17Scientific_vector_vector)); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}
|
|
if (__pyx_1) {
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
__pyx_3 = PyObject_GetAttr(__pyx_v_other, __pyx_n_x); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
__pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_3); __pyx_3 = 0;
|
|
if (PyObject_Cmp(__pyx_2, __pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
__pyx_1 = __pyx_1 == 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
if (__pyx_1) {
|
|
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
__pyx_2 = PyObject_GetAttr(__pyx_v_other, __pyx_n_y); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
__pyx_4 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
if (PyObject_Cmp(__pyx_3, __pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
__pyx_1 = __pyx_1 == 0;
|
|
Py_DECREF(__pyx_3); __pyx_3 = 0;
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
if (__pyx_1) {
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
|
|
__pyx_3 = PyObject_GetAttr(__pyx_v_other, __pyx_n_z); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
|
|
__pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_3); __pyx_3 = 0;
|
|
if (PyObject_Cmp(__pyx_2, __pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
|
|
__pyx_1 = __pyx_1 == 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
}
|
|
}
|
|
__pyx_3 = PyInt_FromLong(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_eq);
|
|
__pyx_v_eq = __pyx_3;
|
|
__pyx_3 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
/*else*/ {
|
|
Py_INCREF(Py_False);
|
|
Py_DECREF(__pyx_v_eq);
|
|
__pyx_v_eq = Py_False;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":148 */
|
|
__pyx_1 = (__pyx_v_op == 2);
|
|
if (__pyx_1) {
|
|
Py_INCREF(__pyx_v_eq);
|
|
__pyx_r = __pyx_v_eq;
|
|
goto __pyx_L0;
|
|
goto __pyx_L4;
|
|
}
|
|
/*else*/ {
|
|
__pyx_1 = PyObject_IsTrue(__pyx_v_eq); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
|
|
__pyx_2 = PyInt_FromLong((!__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
|
|
__pyx_r = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
__pyx_L4:;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_3);
|
|
Py_XDECREF(__pyx_4);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__richcmp__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_eq);
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_other);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static Py_ssize_t __pyx_f_17Scientific_vector_6vector___len__(PyObject *__pyx_v_self); /*proto*/
|
|
static Py_ssize_t __pyx_f_17Scientific_vector_6vector___len__(PyObject *__pyx_v_self) {
|
|
Py_ssize_t __pyx_r;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_r = 3;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
|
|
int __pyx_v_index;
|
|
PyObject *__pyx_r;
|
|
int __pyx_1;
|
|
PyObject *__pyx_2 = 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_v_index = PyInt_AsLong(__pyx_arg_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L1;}
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":157 */
|
|
__pyx_1 = (__pyx_v_index == 0);
|
|
if (!__pyx_1) {
|
|
__pyx_1 = (__pyx_v_index == (-3));
|
|
}
|
|
if (__pyx_1) {
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;}
|
|
__pyx_r = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_1 = (__pyx_v_index == 1);
|
|
if (!__pyx_1) {
|
|
__pyx_1 = (__pyx_v_index == (-2));
|
|
}
|
|
if (__pyx_1) {
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;}
|
|
__pyx_r = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_1 = (__pyx_v_index == 2);
|
|
if (!__pyx_1) {
|
|
__pyx_1 = (__pyx_v_index == (-1));
|
|
}
|
|
if (__pyx_1) {
|
|
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
|
|
__pyx_r = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_L2:;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":163 */
|
|
__Pyx_Raise(PyExc_IndexError, 0, 0);
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_2);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.__getitem__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_length(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_length[] = "Returns the length (norm).";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_length(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
static char *__pyx_argnames[] = {0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_1 = PyFloat_FromDouble(sqrt((((((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv) + (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv)) + (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv)))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.length");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_k12p;
|
|
|
|
static char __pyx_k12[] = "Can't normalize a zero-length vector";
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_normal[] = "Returns a normalized copy.";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
double __pyx_v_len;
|
|
PyObject *__pyx_v_result;
|
|
PyObject *__pyx_r;
|
|
int __pyx_1;
|
|
PyObject *__pyx_2 = 0;
|
|
static char *__pyx_argnames[] = {0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_v_result = Py_None; Py_INCREF(Py_None);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":172 */
|
|
__pyx_v_len = sqrt((((((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv) + (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv)) + (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv)));
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":173 */
|
|
__pyx_1 = (__pyx_v_len == 0);
|
|
if (__pyx_1) {
|
|
__Pyx_Raise(PyExc_ZeroDivisionError, __pyx_k12p, 0);
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_L2:;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":175 */
|
|
__pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_2;
|
|
__pyx_2 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":176 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv / __pyx_v_len),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv / __pyx_v_len),(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv / __pyx_v_len));
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":177 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_2);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.normal");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_result);
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_cross(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_cross[] = "Returns the cross product with vector |other|.";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_cross(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
struct __pyx_obj_17Scientific_vector_vector *__pyx_v_other = 0;
|
|
PyObject *__pyx_v_result;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
static char *__pyx_argnames[] = {"other",0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_other)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_other);
|
|
__pyx_v_result = Py_None; Py_INCREF(Py_None);
|
|
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_17Scientific_vector_vector, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":181 */
|
|
__pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_17Scientific_vector_vector), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_result);
|
|
__pyx_v_result = __pyx_1;
|
|
__pyx_1 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":182 */
|
|
if (!__Pyx_TypeTest(__pyx_v_result, __pyx_ptype_17Scientific_vector_vector)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
|
|
__pyx_vtabptr_17Scientific_vector_vector->set(((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_result),((((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv * __pyx_v_other->zv) - (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv * __pyx_v_other->yv)),((((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv * __pyx_v_other->xv) - (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv * __pyx_v_other->zv)),((((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv * __pyx_v_other->yv) - (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv * __pyx_v_other->xv)));
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":185 */
|
|
Py_INCREF(__pyx_v_result);
|
|
__pyx_r = __pyx_v_result;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.cross");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_result);
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_other);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_angle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_angle[] = "Returns the angle to vector |other|.";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_angle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
struct __pyx_obj_17Scientific_vector_vector *__pyx_v_other = 0;
|
|
double __pyx_v_cosa;
|
|
PyObject *__pyx_r;
|
|
int __pyx_1;
|
|
PyObject *__pyx_2 = 0;
|
|
static char *__pyx_argnames[] = {"other",0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_other)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_other);
|
|
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_17Scientific_vector_vector, 1, "other")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":190 */
|
|
__pyx_v_cosa = ((((((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv * __pyx_v_other->xv) + (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv * __pyx_v_other->yv)) + (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv * __pyx_v_other->zv)) / sqrt(((((((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->xv) + (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->yv)) + (((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv * ((struct __pyx_obj_17Scientific_vector_vector *)__pyx_v_self)->zv)) * (((__pyx_v_other->xv * __pyx_v_other->xv) + (__pyx_v_other->yv * __pyx_v_other->yv)) + (__pyx_v_other->zv * __pyx_v_other->zv)))));
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":193 */
|
|
__pyx_1 = (__pyx_v_cosa > 1.);
|
|
if (__pyx_1) {
|
|
__pyx_v_cosa = 1.;
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_L2:;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":195 */
|
|
__pyx_1 = (__pyx_v_cosa < (-1.));
|
|
if (__pyx_1) {
|
|
__pyx_v_cosa = (-1.);
|
|
goto __pyx_L3;
|
|
}
|
|
__pyx_L3:;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":197 */
|
|
__pyx_2 = PyFloat_FromDouble(acos(__pyx_v_cosa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
|
|
__pyx_r = __pyx_2;
|
|
__pyx_2 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_2);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.angle");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_other);
|
|
return __pyx_r;
|
|
}
|
|
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_asTensor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_asTensor[] = "Returns an equivalent tensor object of rank 1.";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_asTensor(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_Geometry;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
PyObject *__pyx_3 = 0;
|
|
PyObject *__pyx_4 = 0;
|
|
static char *__pyx_argnames[] = {0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
__pyx_v_Geometry = Py_None; Py_INCREF(Py_None);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":201 */
|
|
__pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_n_Geometry);
|
|
PyList_SET_ITEM(__pyx_1, 0, __pyx_n_Geometry);
|
|
__pyx_2 = __Pyx_Import(__pyx_n_Scientific, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_Geometry); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_Geometry);
|
|
__pyx_v_Geometry = __pyx_1;
|
|
__pyx_1 = 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":202 */
|
|
__pyx_2 = PyObject_GetAttr(__pyx_v_Geometry, __pyx_n_Tensor); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;}
|
|
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;}
|
|
__pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;}
|
|
__pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
|
|
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
|
|
__pyx_1 = 0;
|
|
__pyx_3 = 0;
|
|
__pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_3);
|
|
Py_XDECREF(__pyx_4);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.asTensor");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_Geometry);
|
|
Py_DECREF(__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_n_NewAxis;
|
|
|
|
static PyObject *__pyx_k17p;
|
|
|
|
static char __pyx_k17[] = "Dyadic product with non-vector";
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_dyadicProduct(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static char __pyx_doc_17Scientific_vector_6vector_dyadicProduct[] = "Returns the dyadic product with vector or tensor |other|.";
|
|
static PyObject *__pyx_f_17Scientific_vector_6vector_dyadicProduct(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_other = 0;
|
|
PyObject *__pyx_v_Geometry;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
int __pyx_3;
|
|
PyObject *__pyx_4 = 0;
|
|
PyObject *__pyx_5 = 0;
|
|
PyObject *__pyx_6 = 0;
|
|
PyObject *__pyx_7 = 0;
|
|
static char *__pyx_argnames[] = {"other",0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_other)) return 0;
|
|
Py_INCREF(__pyx_v_self);
|
|
Py_INCREF(__pyx_v_other);
|
|
__pyx_v_Geometry = Py_None; Py_INCREF(Py_None);
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":206 */
|
|
__pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_n_Geometry);
|
|
PyList_SET_ITEM(__pyx_1, 0, __pyx_n_Geometry);
|
|
__pyx_2 = __Pyx_Import(__pyx_n_Scientific, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_Geometry); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_v_Geometry);
|
|
__pyx_v_Geometry = __pyx_1;
|
|
__pyx_1 = 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":207 */
|
|
__pyx_3 = PyObject_IsInstance(__pyx_v_other,((PyObject *)__pyx_ptype_17Scientific_vector_vector)); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;}
|
|
if (__pyx_3) {
|
|
__pyx_2 = PyObject_GetAttr(__pyx_v_Geometry, __pyx_n_Tensor); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
__pyx_4 = PySlice_New(Py_None, Py_None, Py_None); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_N); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
__pyx_6 = PyObject_GetAttr(__pyx_5, __pyx_n_NewAxis); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
__pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
|
|
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_6);
|
|
__pyx_4 = 0;
|
|
__pyx_6 = 0;
|
|
__pyx_4 = PyObject_GetItem(__pyx_1, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
__pyx_6 = PyObject_GetAttr(__pyx_v_other, __pyx_n_array); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
|
|
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_N); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
|
|
__pyx_5 = PyObject_GetAttr(__pyx_1, __pyx_n_NewAxis); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_1 = PySlice_New(Py_None, Py_None, Py_None); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
|
|
__pyx_7 = PyTuple_New(2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_5);
|
|
PyTuple_SET_ITEM(__pyx_7, 1, __pyx_1);
|
|
__pyx_5 = 0;
|
|
__pyx_1 = 0;
|
|
__pyx_5 = PyObject_GetItem(__pyx_6, __pyx_7); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_6); __pyx_6 = 0;
|
|
Py_DECREF(__pyx_7); __pyx_7 = 0;
|
|
__pyx_1 = PyNumber_Multiply(__pyx_4, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
__pyx_6 = PyInt_FromLong(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
|
|
__pyx_7 = PyTuple_New(2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
|
|
PyTuple_SET_ITEM(__pyx_7, 1, __pyx_6);
|
|
__pyx_1 = 0;
|
|
__pyx_6 = 0;
|
|
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
Py_DECREF(__pyx_7); __pyx_7 = 0;
|
|
__pyx_r = __pyx_4;
|
|
__pyx_4 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_5 = PyObject_GetAttr(__pyx_v_Geometry, __pyx_n_isTensor); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}
|
|
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_v_other);
|
|
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_other);
|
|
__pyx_6 = PyObject_CallObject(__pyx_5, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_3 = PyObject_IsTrue(__pyx_6); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_6); __pyx_6 = 0;
|
|
if (__pyx_3) {
|
|
__pyx_2 = PyObject_GetAttr(__pyx_v_Geometry, __pyx_n_Tensor); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;}
|
|
__pyx_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_array); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;}
|
|
__pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;}
|
|
__pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;}
|
|
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_7);
|
|
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
|
|
__pyx_7 = 0;
|
|
__pyx_4 = 0;
|
|
__pyx_1 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
Py_DECREF(__pyx_5); __pyx_5 = 0;
|
|
__pyx_6 = PyNumber_Multiply(__pyx_1, __pyx_v_other); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_r = __pyx_6;
|
|
__pyx_6 = 0;
|
|
goto __pyx_L0;
|
|
goto __pyx_L2;
|
|
}
|
|
/*else*/ {
|
|
__Pyx_Raise(PyExc_TypeError, __pyx_k17p, 0);
|
|
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;}
|
|
}
|
|
__pyx_L2:;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_4);
|
|
Py_XDECREF(__pyx_5);
|
|
Py_XDECREF(__pyx_6);
|
|
Py_XDECREF(__pyx_7);
|
|
__Pyx_AddTraceback("Scientific_vector.vector.dyadicProduct");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_Geometry);
|
|
Py_DECREF(__pyx_v_self);
|
|
Py_DECREF(__pyx_v_other);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_6Vector_23__safe_for_unpickling_____get__(PyObject *__pyx_v_self); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_6Vector_23__safe_for_unpickling_____get__(PyObject *__pyx_v_self) {
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
Py_INCREF((PyObject *)__pyx_v_self);
|
|
__pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;}
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
__Pyx_AddTraceback("Scientific_vector.Vector.__safe_for_unpickling__.__get__");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF((PyObject *)__pyx_v_self);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static int __pyx_f_17Scientific_vector_6Vector___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static int __pyx_f_17Scientific_vector_6Vector___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_x = 0;
|
|
PyObject *__pyx_v_y = 0;
|
|
PyObject *__pyx_v_z = 0;
|
|
int __pyx_r;
|
|
int __pyx_1;
|
|
PyObject *__pyx_2 = 0;
|
|
PyObject *__pyx_3 = 0;
|
|
double __pyx_4;
|
|
static char *__pyx_argnames[] = {"x","y","z",0};
|
|
__pyx_v_x = __pyx_k5;
|
|
__pyx_v_y = __pyx_k6;
|
|
__pyx_v_z = __pyx_k7;
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_x, &__pyx_v_y, &__pyx_v_z)) return -1;
|
|
Py_INCREF((PyObject *)__pyx_v_self);
|
|
Py_INCREF(__pyx_v_x);
|
|
Py_INCREF(__pyx_v_y);
|
|
Py_INCREF(__pyx_v_z);
|
|
__pyx_1 = __pyx_v_x == Py_None;
|
|
if (__pyx_1) {
|
|
goto __pyx_L2;
|
|
}
|
|
__pyx_1 = __pyx_v_y == Py_None;
|
|
if (__pyx_1) {
|
|
__pyx_1 = __pyx_v_z == Py_None;
|
|
}
|
|
if (__pyx_1) {
|
|
__pyx_2 = PyObject_GetIter(__pyx_v_x); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
|
|
__pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
|
|
__pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_3); __pyx_3 = 0;
|
|
((struct __pyx_obj_17Scientific_vector_Vector *)__pyx_v_self)->__pyx_base.xv = __pyx_4;
|
|
__pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
|
|
__pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_3); __pyx_3 = 0;
|
|
((struct __pyx_obj_17Scientific_vector_Vector *)__pyx_v_self)->__pyx_base.yv = __pyx_4;
|
|
__pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
|
|
__pyx_4 = PyFloat_AsDouble(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_3); __pyx_3 = 0;
|
|
((struct __pyx_obj_17Scientific_vector_Vector *)__pyx_v_self)->__pyx_base.zv = __pyx_4;
|
|
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
goto __pyx_L2;
|
|
}
|
|
/*else*/ {
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":228 */
|
|
__pyx_4 = PyFloat_AsDouble(__pyx_v_x); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
|
|
((struct __pyx_obj_17Scientific_vector_Vector *)__pyx_v_self)->__pyx_base.xv = __pyx_4;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":229 */
|
|
__pyx_4 = PyFloat_AsDouble(__pyx_v_y); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
|
|
((struct __pyx_obj_17Scientific_vector_Vector *)__pyx_v_self)->__pyx_base.yv = __pyx_4;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":230 */
|
|
__pyx_4 = PyFloat_AsDouble(__pyx_v_z); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
|
|
((struct __pyx_obj_17Scientific_vector_Vector *)__pyx_v_self)->__pyx_base.zv = __pyx_4;
|
|
}
|
|
__pyx_L2:;
|
|
|
|
__pyx_r = 0;
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_2);
|
|
Py_XDECREF(__pyx_3);
|
|
__Pyx_AddTraceback("Scientific_vector.Vector.__init__");
|
|
__pyx_r = -1;
|
|
__pyx_L0:;
|
|
Py_DECREF((PyObject *)__pyx_v_self);
|
|
Py_DECREF(__pyx_v_x);
|
|
Py_DECREF(__pyx_v_y);
|
|
Py_DECREF(__pyx_v_z);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static PyObject *__pyx_n_is_vector;
|
|
static PyObject *__pyx_n_AttributeError;
|
|
|
|
static PyObject *__pyx_f_17Scientific_vector_isVector(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
|
static PyObject *__pyx_f_17Scientific_vector_isVector(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
|
PyObject *__pyx_v_x = 0;
|
|
PyObject *__pyx_r;
|
|
PyObject *__pyx_1 = 0;
|
|
int __pyx_2;
|
|
PyObject *__pyx_3 = 0;
|
|
PyObject *__pyx_4 = 0;
|
|
PyObject *__pyx_5 = 0;
|
|
static char *__pyx_argnames[] = {"x",0};
|
|
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
|
|
Py_INCREF(__pyx_v_x);
|
|
/*try:*/ {
|
|
__pyx_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_is_vector); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; goto __pyx_L2;}
|
|
__pyx_r = __pyx_1;
|
|
__pyx_1 = 0;
|
|
goto __pyx_L0;
|
|
}
|
|
goto __pyx_L3;
|
|
__pyx_L2:;
|
|
Py_XDECREF(__pyx_1); __pyx_1 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":240 */
|
|
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;}
|
|
__pyx_2 = PyErr_ExceptionMatches(__pyx_1);
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
if (__pyx_2) {
|
|
__Pyx_AddTraceback("Scientific_vector.isVector");
|
|
if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;}
|
|
__pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}
|
|
__pyx_r = __pyx_5;
|
|
__pyx_5 = 0;
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
Py_DECREF(__pyx_3); __pyx_3 = 0;
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
goto __pyx_L0;
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
Py_DECREF(__pyx_3); __pyx_3 = 0;
|
|
Py_DECREF(__pyx_4); __pyx_4 = 0;
|
|
goto __pyx_L3;
|
|
}
|
|
goto __pyx_L1;
|
|
__pyx_L3:;
|
|
|
|
__pyx_r = Py_None; Py_INCREF(Py_None);
|
|
goto __pyx_L0;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_3);
|
|
Py_XDECREF(__pyx_4);
|
|
Py_XDECREF(__pyx_5);
|
|
__Pyx_AddTraceback("Scientific_vector.isVector");
|
|
__pyx_r = 0;
|
|
__pyx_L0:;
|
|
Py_DECREF(__pyx_v_x);
|
|
return __pyx_r;
|
|
}
|
|
|
|
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
|
|
{&__pyx_n_AttributeError, "AttributeError"},
|
|
{&__pyx_n_Geometry, "Geometry"},
|
|
{&__pyx_n_N, "N"},
|
|
{&__pyx_n_NewAxis, "NewAxis"},
|
|
{&__pyx_n_NotImplemented, "NotImplemented"},
|
|
{&__pyx_n_Scientific, "Scientific"},
|
|
{&__pyx_n_Tensor, "Tensor"},
|
|
{&__pyx_n__product_with_vector, "_product_with_vector"},
|
|
{&__pyx_n_array, "array"},
|
|
{&__pyx_n_dot, "dot"},
|
|
{&__pyx_n_isTensor, "isTensor"},
|
|
{&__pyx_n_is_vector, "is_vector"},
|
|
{&__pyx_n_rank, "rank"},
|
|
{&__pyx_n_self, "self"},
|
|
{&__pyx_n_x, "x"},
|
|
{&__pyx_n_y, "y"},
|
|
{&__pyx_n_z, "z"},
|
|
{0, 0}
|
|
};
|
|
|
|
static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
|
{&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8)},
|
|
{&__pyx_k12p, __pyx_k12, sizeof(__pyx_k12)},
|
|
{&__pyx_k17p, __pyx_k17, sizeof(__pyx_k17)},
|
|
{0, 0, 0}
|
|
};
|
|
static struct __pyx_vtabstruct_17Scientific_vector_vector __pyx_vtable_17Scientific_vector_vector;
|
|
|
|
static PyObject *__pyx_tp_new_17Scientific_vector_vector(PyTypeObject *t, PyObject *a, PyObject *k) {
|
|
struct __pyx_obj_17Scientific_vector_vector *p;
|
|
PyObject *o = (*t->tp_alloc)(t, 0);
|
|
if (!o) return 0;
|
|
p = ((struct __pyx_obj_17Scientific_vector_vector *)o);
|
|
*(struct __pyx_vtabstruct_17Scientific_vector_vector **)&p->__pyx_vtab = __pyx_vtabptr_17Scientific_vector_vector;
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_17Scientific_vector_vector(PyObject *o) {
|
|
(*o->ob_type->tp_free)(o);
|
|
}
|
|
static PyObject *__pyx_sq_item_17Scientific_vector_vector(PyObject *o, Py_ssize_t i) {
|
|
PyObject *r;
|
|
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
|
|
r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
|
|
Py_DECREF(x);
|
|
return r;
|
|
}
|
|
|
|
static PyObject *__pyx_getprop_17Scientific_vector_6vector_is_vector(PyObject *o, void *x) {
|
|
return __pyx_f_17Scientific_vector_6vector_9is_vector___get__(o);
|
|
}
|
|
|
|
static PyObject *__pyx_getprop_17Scientific_vector_6vector_array(PyObject *o, void *x) {
|
|
return __pyx_f_17Scientific_vector_6vector_5array___get__(o);
|
|
}
|
|
|
|
static PyObject *__pyx_getprop_17Scientific_vector_6vector___array_priority__(PyObject *o, void *x) {
|
|
return __pyx_f_17Scientific_vector_6vector_18__array_priority_____get__(o);
|
|
}
|
|
|
|
static struct PyMethodDef __pyx_methods_17Scientific_vector_vector[] = {
|
|
{"__array_wrap__", (PyCFunction)__pyx_f_17Scientific_vector_6vector___array_wrap__, METH_VARARGS|METH_KEYWORDS, 0},
|
|
{"__copy__", (PyCFunction)__pyx_f_17Scientific_vector_6vector___copy__, METH_VARARGS|METH_KEYWORDS, 0},
|
|
{"__deepcopy__", (PyCFunction)__pyx_f_17Scientific_vector_6vector___deepcopy__, METH_VARARGS|METH_KEYWORDS, 0},
|
|
{"__getstate__", (PyCFunction)__pyx_f_17Scientific_vector_6vector___getstate__, METH_VARARGS|METH_KEYWORDS, 0},
|
|
{"__setstate__", (PyCFunction)__pyx_f_17Scientific_vector_6vector___setstate__, METH_VARARGS|METH_KEYWORDS, 0},
|
|
{"__reduce__", (PyCFunction)__pyx_f_17Scientific_vector_6vector___reduce__, METH_VARARGS|METH_KEYWORDS, 0},
|
|
{"x", (PyCFunction)__pyx_f_17Scientific_vector_6vector_x, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_x},
|
|
{"y", (PyCFunction)__pyx_f_17Scientific_vector_6vector_y, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_y},
|
|
{"z", (PyCFunction)__pyx_f_17Scientific_vector_6vector_z, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_z},
|
|
{"length", (PyCFunction)__pyx_f_17Scientific_vector_6vector_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_length},
|
|
{"normal", (PyCFunction)__pyx_f_17Scientific_vector_6vector_normal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_normal},
|
|
{"cross", (PyCFunction)__pyx_f_17Scientific_vector_6vector_cross, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_cross},
|
|
{"angle", (PyCFunction)__pyx_f_17Scientific_vector_6vector_angle, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_angle},
|
|
{"asTensor", (PyCFunction)__pyx_f_17Scientific_vector_6vector_asTensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_asTensor},
|
|
{"dyadicProduct", (PyCFunction)__pyx_f_17Scientific_vector_6vector_dyadicProduct, METH_VARARGS|METH_KEYWORDS, __pyx_doc_17Scientific_vector_6vector_dyadicProduct},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static struct PyGetSetDef __pyx_getsets_17Scientific_vector_vector[] = {
|
|
{"is_vector", __pyx_getprop_17Scientific_vector_6vector_is_vector, 0, 0, 0},
|
|
{"array", __pyx_getprop_17Scientific_vector_6vector_array, 0, 0, 0},
|
|
{"__array_priority__", __pyx_getprop_17Scientific_vector_6vector___array_priority__, 0, 0, 0},
|
|
{0, 0, 0, 0, 0}
|
|
};
|
|
|
|
static PyNumberMethods __pyx_tp_as_number_vector = {
|
|
__pyx_f_17Scientific_vector_6vector___add__, /*nb_add*/
|
|
__pyx_f_17Scientific_vector_6vector___sub__, /*nb_subtract*/
|
|
__pyx_f_17Scientific_vector_6vector___mul__, /*nb_multiply*/
|
|
__pyx_f_17Scientific_vector_6vector___div__, /*nb_divide*/
|
|
0, /*nb_remainder*/
|
|
0, /*nb_divmod*/
|
|
0, /*nb_power*/
|
|
__pyx_f_17Scientific_vector_6vector___neg__, /*nb_negative*/
|
|
0, /*nb_positive*/
|
|
0, /*nb_absolute*/
|
|
0, /*nb_nonzero*/
|
|
0, /*nb_invert*/
|
|
0, /*nb_lshift*/
|
|
0, /*nb_rshift*/
|
|
0, /*nb_and*/
|
|
0, /*nb_xor*/
|
|
0, /*nb_or*/
|
|
0, /*nb_coerce*/
|
|
0, /*nb_int*/
|
|
0, /*nb_long*/
|
|
0, /*nb_float*/
|
|
0, /*nb_oct*/
|
|
0, /*nb_hex*/
|
|
0, /*nb_inplace_add*/
|
|
0, /*nb_inplace_subtract*/
|
|
0, /*nb_inplace_multiply*/
|
|
0, /*nb_inplace_divide*/
|
|
0, /*nb_inplace_remainder*/
|
|
0, /*nb_inplace_power*/
|
|
0, /*nb_inplace_lshift*/
|
|
0, /*nb_inplace_rshift*/
|
|
0, /*nb_inplace_and*/
|
|
0, /*nb_inplace_xor*/
|
|
0, /*nb_inplace_or*/
|
|
0, /*nb_floor_divide*/
|
|
0, /*nb_true_divide*/
|
|
0, /*nb_inplace_floor_divide*/
|
|
0, /*nb_inplace_true_divide*/
|
|
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
|
|
0, /*nb_index*/
|
|
#endif
|
|
};
|
|
|
|
static PySequenceMethods __pyx_tp_as_sequence_vector = {
|
|
__pyx_f_17Scientific_vector_6vector___len__, /*sq_length*/
|
|
0, /*sq_concat*/
|
|
0, /*sq_repeat*/
|
|
__pyx_sq_item_17Scientific_vector_vector, /*sq_item*/
|
|
0, /*sq_slice*/
|
|
0, /*sq_ass_item*/
|
|
0, /*sq_ass_slice*/
|
|
0, /*sq_contains*/
|
|
0, /*sq_inplace_concat*/
|
|
0, /*sq_inplace_repeat*/
|
|
};
|
|
|
|
static PyMappingMethods __pyx_tp_as_mapping_vector = {
|
|
__pyx_f_17Scientific_vector_6vector___len__, /*mp_length*/
|
|
__pyx_f_17Scientific_vector_6vector___getitem__, /*mp_subscript*/
|
|
0, /*mp_ass_subscript*/
|
|
};
|
|
|
|
static PyBufferProcs __pyx_tp_as_buffer_vector = {
|
|
0, /*bf_getreadbuffer*/
|
|
0, /*bf_getwritebuffer*/
|
|
0, /*bf_getsegcount*/
|
|
0, /*bf_getcharbuffer*/
|
|
};
|
|
|
|
PyTypeObject __pyx_type_17Scientific_vector_vector = {
|
|
PyObject_HEAD_INIT(0)
|
|
0, /*ob_size*/
|
|
"Scientific_vector.vector", /*tp_name*/
|
|
sizeof(struct __pyx_obj_17Scientific_vector_vector), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_17Scientific_vector_vector, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
0, /*tp_compare*/
|
|
__pyx_f_17Scientific_vector_6vector___repr__, /*tp_repr*/
|
|
&__pyx_tp_as_number_vector, /*tp_as_number*/
|
|
&__pyx_tp_as_sequence_vector, /*tp_as_sequence*/
|
|
&__pyx_tp_as_mapping_vector, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
__pyx_f_17Scientific_vector_6vector___str__, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
&__pyx_tp_as_buffer_vector, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
__pyx_f_17Scientific_vector_6vector___richcmp__, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_17Scientific_vector_vector, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
__pyx_getsets_17Scientific_vector_vector, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
0, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_17Scientific_vector_vector, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
};
|
|
static struct __pyx_vtabstruct_17Scientific_vector_Vector __pyx_vtable_17Scientific_vector_Vector;
|
|
|
|
static PyObject *__pyx_tp_new_17Scientific_vector_Vector(PyTypeObject *t, PyObject *a, PyObject *k) {
|
|
struct __pyx_obj_17Scientific_vector_Vector *p;
|
|
PyObject *o = __pyx_ptype_17Scientific_vector_vector->tp_new(t, a, k);
|
|
if (!o) return 0;
|
|
p = ((struct __pyx_obj_17Scientific_vector_Vector *)o);
|
|
*(struct __pyx_vtabstruct_17Scientific_vector_Vector **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_17Scientific_vector_Vector;
|
|
return o;
|
|
}
|
|
|
|
static void __pyx_tp_dealloc_17Scientific_vector_Vector(PyObject *o) {
|
|
__pyx_ptype_17Scientific_vector_vector->tp_dealloc(o);
|
|
}
|
|
|
|
static PyObject *__pyx_getprop_17Scientific_vector_6Vector___safe_for_unpickling__(PyObject *o, void *x) {
|
|
return __pyx_f_17Scientific_vector_6Vector_23__safe_for_unpickling_____get__(o);
|
|
}
|
|
|
|
static struct PyMethodDef __pyx_methods_17Scientific_vector_Vector[] = {
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static struct PyGetSetDef __pyx_getsets_17Scientific_vector_Vector[] = {
|
|
{"__safe_for_unpickling__", __pyx_getprop_17Scientific_vector_6Vector___safe_for_unpickling__, 0, 0, 0},
|
|
{0, 0, 0, 0, 0}
|
|
};
|
|
|
|
static PyNumberMethods __pyx_tp_as_number_Vector = {
|
|
0, /*nb_add*/
|
|
0, /*nb_subtract*/
|
|
0, /*nb_multiply*/
|
|
0, /*nb_divide*/
|
|
0, /*nb_remainder*/
|
|
0, /*nb_divmod*/
|
|
0, /*nb_power*/
|
|
0, /*nb_negative*/
|
|
0, /*nb_positive*/
|
|
0, /*nb_absolute*/
|
|
0, /*nb_nonzero*/
|
|
0, /*nb_invert*/
|
|
0, /*nb_lshift*/
|
|
0, /*nb_rshift*/
|
|
0, /*nb_and*/
|
|
0, /*nb_xor*/
|
|
0, /*nb_or*/
|
|
0, /*nb_coerce*/
|
|
0, /*nb_int*/
|
|
0, /*nb_long*/
|
|
0, /*nb_float*/
|
|
0, /*nb_oct*/
|
|
0, /*nb_hex*/
|
|
0, /*nb_inplace_add*/
|
|
0, /*nb_inplace_subtract*/
|
|
0, /*nb_inplace_multiply*/
|
|
0, /*nb_inplace_divide*/
|
|
0, /*nb_inplace_remainder*/
|
|
0, /*nb_inplace_power*/
|
|
0, /*nb_inplace_lshift*/
|
|
0, /*nb_inplace_rshift*/
|
|
0, /*nb_inplace_and*/
|
|
0, /*nb_inplace_xor*/
|
|
0, /*nb_inplace_or*/
|
|
0, /*nb_floor_divide*/
|
|
0, /*nb_true_divide*/
|
|
0, /*nb_inplace_floor_divide*/
|
|
0, /*nb_inplace_true_divide*/
|
|
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
|
|
0, /*nb_index*/
|
|
#endif
|
|
};
|
|
|
|
static PySequenceMethods __pyx_tp_as_sequence_Vector = {
|
|
0, /*sq_length*/
|
|
0, /*sq_concat*/
|
|
0, /*sq_repeat*/
|
|
0, /*sq_item*/
|
|
0, /*sq_slice*/
|
|
0, /*sq_ass_item*/
|
|
0, /*sq_ass_slice*/
|
|
0, /*sq_contains*/
|
|
0, /*sq_inplace_concat*/
|
|
0, /*sq_inplace_repeat*/
|
|
};
|
|
|
|
static PyMappingMethods __pyx_tp_as_mapping_Vector = {
|
|
0, /*mp_length*/
|
|
0, /*mp_subscript*/
|
|
0, /*mp_ass_subscript*/
|
|
};
|
|
|
|
static PyBufferProcs __pyx_tp_as_buffer_Vector = {
|
|
0, /*bf_getreadbuffer*/
|
|
0, /*bf_getwritebuffer*/
|
|
0, /*bf_getsegcount*/
|
|
0, /*bf_getcharbuffer*/
|
|
};
|
|
|
|
PyTypeObject __pyx_type_17Scientific_vector_Vector = {
|
|
PyObject_HEAD_INIT(0)
|
|
0, /*ob_size*/
|
|
"Scientific_vector.Vector", /*tp_name*/
|
|
sizeof(struct __pyx_obj_17Scientific_vector_Vector), /*tp_basicsize*/
|
|
0, /*tp_itemsize*/
|
|
__pyx_tp_dealloc_17Scientific_vector_Vector, /*tp_dealloc*/
|
|
0, /*tp_print*/
|
|
0, /*tp_getattr*/
|
|
0, /*tp_setattr*/
|
|
0, /*tp_compare*/
|
|
0, /*tp_repr*/
|
|
&__pyx_tp_as_number_Vector, /*tp_as_number*/
|
|
&__pyx_tp_as_sequence_Vector, /*tp_as_sequence*/
|
|
&__pyx_tp_as_mapping_Vector, /*tp_as_mapping*/
|
|
0, /*tp_hash*/
|
|
0, /*tp_call*/
|
|
0, /*tp_str*/
|
|
0, /*tp_getattro*/
|
|
0, /*tp_setattro*/
|
|
&__pyx_tp_as_buffer_Vector, /*tp_as_buffer*/
|
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
|
0, /*tp_doc*/
|
|
0, /*tp_traverse*/
|
|
0, /*tp_clear*/
|
|
0, /*tp_richcompare*/
|
|
0, /*tp_weaklistoffset*/
|
|
0, /*tp_iter*/
|
|
0, /*tp_iternext*/
|
|
__pyx_methods_17Scientific_vector_Vector, /*tp_methods*/
|
|
0, /*tp_members*/
|
|
__pyx_getsets_17Scientific_vector_Vector, /*tp_getset*/
|
|
0, /*tp_base*/
|
|
0, /*tp_dict*/
|
|
0, /*tp_descr_get*/
|
|
0, /*tp_descr_set*/
|
|
0, /*tp_dictoffset*/
|
|
__pyx_f_17Scientific_vector_6Vector___init__, /*tp_init*/
|
|
0, /*tp_alloc*/
|
|
__pyx_tp_new_17Scientific_vector_Vector, /*tp_new*/
|
|
0, /*tp_free*/
|
|
0, /*tp_is_gc*/
|
|
0, /*tp_bases*/
|
|
0, /*tp_mro*/
|
|
0, /*tp_cache*/
|
|
0, /*tp_subclasses*/
|
|
0, /*tp_weaklist*/
|
|
};
|
|
|
|
static struct PyMethodDef __pyx_methods[] = {
|
|
{"isVector", (PyCFunction)__pyx_f_17Scientific_vector_isVector, METH_VARARGS|METH_KEYWORDS, 0},
|
|
{0, 0, 0, 0}
|
|
};
|
|
|
|
static void __pyx_init_filenames(void); /*proto*/
|
|
|
|
PyMODINIT_FUNC initScientific_vector(void); /*proto*/
|
|
PyMODINIT_FUNC initScientific_vector(void) {
|
|
PyObject *__pyx_1 = 0;
|
|
PyObject *__pyx_2 = 0;
|
|
__pyx_init_filenames();
|
|
__pyx_m = Py_InitModule4("Scientific_vector", __pyx_methods, 0, 0, PYTHON_API_VERSION);
|
|
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;};
|
|
Py_INCREF(__pyx_m);
|
|
__pyx_b = PyImport_AddModule("__builtin__");
|
|
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;};
|
|
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;};
|
|
if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;};
|
|
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; goto __pyx_L1;};
|
|
__pyx_vtabptr_17Scientific_vector_vector = &__pyx_vtable_17Scientific_vector_vector;
|
|
*(void(**)(void))&__pyx_vtable_17Scientific_vector_vector.set = (void(*)(void))__pyx_f_17Scientific_vector_6vector_set;
|
|
if (PyType_Ready(&__pyx_type_17Scientific_vector_vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
|
|
if (__Pyx_SetVtable(__pyx_type_17Scientific_vector_vector.tp_dict, __pyx_vtabptr_17Scientific_vector_vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
|
|
if (PyObject_SetAttrString(__pyx_m, "vector", (PyObject *)&__pyx_type_17Scientific_vector_vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; goto __pyx_L1;}
|
|
__pyx_ptype_17Scientific_vector_vector = &__pyx_type_17Scientific_vector_vector;
|
|
__pyx_vtabptr_17Scientific_vector_Vector = &__pyx_vtable_17Scientific_vector_Vector;
|
|
__pyx_vtable_17Scientific_vector_Vector.__pyx_base = *__pyx_vtabptr_17Scientific_vector_vector;
|
|
__pyx_type_17Scientific_vector_Vector.tp_base = __pyx_ptype_17Scientific_vector_vector;
|
|
if (PyType_Ready(&__pyx_type_17Scientific_vector_Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
|
|
if (__Pyx_SetVtable(__pyx_type_17Scientific_vector_Vector.tp_dict, __pyx_vtabptr_17Scientific_vector_Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
|
|
if (PyObject_SetAttrString(__pyx_m, "Vector", (PyObject *)&__pyx_type_17Scientific_vector_Vector) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
|
|
__pyx_ptype_17Scientific_vector_Vector = &__pyx_type_17Scientific_vector_Vector;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":13 */
|
|
__pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
|
|
Py_INCREF(__pyx_n_N);
|
|
PyList_SET_ITEM(__pyx_1, 0, __pyx_n_N);
|
|
__pyx_2 = __Pyx_Import(__pyx_n_Scientific, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_N); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
|
|
if (PyObject_SetAttr(__pyx_m, __pyx_n_N, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
|
|
Py_DECREF(__pyx_1); __pyx_1 = 0;
|
|
Py_DECREF(__pyx_2); __pyx_2 = 0;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":47 */
|
|
Py_INCREF(Py_None);
|
|
__pyx_k3 = Py_None;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":50 */
|
|
Py_INCREF(Py_None);
|
|
__pyx_k4 = Py_None;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":222 */
|
|
Py_INCREF(Py_None);
|
|
__pyx_k5 = Py_None;
|
|
Py_INCREF(Py_None);
|
|
__pyx_k6 = Py_None;
|
|
Py_INCREF(Py_None);
|
|
__pyx_k7 = Py_None;
|
|
|
|
/* "/Users/hinsen/Programs/ScientificPython/main/Src/Scientific_vector.pyx":237 */
|
|
return;
|
|
__pyx_L1:;
|
|
Py_XDECREF(__pyx_1);
|
|
Py_XDECREF(__pyx_2);
|
|
__Pyx_AddTraceback("Scientific_vector");
|
|
}
|
|
|
|
static char *__pyx_filenames[] = {
|
|
"Scientific_vector.pyx",
|
|
};
|
|
|
|
/* Runtime support code */
|
|
|
|
static void __pyx_init_filenames(void) {
|
|
__pyx_f = __pyx_filenames;
|
|
}
|
|
|
|
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) {
|
|
if (!type) {
|
|
PyErr_Format(PyExc_SystemError, "Missing type object");
|
|
return 0;
|
|
}
|
|
if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type))
|
|
return 1;
|
|
PyErr_Format(PyExc_TypeError,
|
|
"Argument '%s' has incorrect type (expected %s, got %s)",
|
|
name, type->tp_name, obj->ob_type->tp_name);
|
|
return 0;
|
|
}
|
|
|
|
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
|
|
PyObject *__import__ = 0;
|
|
PyObject *empty_list = 0;
|
|
PyObject *module = 0;
|
|
PyObject *global_dict = 0;
|
|
PyObject *empty_dict = 0;
|
|
PyObject *list;
|
|
__import__ = PyObject_GetAttrString(__pyx_b, "__import__");
|
|
if (!__import__)
|
|
goto bad;
|
|
if (from_list)
|
|
list = from_list;
|
|
else {
|
|
empty_list = PyList_New(0);
|
|
if (!empty_list)
|
|
goto bad;
|
|
list = empty_list;
|
|
}
|
|
global_dict = PyModule_GetDict(__pyx_m);
|
|
if (!global_dict)
|
|
goto bad;
|
|
empty_dict = PyDict_New();
|
|
if (!empty_dict)
|
|
goto bad;
|
|
module = PyObject_CallFunction(__import__, "OOOO",
|
|
name, global_dict, empty_dict, list);
|
|
bad:
|
|
Py_XDECREF(empty_list);
|
|
Py_XDECREF(__import__);
|
|
Py_XDECREF(empty_dict);
|
|
return module;
|
|
}
|
|
|
|
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
|
|
PyObject *result;
|
|
result = PyObject_GetAttr(dict, name);
|
|
if (!result)
|
|
PyErr_SetObject(PyExc_NameError, name);
|
|
return result;
|
|
}
|
|
|
|
static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) {
|
|
PyTypeObject *t = o->ob_type;
|
|
PyObject *r;
|
|
if (t->tp_as_sequence && t->tp_as_sequence->sq_item)
|
|
r = PySequence_GetItem(o, i);
|
|
else {
|
|
PyObject *j = PyInt_FromLong(i);
|
|
if (!j)
|
|
return 0;
|
|
r = PyObject_GetItem(o, j);
|
|
Py_DECREF(j);
|
|
}
|
|
return r;
|
|
}
|
|
|
|
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
|
|
if (!type) {
|
|
PyErr_Format(PyExc_SystemError, "Missing type object");
|
|
return 0;
|
|
}
|
|
if (obj == Py_None || PyObject_TypeCheck(obj, type))
|
|
return 1;
|
|
PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
|
|
obj->ob_type->tp_name, type->tp_name);
|
|
return 0;
|
|
}
|
|
|
|
static void __Pyx_UnpackError(void) {
|
|
PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
|
|
}
|
|
|
|
static PyObject *__Pyx_UnpackItem(PyObject *iter) {
|
|
PyObject *item;
|
|
if (!(item = PyIter_Next(iter))) {
|
|
if (!PyErr_Occurred())
|
|
__Pyx_UnpackError();
|
|
}
|
|
return item;
|
|
}
|
|
|
|
static int __Pyx_EndUnpack(PyObject *iter) {
|
|
PyObject *item;
|
|
if ((item = PyIter_Next(iter))) {
|
|
Py_DECREF(item);
|
|
__Pyx_UnpackError();
|
|
return -1;
|
|
}
|
|
else if (!PyErr_Occurred())
|
|
return 0;
|
|
else
|
|
return -1;
|
|
}
|
|
|
|
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
|
|
Py_XINCREF(type);
|
|
Py_XINCREF(value);
|
|
Py_XINCREF(tb);
|
|
/* First, check the traceback argument, replacing None with NULL. */
|
|
if (tb == Py_None) {
|
|
Py_DECREF(tb);
|
|
tb = 0;
|
|
}
|
|
else if (tb != NULL && !PyTraceBack_Check(tb)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"raise: arg 3 must be a traceback or None");
|
|
goto raise_error;
|
|
}
|
|
/* Next, replace a missing value with None */
|
|
if (value == NULL) {
|
|
value = Py_None;
|
|
Py_INCREF(value);
|
|
}
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
if (!PyClass_Check(type))
|
|
#else
|
|
if (!PyType_Check(type))
|
|
#endif
|
|
{
|
|
/* Raising an instance. The value should be a dummy. */
|
|
if (value != Py_None) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"instance exception may not have a separate value");
|
|
goto raise_error;
|
|
}
|
|
/* Normalize to raise <class>, <instance> */
|
|
Py_DECREF(value);
|
|
value = type;
|
|
#if PY_VERSION_HEX < 0x02050000
|
|
if (PyInstance_Check(type)) {
|
|
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
|
|
Py_INCREF(type);
|
|
}
|
|
else {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"raise: exception must be an old-style class or instance");
|
|
goto raise_error;
|
|
}
|
|
#else
|
|
type = (PyObject*) type->ob_type;
|
|
Py_INCREF(type);
|
|
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
|
|
PyErr_SetString(PyExc_TypeError,
|
|
"raise: exception class must be a subclass of BaseException");
|
|
goto raise_error;
|
|
}
|
|
#endif
|
|
}
|
|
PyErr_Restore(type, value, tb);
|
|
return;
|
|
raise_error:
|
|
Py_XDECREF(value);
|
|
Py_XDECREF(type);
|
|
Py_XDECREF(tb);
|
|
return;
|
|
}
|
|
|
|
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
|
|
PyThreadState *tstate = PyThreadState_Get();
|
|
PyErr_Fetch(type, value, tb);
|
|
PyErr_NormalizeException(type, value, tb);
|
|
if (PyErr_Occurred())
|
|
goto bad;
|
|
Py_INCREF(*type);
|
|
Py_INCREF(*value);
|
|
Py_INCREF(*tb);
|
|
Py_XDECREF(tstate->exc_type);
|
|
Py_XDECREF(tstate->exc_value);
|
|
Py_XDECREF(tstate->exc_traceback);
|
|
tstate->exc_type = *type;
|
|
tstate->exc_value = *value;
|
|
tstate->exc_traceback = *tb;
|
|
return 0;
|
|
bad:
|
|
Py_XDECREF(*type);
|
|
Py_XDECREF(*value);
|
|
Py_XDECREF(*tb);
|
|
return -1;
|
|
}
|
|
|
|
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
|
|
while (t->p) {
|
|
*t->p = PyString_InternFromString(t->s);
|
|
if (!*t->p)
|
|
return -1;
|
|
++t;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
|
|
while (t->p) {
|
|
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
|
|
if (!*t->p)
|
|
return -1;
|
|
++t;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
|
|
PyObject *pycobj = 0;
|
|
int result;
|
|
|
|
pycobj = PyCObject_FromVoidPtr(vtable, 0);
|
|
if (!pycobj)
|
|
goto bad;
|
|
if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0)
|
|
goto bad;
|
|
result = 0;
|
|
goto done;
|
|
|
|
bad:
|
|
result = -1;
|
|
done:
|
|
Py_XDECREF(pycobj);
|
|
return result;
|
|
}
|
|
|
|
#include "compile.h"
|
|
#include "frameobject.h"
|
|
#include "traceback.h"
|
|
|
|
static void __Pyx_AddTraceback(char *funcname) {
|
|
PyObject *py_srcfile = 0;
|
|
PyObject *py_funcname = 0;
|
|
PyObject *py_globals = 0;
|
|
PyObject *empty_tuple = 0;
|
|
PyObject *empty_string = 0;
|
|
PyCodeObject *py_code = 0;
|
|
PyFrameObject *py_frame = 0;
|
|
|
|
py_srcfile = PyString_FromString(__pyx_filename);
|
|
if (!py_srcfile) goto bad;
|
|
py_funcname = PyString_FromString(funcname);
|
|
if (!py_funcname) goto bad;
|
|
py_globals = PyModule_GetDict(__pyx_m);
|
|
if (!py_globals) goto bad;
|
|
empty_tuple = PyTuple_New(0);
|
|
if (!empty_tuple) goto bad;
|
|
empty_string = PyString_FromString("");
|
|
if (!empty_string) goto bad;
|
|
py_code = PyCode_New(
|
|
0, /*int argcount,*/
|
|
0, /*int nlocals,*/
|
|
0, /*int stacksize,*/
|
|
0, /*int flags,*/
|
|
empty_string, /*PyObject *code,*/
|
|
empty_tuple, /*PyObject *consts,*/
|
|
empty_tuple, /*PyObject *names,*/
|
|
empty_tuple, /*PyObject *varnames,*/
|
|
empty_tuple, /*PyObject *freevars,*/
|
|
empty_tuple, /*PyObject *cellvars,*/
|
|
py_srcfile, /*PyObject *filename,*/
|
|
py_funcname, /*PyObject *name,*/
|
|
__pyx_lineno, /*int firstlineno,*/
|
|
empty_string /*PyObject *lnotab*/
|
|
);
|
|
if (!py_code) goto bad;
|
|
py_frame = PyFrame_New(
|
|
PyThreadState_Get(), /*PyThreadState *tstate,*/
|
|
py_code, /*PyCodeObject *code,*/
|
|
py_globals, /*PyObject *globals,*/
|
|
0 /*PyObject *locals*/
|
|
);
|
|
if (!py_frame) goto bad;
|
|
py_frame->f_lineno = __pyx_lineno;
|
|
PyTraceBack_Here(py_frame);
|
|
bad:
|
|
Py_XDECREF(py_srcfile);
|
|
Py_XDECREF(py_funcname);
|
|
Py_XDECREF(empty_tuple);
|
|
Py_XDECREF(empty_string);
|
|
Py_XDECREF(py_code);
|
|
Py_XDECREF(py_frame);
|
|
}
|