/* Generated by Cython 0.12 on Sat Feb 13 15:44:34 2010 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#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 PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
       void *buf;
       PyObject *obj;
       Py_ssize_t len;
       Py_ssize_t itemsize;
       int readonly;
       int ndim;
       char *format;
       Py_ssize_t *shape;
       Py_ssize_t *strides;
       Py_ssize_t *suboffsets;
       void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyString_Type                PyUnicode_Type
  #define PyString_CheckExact          PyUnicode_CheckExact
#else
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_CheckExact           PyString_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#else
  #define _USE_MATH_DEFINES
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#define __PYX_HAVE_API__sage_link
#include "stdsage.h"
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
#include "math.h"
#include "gmp.h"
#include "factory.h"
#include "libsingular.h"
#include "prCopy.h"
#include "stairc.h"
#include "lists.h"
#include "intvec.h"
#include "syz.h"
#include "polynomial.h"
#include "singularconversion.h"

#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INLINE __inline
#else
#define INLINE 
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_FromString          PyString_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyString_AsString
#else
#define __Pyx_PyBytes_FromString          PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyBytes_AsString
#endif

#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

#if !defined(T_PYSSIZET)
#if PY_VERSION_HEX < 0x02050000
#define T_PYSSIZET T_INT
#elif !defined(T_LONGLONG)
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
#else
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
#endif
#endif


#if !defined(T_ULONGLONG)
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
#else
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
#endif
#if !defined(T_LONGLONG)
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
#else
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : \
        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
#endif

#define __Pyx_T_FLOATING(x) \
        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))

#if !defined(T_SIZET)
#if !defined(T_ULONGLONG)
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
#else
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
#endif
#endif

static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
#define likely(x)   __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
static const char **__pyx_f;


/* Type declarations */

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent.pxd":32
 * 
 *     # Called from the __init__ method to set up coercion.
 *     cdef int init_coerce(self, bint warn=*) except -1             # <<<<<<<<<<<<<<
 * 
 *     # returns whether or not there is a Morphism from S to self
 */

struct __pyx_opt_args_4sage_9structure_6parent_6Parent_init_coerce {
  int __pyx_n;
  int warn;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent.pxd":47
 *     # returns the Action by/on self on/by S
 *     # corresponding to op and self_on_left
 *     cpdef get_action(self, other, op=*, bint self_on_left=*)             # <<<<<<<<<<<<<<
 *     cpdef _get_action_(self, other, op, bint self_on_left)
 * 
 */

struct __pyx_opt_args_4sage_9structure_6parent_6Parent_get_action {
  int __pyx_n;
  PyObject *op;
  int self_on_left;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/sage_object.pxd":1
 * cdef class SageObject:             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_11sage_object_SageObject {
  PyObject_HEAD
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":12
 * import  sage_object
 * 
 * cdef class Element(sage_object.SageObject):             # <<<<<<<<<<<<<<
 *     cdef Parent _parent
 *     cdef _richcmp_c_impl(left, Element right, int op)
 */

struct __pyx_obj_4sage_9structure_7element_Element {
  struct __pyx_obj_4sage_9structure_11sage_object_SageObject __pyx_base;
  struct __pyx_vtabstruct_4sage_9structure_7element_Element *__pyx_vtab;
  struct __pyx_obj_4sage_9structure_6parent_Parent *_parent;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":27
 * 
 * 
 * cdef class ModuleElement(Element)       # forward declaration             # <<<<<<<<<<<<<<
 * 
 * cdef class RingElement(ModuleElement)   # forward declaration
 */

struct __pyx_obj_4sage_9structure_7element_ModuleElement {
  struct __pyx_obj_4sage_9structure_7element_Element __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":29
 * cdef class ModuleElement(Element)       # forward declaration
 * 
 * cdef class RingElement(ModuleElement)   # forward declaration             # <<<<<<<<<<<<<<
 * 
 * cdef class ModuleElement(Element):
 */

struct __pyx_obj_4sage_9structure_7element_RingElement {
  struct __pyx_obj_4sage_9structure_7element_ModuleElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":67
 *     cpdef RingElement _idiv_(self, RingElement right)
 * 
 * cdef class CommutativeRingElement(RingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement {
  struct __pyx_obj_4sage_9structure_7element_RingElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/polynomial/multi_polynomial.pxd":3
 * from sage.structure.element cimport CommutativeRingElement
 * 
 * cdef class MPolynomial(CommutativeRingElement):             # <<<<<<<<<<<<<<
 *     cdef long _hash_c(self)
 */

struct __pyx_obj_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial {
  struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/polynomial/multi_polynomial_libsingular.pxd":7
 * from sage.structure.parent cimport Parent
 * 
 * cdef class MPolynomial_libsingular(MPolynomial):             # <<<<<<<<<<<<<<
 *     cdef poly *_poly
 *     cpdef _repr_short_(self)
 */

struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular {
  struct __pyx_obj_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial __pyx_base;
  polyrec *_poly;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/category_object.pxd":17
 * # from sage.structure.parent cimport class Parent
 * 
 * cdef class CategoryObject(sage_object.SageObject):             # <<<<<<<<<<<<<<
 * 
 *     cdef _generators
 */

struct __pyx_obj_4sage_9structure_15category_object_CategoryObject {
  struct __pyx_obj_4sage_9structure_11sage_object_SageObject __pyx_base;
  PyObject *_generators;
  PyObject *_category;
  PyObject *_base;
  PyObject *_cdata;
  PyObject *_names;
  PyObject *_factory_data;
  PyObject *__weakref__;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent.pxd":13
 * 
 * 
 * cdef class Parent(category_object.CategoryObject):             # <<<<<<<<<<<<<<
 * 
 *     cdef public _element_constructor
 */

struct __pyx_obj_4sage_9structure_6parent_Parent {
  struct __pyx_obj_4sage_9structure_15category_object_CategoryObject __pyx_base;
  struct __pyx_vtabstruct_4sage_9structure_6parent_Parent *__pyx_vtab;
  PyObject *_element_constructor;
  PyObject *_convert_method_name;
  int _element_init_pass_parent;
  PyObject *_initial_coerce_list;
  PyObject *_initial_action_list;
  PyObject *_initial_convert_list;
  int _coercions_used;
  PyObject *__an_element;
  PyObject *_coerce_from_list;
  PyObject *_coerce_from_hash;
  PyObject *_action_list;
  PyObject *_action_hash;
  PyObject *_convert_from_list;
  PyObject *_convert_from_hash;
  PyObject *_embedding;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_old.pxd":10
 * 
 * cimport parent
 * cdef class Parent(parent.Parent):             # <<<<<<<<<<<<<<
 * 
 *     # returns a Morphism from S to self, or None
 */

struct __pyx_obj_4sage_9structure_10parent_old_Parent {
  struct __pyx_obj_4sage_9structure_6parent_Parent __pyx_base;
  PyObject *_has_coerce_map_from;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_base.pxd":11
 * cimport parent_old
 * 
 * cdef class ParentWithBase(parent_old.Parent):             # <<<<<<<<<<<<<<
 *     pass
 */

struct __pyx_obj_4sage_9structure_11parent_base_ParentWithBase {
  struct __pyx_obj_4sage_9structure_10parent_old_Parent __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_gens.pxd":15
 * cimport parent_base
 * 
 * cdef class ParentWithGens(parent_base.ParentWithBase):             # <<<<<<<<<<<<<<
 *     cdef public object _gens
 *     cdef public object _gens_dict
 */

struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithGens {
  struct __pyx_obj_4sage_9structure_11parent_base_ParentWithBase __pyx_base;
  PyObject *_gens;
  PyObject *_gens_dict;
  PyObject *_latex_names;
  PyObject *_list;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_gens.pxd":25
 *     cdef public object _generator_orders
 * 
 * cdef class ParentWithAdditiveAbelianGens(ParentWithGens):             # <<<<<<<<<<<<<<
 *     cdef public object _generator_orders
 */

struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens {
  struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithGens __pyx_base;
  PyObject *_generator_orders;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":3
 * from sage.structure.parent_gens cimport ParentWithGens
 * 
 * cdef class Ring(ParentWithGens):             # <<<<<<<<<<<<<<
 *     cdef public object _zero_element
 *     cdef public object _one_element
 */

struct __pyx_obj_4sage_5rings_4ring_Ring {
  struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithGens __pyx_base;
  PyObject *_zero_element;
  PyObject *_one_element;
  PyObject *_zero_ideal;
  PyObject *_unit_ideal;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":10
 *     cdef _an_element_c_impl(self)
 * 
 * cdef class CommutativeRing(Ring):             # <<<<<<<<<<<<<<
 *     cdef public object __fraction_field
 *     cdef public object __ideal_monoid
 */

struct __pyx_obj_4sage_5rings_4ring_CommutativeRing {
  struct __pyx_obj_4sage_5rings_4ring_Ring __pyx_base;
  PyObject *__fraction_field;
  PyObject *__ideal_monoid;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":14
 *     cdef public object __ideal_monoid
 * 
 * cdef class IntegralDomain(CommutativeRing):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_5rings_4ring_IntegralDomain {
  struct __pyx_obj_4sage_5rings_4ring_CommutativeRing __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":21
 * 
 * 
 * cdef class PrincipalIdealDomain(IntegralDomain):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_5rings_4ring_PrincipalIdealDomain {
  struct __pyx_obj_4sage_5rings_4ring_IntegralDomain __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":27
 *     pass
 * 
 * cdef class Field(PrincipalIdealDomain):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_5rings_4ring_Field {
  struct __pyx_obj_4sage_5rings_4ring_PrincipalIdealDomain __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":30
 *     pass
 * 
 * cdef class FiniteField(Field):             # <<<<<<<<<<<<<<
 *     cdef public object __multiplicative_generator
 *     cdef public object __polynomial_ring
 */

struct __pyx_obj_4sage_5rings_4ring_FiniteField {
  struct __pyx_obj_4sage_5rings_4ring_Field __pyx_base;
  PyObject *__multiplicative_generator;
  PyObject *__polynomial_ring;
  PyObject *__vector_space;
  PyObject *__interface;
  PyObject *_kwargs;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":88
 *     pass
 * 
 * cdef class AlgebraElement(RingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_AlgebraElement {
  struct __pyx_obj_4sage_9structure_7element_RingElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":113
 * 
 * 
 * cdef class Matrix(AlgebraElement):             # <<<<<<<<<<<<<<
 *     # All matrix classes must be written in Cython
 *     cdef Py_ssize_t _nrows
 */

struct __pyx_obj_4sage_9structure_7element_Matrix {
  struct __pyx_obj_4sage_9structure_7element_AlgebraElement __pyx_base;
  Py_ssize_t _nrows;
  Py_ssize_t _ncols;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":3
 * from sage.structure.sage_object cimport SageObject
 * 
 * cdef class Generators(SageObject):             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly _obj
 */

struct __pyx_obj_4sage_9structure_10generators_Generators {
  struct __pyx_obj_4sage_9structure_11sage_object_SageObject __pyx_base;
  struct __pyx_vtabstruct_4sage_9structure_10generators_Generators *__pyx_vtab;
  PyObject *_obj;
  PyObject *_index_set;
  PyObject *_category;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":16
 *     cpdef list(self)
 * 
 * cdef class Generators_finite(Generators):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t _n
 * 
 */

struct __pyx_obj_4sage_9structure_10generators_Generators_finite {
  struct __pyx_obj_4sage_9structure_10generators_Generators __pyx_base;
  Py_ssize_t _n;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":19
 *     cdef Py_ssize_t _n
 * 
 * cdef class Generators_list(Generators_finite):             # <<<<<<<<<<<<<<
 *     cdef _List
 * 
 */

struct __pyx_obj_4sage_9structure_10generators_Generators_list {
  struct __pyx_obj_4sage_9structure_10generators_Generators_finite __pyx_base;
  PyObject *_List;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":82
 *     pass
 * 
 * cdef class FieldElement(CommutativeRingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_FieldElement {
  struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":49
 *     cdef RingElement coerce_to_base_ring(self, x)
 * 
 * cdef class MonoidElement(Element):             # <<<<<<<<<<<<<<
 *     cpdef MonoidElement _mul_(self, MonoidElement right)
 * 
 */

struct __pyx_obj_4sage_9structure_7element_MonoidElement {
  struct __pyx_obj_4sage_9structure_7element_Element __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":52
 *     cpdef MonoidElement _mul_(self, MonoidElement right)
 * 
 * cdef class MultiplicativeGroupElement(MonoidElement):             # <<<<<<<<<<<<<<
 *     cpdef MultiplicativeGroupElement _div_(self, MultiplicativeGroupElement right)
 * 
 */

struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement {
  struct __pyx_obj_4sage_9structure_7element_MonoidElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":37
 *     cdef public object _kwargs
 * 
 * cdef class Algebra(Ring):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_5rings_4ring_Algebra {
  struct __pyx_obj_4sage_5rings_4ring_Ring __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":56
 * 
 * 
 * cdef class AdditiveGroupElement(ModuleElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_AdditiveGroupElement {
  struct __pyx_obj_4sage_9structure_7element_ModuleElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":22
 *     cdef _List
 * 
 * cdef class Generators_naturals(Generators):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_10generators_Generators_naturals {
  struct __pyx_obj_4sage_9structure_10generators_Generators __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":91
 *     pass
 * 
 * cdef class CommutativeAlgebraElement(CommutativeRingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_CommutativeAlgebraElement {
  struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":24
 *     pass
 * 
 * cdef class EuclideanDomain(PrincipalIdealDomain):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_5rings_4ring_EuclideanDomain {
  struct __pyx_obj_4sage_5rings_4ring_PrincipalIdealDomain __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":17
 *     pass
 * 
 * cdef class DedekindDomain(IntegralDomain):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_5rings_4ring_DedekindDomain {
  struct __pyx_obj_4sage_5rings_4ring_IntegralDomain __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":101
 * 
 * 
 * cdef class Vector(ModuleElement):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t _degree
 * 
 */

struct __pyx_obj_4sage_9structure_7element_Vector {
  struct __pyx_obj_4sage_9structure_7element_ModuleElement __pyx_base;
  Py_ssize_t _degree;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":40
 *     pass
 * 
 * cdef class CommutativeAlgebra(CommutativeRing):             # <<<<<<<<<<<<<<
 *     pass
 */

struct __pyx_obj_4sage_5rings_4ring_CommutativeAlgebra {
  struct __pyx_obj_4sage_5rings_4ring_CommutativeRing __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":25
 *     pass
 * 
 * cdef class Generators_none(Generators):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_10generators_Generators_none {
  struct __pyx_obj_4sage_9structure_10generators_Generators __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":70
 *     pass
 * 
 * cdef class IntegralDomainElement(CommutativeRingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_IntegralDomainElement {
  struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":73
 *     pass
 * 
 * cdef class DedekindDomainElement(IntegralDomainElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_DedekindDomainElement {
  struct __pyx_obj_4sage_9structure_7element_IntegralDomainElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":76
 *     pass
 * 
 * cdef class PrincipalIdealDomainElement(DedekindDomainElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_PrincipalIdealDomainElement {
  struct __pyx_obj_4sage_9structure_7element_DedekindDomainElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":79
 *     pass
 * 
 * cdef class EuclideanDomainElement(PrincipalIdealDomainElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement {
  struct __pyx_obj_4sage_9structure_7element_PrincipalIdealDomainElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_gens.pxd":22
 * 
 * 
 * cdef class ParentWithMultiplicativeAbelianGens(ParentWithGens):             # <<<<<<<<<<<<<<
 *     cdef public object _generator_orders
 * 
 */

struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens {
  struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithGens __pyx_base;
  PyObject *_generator_orders;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/polynomial/multi_polynomial_ring_generic.pxd":6
 * from sage.structure.parent cimport Parent
 * 
 * cdef class MPolynomialRing_generic(sage.rings.ring.CommutativeRing):             # <<<<<<<<<<<<<<
 *     cdef object __ngens
 *     cdef object __term_order
 */

struct __pyx_obj_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic {
  struct __pyx_obj_4sage_5rings_4ring_CommutativeRing __pyx_base;
  PyObject *__pyx___ngens;
  PyObject *__pyx___term_order;
  PyObject *_has_singular;
  PyObject *_magma_gens;
  PyObject *_magma_cache;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":94
 *     pass
 * 
 * cdef class CommutativeAlgebra(AlgebraElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_CommutativeAlgebra {
  struct __pyx_obj_4sage_9structure_7element_AlgebraElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":28
 *     pass
 * 
 * cdef class Generators_lazy_all(Generators):             # <<<<<<<<<<<<<<
 *     cdef _f
 *     cdef int _compute_gens(self) except -1
 */

struct __pyx_obj_4sage_9structure_10generators_Generators_lazy_all {
  struct __pyx_obj_4sage_9structure_10generators_Generators __pyx_base;
  PyObject *_f;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":128
 * 
 * 
 * cdef class CoercionModel:             # <<<<<<<<<<<<<<
 *     cpdef canonical_coercion(self, x, y)
 *     cpdef bin_op(self, x, y, op)
 */

struct __pyx_obj_4sage_9structure_7element_CoercionModel {
  PyObject_HEAD
  struct __pyx_vtabstruct_4sage_9structure_7element_CoercionModel *__pyx_vtab;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":97
 *     pass
 * 
 * cdef class InfinityElement(RingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_InfinityElement {
  struct __pyx_obj_4sage_9structure_7element_RingElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":85
 *     pass
 * 
 * cdef class FiniteFieldElement(FieldElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_obj_4sage_9structure_7element_FiniteFieldElement {
  struct __pyx_obj_4sage_9structure_7element_FieldElement __pyx_base;
};

/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/polynomial/multi_polynomial_libsingular.pxd":13
 *     cpdef _homogenize(self, int var)
 * 
 * cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):             # <<<<<<<<<<<<<<
 *     cdef object __singular
 *     cdef object __macaulay2
 */

struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular {
  struct __pyx_obj_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic __pyx_base;
  PyObject *__pyx___singular;
  PyObject *__pyx___macaulay2;
  PyObject *__pyx___m2_set_ring_cache;
  PyObject *__pyx___minpoly;
  ip_sring *_ring;
};


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":12
 * import  sage_object
 * 
 * cdef class Element(sage_object.SageObject):             # <<<<<<<<<<<<<<
 *     cdef Parent _parent
 *     cdef _richcmp_c_impl(left, Element right, int op)
 */

struct __pyx_vtabstruct_4sage_9structure_7element_Element {
  PyObject *(*_richcmp_c_impl)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_7element_Element *, int);
  int (*_cmp_c_impl)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_7element_Element *);
  PyObject *(*_richcmp)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int);
  PyObject *(*_cmp)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *);
  PyObject *(*_set_parent_c)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_6parent_Parent *);
  PyObject *(*base_extend_c)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_6parent_Parent *);
  PyObject *(*base_extend_c_impl)(struct __pyx_obj_4sage_9structure_7element_Element *, struct __pyx_obj_4sage_9structure_6parent_Parent *);
  PyObject *(*_rich_to_bool)(struct __pyx_obj_4sage_9structure_7element_Element *, int, int);
  PyObject *(*_act_on_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int, int __pyx_skip_dispatch);
  PyObject *(*_acted_upon_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4sage_9structure_7element_Element *__pyx_vtabptr_4sage_9structure_7element_Element;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":27
 * 
 * 
 * cdef class ModuleElement(Element)       # forward declaration             # <<<<<<<<<<<<<<
 * 
 * cdef class RingElement(ModuleElement)   # forward declaration
 */

struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_Element __pyx_base;
  struct __pyx_obj_4sage_9structure_7element_ModuleElement *(*_add_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_ModuleElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_ModuleElement *(*_sub_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_ModuleElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_ModuleElement *(*_neg_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_ModuleElement *(*_lmul_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_ModuleElement *(*_rmul_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_ModuleElement *(*_iadd_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_ModuleElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_ModuleElement *(*_isub_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_ModuleElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_ModuleElement *(*_ilmul_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_RingElement *(*coerce_to_base_ring)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, PyObject *);
};
static struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement *__pyx_vtabptr_4sage_9structure_7element_ModuleElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":29
 * cdef class ModuleElement(Element)       # forward declaration
 * 
 * cdef class RingElement(ModuleElement)   # forward declaration             # <<<<<<<<<<<<<<
 * 
 * cdef class ModuleElement(Element):
 */

struct __pyx_vtabstruct_4sage_9structure_7element_RingElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement __pyx_base;
  struct __pyx_obj_4sage_9structure_7element_RingElement *(*_mul_)(struct __pyx_obj_4sage_9structure_7element_RingElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_RingElement *(*_div_)(struct __pyx_obj_4sage_9structure_7element_RingElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_RingElement *(*_imul_)(struct __pyx_obj_4sage_9structure_7element_RingElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_RingElement *(*_idiv_)(struct __pyx_obj_4sage_9structure_7element_RingElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4sage_9structure_7element_RingElement *__pyx_vtabptr_4sage_9structure_7element_RingElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":97
 *     pass
 * 
 * cdef class InfinityElement(RingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_InfinityElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_RingElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_InfinityElement *__pyx_vtabptr_4sage_9structure_7element_InfinityElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent.pxd":13
 * 
 * 
 * cdef class Parent(category_object.CategoryObject):             # <<<<<<<<<<<<<<
 * 
 *     cdef public _element_constructor
 */

struct __pyx_vtabstruct_4sage_9structure_6parent_Parent {
  PyObject *(*register_coercion)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*register_action)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*register_conversion)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*register_embedding)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  int (*_richcmp_helper)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int, int __pyx_skip_dispatch);
  int (*is_exact)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int __pyx_skip_dispatch);
  int (*init_coerce)(struct __pyx_obj_4sage_9structure_6parent_Parent *, struct __pyx_opt_args_4sage_9structure_6parent_6Parent_init_coerce *__pyx_optional_args);
  int (*has_coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_coerce_map_from_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*convert_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_convert_map_from_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_action)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4sage_9structure_6parent_6Parent_get_action *__pyx_optional_args);
  PyObject *(*_get_action_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
  PyObject *(*coerce)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*an_element)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int __pyx_skip_dispatch);
  PyObject *(*_an_element_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int __pyx_skip_dispatch);
  PyObject *(*_generic_convert_map)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*discover_coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *);
  PyObject *(*discover_convert_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *);
  PyObject *(*discover_action)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, PyObject *, int);
};
static struct __pyx_vtabstruct_4sage_9structure_6parent_Parent *__pyx_vtabptr_4sage_9structure_6parent_Parent;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_old.pxd":10
 * 
 * cimport parent
 * cdef class Parent(parent.Parent):             # <<<<<<<<<<<<<<
 * 
 *     # returns a Morphism from S to self, or None
 */

struct __pyx_vtabstruct_4sage_9structure_10parent_old_Parent {
  struct __pyx_vtabstruct_4sage_9structure_6parent_Parent __pyx_base;
  PyObject *(*coerce_map_from_c)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*coerce_map_from_c_impl)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *);
  PyObject *(*get_action_c)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
  PyObject *(*get_action_c_impl)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *, PyObject *, int);
  PyObject *(*has_coerce_map_from_c)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*has_coerce_map_from_c_impl)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *);
  PyObject *(*_coerce_c)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_coerce_c_impl)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *);
  PyObject *(*_coerce_self_c)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *);
  PyObject *(*_an_element_c_impl)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *);
  PyObject *(*_an_element_c)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, int __pyx_skip_dispatch);
  PyObject *(*_richcmp)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, PyObject *, int);
  int (*_cmp_c_impl)(struct __pyx_obj_4sage_9structure_10parent_old_Parent *, struct __pyx_obj_4sage_9structure_6parent_Parent *);
};
static struct __pyx_vtabstruct_4sage_9structure_10parent_old_Parent *__pyx_vtabptr_4sage_9structure_10parent_old_Parent;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_base.pxd":11
 * cimport parent_old
 * 
 * cdef class ParentWithBase(parent_old.Parent):             # <<<<<<<<<<<<<<
 *     pass
 */

struct __pyx_vtabstruct_4sage_9structure_11parent_base_ParentWithBase {
  struct __pyx_vtabstruct_4sage_9structure_10parent_old_Parent __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_11parent_base_ParentWithBase *__pyx_vtabptr_4sage_9structure_11parent_base_ParentWithBase;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_gens.pxd":15
 * cimport parent_base
 * 
 * cdef class ParentWithGens(parent_base.ParentWithBase):             # <<<<<<<<<<<<<<
 *     cdef public object _gens
 *     cdef public object _gens_dict
 */

struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithGens {
  struct __pyx_vtabstruct_4sage_9structure_11parent_base_ParentWithBase __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithGens *__pyx_vtabptr_4sage_9structure_11parent_gens_ParentWithGens;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":3
 * from sage.structure.parent_gens cimport ParentWithGens
 * 
 * cdef class Ring(ParentWithGens):             # <<<<<<<<<<<<<<
 *     cdef public object _zero_element
 *     cdef public object _one_element
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_Ring {
  struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithGens __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_Ring *__pyx_vtabptr_4sage_5rings_4ring_Ring;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":10
 *     cdef _an_element_c_impl(self)
 * 
 * cdef class CommutativeRing(Ring):             # <<<<<<<<<<<<<<
 *     cdef public object __fraction_field
 *     cdef public object __ideal_monoid
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_CommutativeRing {
  struct __pyx_vtabstruct_4sage_5rings_4ring_Ring __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_CommutativeRing *__pyx_vtabptr_4sage_5rings_4ring_CommutativeRing;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":14
 *     cdef public object __ideal_monoid
 * 
 * cdef class IntegralDomain(CommutativeRing):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_IntegralDomain {
  struct __pyx_vtabstruct_4sage_5rings_4ring_CommutativeRing __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_IntegralDomain *__pyx_vtabptr_4sage_5rings_4ring_IntegralDomain;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":67
 *     cpdef RingElement _idiv_(self, RingElement right)
 * 
 * cdef class CommutativeRingElement(RingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_RingElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement *__pyx_vtabptr_4sage_9structure_7element_CommutativeRingElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/polynomial/multi_polynomial.pxd":3
 * from sage.structure.element cimport CommutativeRingElement
 * 
 * cdef class MPolynomial(CommutativeRingElement):             # <<<<<<<<<<<<<<
 *     cdef long _hash_c(self)
 */

struct __pyx_vtabstruct_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial {
  struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement __pyx_base;
  long (*_hash_c)(struct __pyx_obj_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial *);
};
static struct __pyx_vtabstruct_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial *__pyx_vtabptr_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/polynomial/multi_polynomial_libsingular.pxd":7
 * from sage.structure.parent cimport Parent
 * 
 * cdef class MPolynomial_libsingular(MPolynomial):             # <<<<<<<<<<<<<<
 *     cdef poly *_poly
 *     cpdef _repr_short_(self)
 */

struct __pyx_vtabstruct_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular {
  struct __pyx_vtabstruct_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial __pyx_base;
  PyObject *(*_repr_short_)(struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *, int __pyx_skip_dispatch);
  PyObject *(*is_constant)(struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *, int __pyx_skip_dispatch);
  PyObject *(*_homogenize)(struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *, int, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *__pyx_vtabptr_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":56
 * 
 * 
 * cdef class AdditiveGroupElement(ModuleElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_AdditiveGroupElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_AdditiveGroupElement *__pyx_vtabptr_4sage_9structure_7element_AdditiveGroupElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":3
 * from sage.structure.sage_object cimport SageObject
 * 
 * cdef class Generators(SageObject):             # <<<<<<<<<<<<<<
 * 
 *     cdef readonly _obj
 */

struct __pyx_vtabstruct_4sage_9structure_10generators_Generators {
  PyObject *(*get_from_index)(struct __pyx_obj_4sage_9structure_10generators_Generators *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*index_set)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch);
  PyObject *(*category)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch);
  PyObject *(*obj)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch);
  PyObject *(*count)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch);
  PyObject *(*list)(struct __pyx_obj_4sage_9structure_10generators_Generators *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4sage_9structure_10generators_Generators *__pyx_vtabptr_4sage_9structure_10generators_Generators;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":28
 *     pass
 * 
 * cdef class Generators_lazy_all(Generators):             # <<<<<<<<<<<<<<
 *     cdef _f
 *     cdef int _compute_gens(self) except -1
 */

struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_lazy_all {
  struct __pyx_vtabstruct_4sage_9structure_10generators_Generators __pyx_base;
  int (*_compute_gens)(struct __pyx_obj_4sage_9structure_10generators_Generators_lazy_all *);
};
static struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_lazy_all *__pyx_vtabptr_4sage_9structure_10generators_Generators_lazy_all;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":82
 *     pass
 * 
 * cdef class FieldElement(CommutativeRingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_FieldElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_FieldElement *__pyx_vtabptr_4sage_9structure_7element_FieldElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":85
 *     pass
 * 
 * cdef class FiniteFieldElement(FieldElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_FiniteFieldElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_FieldElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_FiniteFieldElement *__pyx_vtabptr_4sage_9structure_7element_FiniteFieldElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_gens.pxd":22
 * 
 * 
 * cdef class ParentWithMultiplicativeAbelianGens(ParentWithGens):             # <<<<<<<<<<<<<<
 *     cdef public object _generator_orders
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens {
  struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithGens __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens *__pyx_vtabptr_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":70
 *     pass
 * 
 * cdef class IntegralDomainElement(CommutativeRingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_IntegralDomainElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_IntegralDomainElement *__pyx_vtabptr_4sage_9structure_7element_IntegralDomainElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":73
 *     pass
 * 
 * cdef class DedekindDomainElement(IntegralDomainElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_DedekindDomainElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_IntegralDomainElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_DedekindDomainElement *__pyx_vtabptr_4sage_9structure_7element_DedekindDomainElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":76
 *     pass
 * 
 * cdef class PrincipalIdealDomainElement(DedekindDomainElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_PrincipalIdealDomainElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_DedekindDomainElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_PrincipalIdealDomainElement *__pyx_vtabptr_4sage_9structure_7element_PrincipalIdealDomainElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":91
 *     pass
 * 
 * cdef class CommutativeAlgebraElement(CommutativeRingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeAlgebraElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeAlgebraElement *__pyx_vtabptr_4sage_9structure_7element_CommutativeAlgebraElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":79
 *     pass
 * 
 * cdef class EuclideanDomainElement(PrincipalIdealDomainElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_EuclideanDomainElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_PrincipalIdealDomainElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_EuclideanDomainElement *__pyx_vtabptr_4sage_9structure_7element_EuclideanDomainElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":49
 *     cdef RingElement coerce_to_base_ring(self, x)
 * 
 * cdef class MonoidElement(Element):             # <<<<<<<<<<<<<<
 *     cpdef MonoidElement _mul_(self, MonoidElement right)
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_MonoidElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_Element __pyx_base;
  struct __pyx_obj_4sage_9structure_7element_MonoidElement *(*_mul_)(struct __pyx_obj_4sage_9structure_7element_MonoidElement *, struct __pyx_obj_4sage_9structure_7element_MonoidElement *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4sage_9structure_7element_MonoidElement *__pyx_vtabptr_4sage_9structure_7element_MonoidElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":52
 *     cpdef MonoidElement _mul_(self, MonoidElement right)
 * 
 * cdef class MultiplicativeGroupElement(MonoidElement):             # <<<<<<<<<<<<<<
 *     cpdef MultiplicativeGroupElement _div_(self, MultiplicativeGroupElement right)
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_MultiplicativeGroupElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_MonoidElement __pyx_base;
  struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement *(*_div_)(struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement *, struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4sage_9structure_7element_MultiplicativeGroupElement *__pyx_vtabptr_4sage_9structure_7element_MultiplicativeGroupElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":21
 * 
 * 
 * cdef class PrincipalIdealDomain(IntegralDomain):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_PrincipalIdealDomain {
  struct __pyx_vtabstruct_4sage_5rings_4ring_IntegralDomain __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_PrincipalIdealDomain *__pyx_vtabptr_4sage_5rings_4ring_PrincipalIdealDomain;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":24
 *     pass
 * 
 * cdef class EuclideanDomain(PrincipalIdealDomain):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_EuclideanDomain {
  struct __pyx_vtabstruct_4sage_5rings_4ring_PrincipalIdealDomain __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_EuclideanDomain *__pyx_vtabptr_4sage_5rings_4ring_EuclideanDomain;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":25
 *     pass
 * 
 * cdef class Generators_none(Generators):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_none {
  struct __pyx_vtabstruct_4sage_9structure_10generators_Generators __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_none *__pyx_vtabptr_4sage_9structure_10generators_Generators_none;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":40
 *     pass
 * 
 * cdef class CommutativeAlgebra(CommutativeRing):             # <<<<<<<<<<<<<<
 *     pass
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_CommutativeAlgebra {
  struct __pyx_vtabstruct_4sage_5rings_4ring_CommutativeRing __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_CommutativeAlgebra *__pyx_vtabptr_4sage_5rings_4ring_CommutativeAlgebra;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":27
 *     pass
 * 
 * cdef class Field(PrincipalIdealDomain):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_Field {
  struct __pyx_vtabstruct_4sage_5rings_4ring_PrincipalIdealDomain __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_Field *__pyx_vtabptr_4sage_5rings_4ring_Field;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":30
 *     pass
 * 
 * cdef class FiniteField(Field):             # <<<<<<<<<<<<<<
 *     cdef public object __multiplicative_generator
 *     cdef public object __polynomial_ring
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_FiniteField {
  struct __pyx_vtabstruct_4sage_5rings_4ring_Field __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_FiniteField *__pyx_vtabptr_4sage_5rings_4ring_FiniteField;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":101
 * 
 * 
 * cdef class Vector(ModuleElement):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t _degree
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_Vector {
  struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement __pyx_base;
  struct __pyx_obj_4sage_9structure_7element_Element *(*_dot_product_)(struct __pyx_obj_4sage_9structure_7element_Vector *, struct __pyx_obj_4sage_9structure_7element_Vector *, int __pyx_skip_dispatch);
  struct __pyx_obj_4sage_9structure_7element_Vector *(*_pairwise_product_)(struct __pyx_obj_4sage_9structure_7element_Vector *, struct __pyx_obj_4sage_9structure_7element_Vector *, int __pyx_skip_dispatch);
  int (*is_sparse_c)(struct __pyx_obj_4sage_9structure_7element_Vector *);
  int (*is_dense_c)(struct __pyx_obj_4sage_9structure_7element_Vector *);
};
static struct __pyx_vtabstruct_4sage_9structure_7element_Vector *__pyx_vtabptr_4sage_9structure_7element_Vector;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":16
 *     cpdef list(self)
 * 
 * cdef class Generators_finite(Generators):             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t _n
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_finite {
  struct __pyx_vtabstruct_4sage_9structure_10generators_Generators __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_finite *__pyx_vtabptr_4sage_9structure_10generators_Generators_finite;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":19
 *     cdef Py_ssize_t _n
 * 
 * cdef class Generators_list(Generators_finite):             # <<<<<<<<<<<<<<
 *     cdef _List
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_list {
  struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_finite __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_list *__pyx_vtabptr_4sage_9structure_10generators_Generators_list;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":128
 * 
 * 
 * cdef class CoercionModel:             # <<<<<<<<<<<<<<
 *     cpdef canonical_coercion(self, x, y)
 *     cpdef bin_op(self, x, y, op)
 */

struct __pyx_vtabstruct_4sage_9structure_7element_CoercionModel {
  PyObject *(*canonical_coercion)(struct __pyx_obj_4sage_9structure_7element_CoercionModel *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*bin_op)(struct __pyx_obj_4sage_9structure_7element_CoercionModel *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_4sage_9structure_7element_CoercionModel *__pyx_vtabptr_4sage_9structure_7element_CoercionModel;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/polynomial/multi_polynomial_ring_generic.pxd":6
 * from sage.structure.parent cimport Parent
 * 
 * cdef class MPolynomialRing_generic(sage.rings.ring.CommutativeRing):             # <<<<<<<<<<<<<<
 *     cdef object __ngens
 *     cdef object __term_order
 */

struct __pyx_vtabstruct_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic {
  struct __pyx_vtabstruct_4sage_5rings_4ring_CommutativeRing __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic *__pyx_vtabptr_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/polynomial/multi_polynomial_libsingular.pxd":13
 *     cpdef _homogenize(self, int var)
 * 
 * cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):             # <<<<<<<<<<<<<<
 *     cdef object __singular
 *     cdef object __macaulay2
 */

struct __pyx_vtabstruct_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular {
  struct __pyx_vtabstruct_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular *__pyx_vtabptr_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":37
 *     cdef public object _kwargs
 * 
 * cdef class Algebra(Ring):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_Algebra {
  struct __pyx_vtabstruct_4sage_5rings_4ring_Ring __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_Algebra *__pyx_vtabptr_4sage_5rings_4ring_Algebra;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":88
 *     pass
 * 
 * cdef class AlgebraElement(RingElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_AlgebraElement {
  struct __pyx_vtabstruct_4sage_9structure_7element_RingElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_AlgebraElement *__pyx_vtabptr_4sage_9structure_7element_AlgebraElement;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":113
 * 
 * 
 * cdef class Matrix(AlgebraElement):             # <<<<<<<<<<<<<<
 *     # All matrix classes must be written in Cython
 *     cdef Py_ssize_t _nrows
 */

struct __pyx_vtabstruct_4sage_9structure_7element_Matrix {
  struct __pyx_vtabstruct_4sage_9structure_7element_AlgebraElement __pyx_base;
  struct __pyx_obj_4sage_9structure_7element_Vector *(*_vector_times_matrix_)(struct __pyx_obj_4sage_9structure_7element_Matrix *, struct __pyx_obj_4sage_9structure_7element_Vector *);
  struct __pyx_obj_4sage_9structure_7element_Vector *(*_matrix_times_vector_)(struct __pyx_obj_4sage_9structure_7element_Matrix *, struct __pyx_obj_4sage_9structure_7element_Vector *);
  struct __pyx_obj_4sage_9structure_7element_Matrix *(*_matrix_times_matrix_)(struct __pyx_obj_4sage_9structure_7element_Matrix *, struct __pyx_obj_4sage_9structure_7element_Matrix *);
  int (*is_sparse_c)(struct __pyx_obj_4sage_9structure_7element_Matrix *);
  int (*is_dense_c)(struct __pyx_obj_4sage_9structure_7element_Matrix *);
};
static struct __pyx_vtabstruct_4sage_9structure_7element_Matrix *__pyx_vtabptr_4sage_9structure_7element_Matrix;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":94
 *     pass
 * 
 * cdef class CommutativeAlgebra(AlgebraElement):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeAlgebra {
  struct __pyx_vtabstruct_4sage_9structure_7element_AlgebraElement __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeAlgebra *__pyx_vtabptr_4sage_9structure_7element_CommutativeAlgebra;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/generators.pxd":22
 *     cdef _List
 * 
 * cdef class Generators_naturals(Generators):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_naturals {
  struct __pyx_vtabstruct_4sage_9structure_10generators_Generators __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_10generators_Generators_naturals *__pyx_vtabptr_4sage_9structure_10generators_Generators_naturals;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/rings/ring.pxd":17
 *     pass
 * 
 * cdef class DedekindDomain(IntegralDomain):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

struct __pyx_vtabstruct_4sage_5rings_4ring_DedekindDomain {
  struct __pyx_vtabstruct_4sage_5rings_4ring_IntegralDomain __pyx_base;
};
static struct __pyx_vtabstruct_4sage_5rings_4ring_DedekindDomain *__pyx_vtabptr_4sage_5rings_4ring_DedekindDomain;


/* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/parent_gens.pxd":25
 *     cdef public object _generator_orders
 * 
 * cdef class ParentWithAdditiveAbelianGens(ParentWithGens):             # <<<<<<<<<<<<<<
 *     cdef public object _generator_orders
 */

struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens {
  struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithGens __pyx_base;
};
static struct __pyx_vtabstruct_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens *__pyx_vtabptr_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens;

#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif

#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
  end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
  }
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
  #define __Pyx_RefNannySetupContext(name)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)

static INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (PyList_Append(L, x) < 0) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    }
    else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}

static int __Pyx_Print(PyObject *, int); /*proto*/
#if PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject *o); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static INLINE char __Pyx_PyInt_AsChar(PyObject *);

static INLINE short __Pyx_PyInt_AsShort(PyObject *);

static INLINE int __Pyx_PyInt_AsInt(PyObject *);

static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static INLINE long __Pyx_PyInt_AsLong(PyObject *);

static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static void __Pyx_WriteUnraisable(const char *name); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/

static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*proto*/

static void __Pyx_AddTraceback(const char *funcname); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from sage.libs.gmp.types */

/* Module declarations from sage.libs.gmp.random */

/* Module declarations from sage.libs.gmp.mpz */

/* Module declarations from sage.libs.gmp.mpq */

/* Module declarations from sage.libs.gmp.all */

/* Module declarations from sage.libs.singular.decl */

/* Module declarations from sage.structure.sage_object */

static PyTypeObject *__pyx_ptype_4sage_9structure_11sage_object_SageObject = 0;
/* Module declarations from sage.structure.generators */

static PyTypeObject *__pyx_ptype_4sage_9structure_10generators_Generators = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_10generators_Generators_finite = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_10generators_Generators_list = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_10generators_Generators_naturals = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_10generators_Generators_none = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_10generators_Generators_lazy_all = 0;
/* Module declarations from sage.structure.category_object */

static PyTypeObject *__pyx_ptype_4sage_9structure_15category_object_CategoryObject = 0;
/* Module declarations from sage.structure */

/* Module declarations from sage.structure.parent */

static PyTypeObject *__pyx_ptype_4sage_9structure_6parent_Parent = 0;
/* Module declarations from sage.structure.parent_old */

static PyTypeObject *__pyx_ptype_4sage_9structure_10parent_old_Parent = 0;
/* Module declarations from sage.structure.parent_base */

static PyTypeObject *__pyx_ptype_4sage_9structure_11parent_base_ParentWithBase = 0;
/* Module declarations from sage.structure.parent_gens */

static PyTypeObject *__pyx_ptype_4sage_9structure_11parent_gens_ParentWithGens = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens = 0;
/* Module declarations from sage.rings.ring */

static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_Ring = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_CommutativeRing = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_IntegralDomain = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_DedekindDomain = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_PrincipalIdealDomain = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_EuclideanDomain = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_Field = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_FiniteField = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_Algebra = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_4ring_CommutativeAlgebra = 0;
/* Module declarations from sage.rings */

/* Module declarations from sage */

/* Module declarations from sage.structure.element */

static PyTypeObject *__pyx_ptype_4sage_9structure_7element_Element = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_ModuleElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_RingElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_MonoidElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_MultiplicativeGroupElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_AdditiveGroupElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_CommutativeRingElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_IntegralDomainElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_DedekindDomainElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_PrincipalIdealDomainElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_EuclideanDomainElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_FieldElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_FiniteFieldElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_AlgebraElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_CommutativeAlgebraElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_CommutativeAlgebra = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_InfinityElement = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_Vector = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_Matrix = 0;
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_CoercionModel = 0;
static PyObject *(*__pyx_f_4sage_9structure_7element_generic_power_c)(PyObject *, PyObject *, PyObject *); /*proto*/
/* Module declarations from sage.rings.polynomial.multi_polynomial */

static PyTypeObject *__pyx_ptype_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial = 0;
/* Module declarations from sage.rings.polynomial.multi_polynomial_ring_generic */

static PyTypeObject *__pyx_ptype_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic = 0;
/* Module declarations from sage.rings.polynomial.multi_polynomial_libsingular */

static PyTypeObject *__pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular = 0;
static PyTypeObject *__pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular = 0;
static struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *(*__pyx_f_4sage_5rings_10polynomial_28multi_polynomial_libsingular_new_MP)(struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular *, polyrec *); /*proto*/
/* Module declarations from sage.rings.polynomial.multi_polynomial_ideal_libsingular */

static PyObject *(*__pyx_f_4sage_5rings_10polynomial_34multi_polynomial_ideal_libsingular_singular_ideal_to_sage_sequence)(ip_sideal *, ip_sring *, PyObject *); /*proto*/
static ip_sideal *(*__pyx_f_4sage_5rings_10polynomial_34multi_polynomial_ideal_libsingular_sage_ideal_to_singular_ideal)(PyObject *); /*proto*/
/* Module declarations from sage_link */

#define __Pyx_MODULE_NAME "sage_link"
int __pyx_module_is_main_sage_link = 0;

/* Implementation of sage_link */
static PyObject *__pyx_builtin_NotImplementedError;
static char __pyx_k_1[] = "called python!";
static char __pyx_k_2[] = "only polynomials over the rationals are supported for now";
static char __pyx_k_3[] = "getNumberOfVariables";
static char __pyx_k_4[] = "ring is:";
static char __pyx_k_5[] = "converting polynomial";
static char __pyx_k_6[] = "converted polynomials to:";
static char __pyx_k_7[] = "Result from singular:";
static char __pyx_k_8[] = "loading module";
static char __pyx_k_9[] = "sage.rings.polynomial.polynomial_ring_constructor";
static char __pyx_k_10[] = "sage.rings.rational_field";
static char __pyx_k_11[] = "sage.libs.singular";
static char __pyx_k__x[] = "x";
static char __pyx_k__QQ[] = "QQ";
static char __pyx_k__ff[] = "ff";
static char __pyx_k__end[] = "end";
static char __pyx_k__inc[] = "inc";
static char __pyx_k__obj[] = "obj";
static char __pyx_k__libs[] = "libs";
static char __pyx_k__sage[] = "sage";
static char __pyx_k___poly[] = "_poly";
static char __pyx_k__begin[] = "begin";
static char __pyx_k__ideal[] = "ideal";
static char __pyx_k___parent[] = "_parent";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__getField[] = "getField";
static char __pyx_k__singular[] = "singular";
static char __pyx_k__minAssGTZ[] = "minAssGTZ";
static char __pyx_k__push_back[] = "push_back";
static char __pyx_k__isRationals[] = "isRationals";
static char __pyx_k__is_not_equal[] = "is_not_equal";
static char __pyx_k__primdec__lib[] = "primdec__lib";
static char __pyx_k__PolynomialRing[] = "PolynomialRing";
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_n_s_10;
static PyObject *__pyx_n_s_11;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_n_s_3;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_kp_s_7;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_n_s_9;
static PyObject *__pyx_n_s__NotImplementedError;
static PyObject *__pyx_n_s__PolynomialRing;
static PyObject *__pyx_n_s__QQ;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___parent;
static PyObject *__pyx_n_s___poly;
static PyObject *__pyx_n_s__begin;
static PyObject *__pyx_n_s__end;
static PyObject *__pyx_n_s__ff;
static PyObject *__pyx_n_s__getField;
static PyObject *__pyx_n_s__ideal;
static PyObject *__pyx_n_s__inc;
static PyObject *__pyx_n_s__isRationals;
static PyObject *__pyx_n_s__is_not_equal;
static PyObject *__pyx_n_s__libs;
static PyObject *__pyx_n_s__minAssGTZ;
static PyObject *__pyx_n_s__obj;
static PyObject *__pyx_n_s__primdec__lib;
static PyObject *__pyx_n_s__push_back;
static PyObject *__pyx_n_s__sage;
static PyObject *__pyx_n_s__singular;
static PyObject *__pyx_n_s__x;

/* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":64
 * minAssGTZ = sage.libs.singular.ff.primdec__lib.minAssGTZ
 * 
 * cdef public void minimal_associated_primes(GFanPolynomialSetList* res,             # <<<<<<<<<<<<<<
 *         GFanPolynomialRing* gf_ring,
 *         GFanPolynomialSet* ideal_generators):
 */

__PYX_EXTERN_C  void minimal_associated_primes(std::list<PolynomialSet> *__pyx_v_res, PolynomialRing *__pyx_v_gf_ring, std::list<Polynomial> *__pyx_v_ideal_generators) {
  PyObject *__pyx_v_R;
  PyObject *__pyx_v_l;
  std::list<Polynomial>::const_iterator __pyx_v_itr;
  std::list<Polynomial>::const_iterator __pyx_v_gens_end;
  struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *__pyx_v_c_sage_poly;
  PyObject *__pyx_v_py_res;
  PyObject *__pyx_v_i;
  PyObject *__pyx_v_I;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  ip_sideal *__pyx_t_7;
  __Pyx_RefNannySetupContext("minimal_associated_primes");
  __pyx_v_R = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_c_sage_poly = ((struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_py_res = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_I = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":67
 *         GFanPolynomialRing* gf_ring,
 *         GFanPolynomialSet* ideal_generators):
 *     print "called python!"             # <<<<<<<<<<<<<<
 * 
 *     if not gf_ring.getField().isRationals():
 */
  if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":69
 *     print "called python!"
 * 
 *     if not gf_ring.getField().isRationals():             # <<<<<<<<<<<<<<
 *         raise NotImplementedError, "only polynomials over the rationals are supported for now"
 * 
 */
  __pyx_t_1 = (!__pyx_v_gf_ring->getField().isRationals());
  if (__pyx_t_1) {

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":70
 * 
 *     if not gf_ring.getField().isRationals():
 *         raise NotImplementedError, "only polynomials over the rationals are supported for now"             # <<<<<<<<<<<<<<
 * 
 *     # create a Sage ring
 */
    __Pyx_Raise(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_kp_s_2), 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":73
 * 
 *     # create a Sage ring
 *     R = PolynomialRing(QQ, 'x', gf_ring[0].getNumberOfVariables())             # <<<<<<<<<<<<<<
 *     print "ring is:",R
 *     l = []
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__PolynomialRing); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__QQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromLong((__pyx_v_gf_ring[0]).getNumberOfVariables()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__x));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__x));
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_v_R);
  __pyx_v_R = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":74
 *     # create a Sage ring
 *     R = PolynomialRing(QQ, 'x', gf_ring[0].getNumberOfVariables())
 *     print "ring is:",R             # <<<<<<<<<<<<<<
 *     l = []
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
  __Pyx_INCREF(__pyx_v_R);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_R);
  __Pyx_GIVEREF(__pyx_v_R);
  if (__Pyx_Print(__pyx_t_4, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":75
 *     R = PolynomialRing(QQ, 'x', gf_ring[0].getNumberOfVariables())
 *     print "ring is:",R
 *     l = []             # <<<<<<<<<<<<<<
 * 
 *     # convert the polynomials
 */
  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(__pyx_v_l);
  __pyx_v_l = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":78
 * 
 *     # convert the polynomials
 *     cdef GFanPolynomialSetIter itr = ideal_generators[0].begin()             # <<<<<<<<<<<<<<
 *     cdef GFanPolynomialSetIter gens_end = ideal_generators[0].end()
 *     cdef MPolynomial_libsingular c_sage_poly
 */
  __pyx_v_itr = (__pyx_v_ideal_generators[0]).begin();

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":79
 *     # convert the polynomials
 *     cdef GFanPolynomialSetIter itr = ideal_generators[0].begin()
 *     cdef GFanPolynomialSetIter gens_end = ideal_generators[0].end()             # <<<<<<<<<<<<<<
 *     cdef MPolynomial_libsingular c_sage_poly
 *     while itr.is_not_equal(gens_end):
 */
  __pyx_v_gens_end = (__pyx_v_ideal_generators[0]).end();

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":81
 *     cdef GFanPolynomialSetIter gens_end = ideal_generators[0].end()
 *     cdef MPolynomial_libsingular c_sage_poly
 *     while itr.is_not_equal(gens_end):             # <<<<<<<<<<<<<<
 *         print "converting polynomial"
 *         c_sage_poly = PY_NEW(MPolynomial_libsingular)
 */
  while (1) {
    __pyx_t_1 = __pyx_v_itr.operator!=(__pyx_v_gens_end);
    if (!__pyx_t_1) break;

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":82
 *     cdef MPolynomial_libsingular c_sage_poly
 *     while itr.is_not_equal(gens_end):
 *         print "converting polynomial"             # <<<<<<<<<<<<<<
 *         c_sage_poly = PY_NEW(MPolynomial_libsingular)
 *         c_sage_poly._parent = <ParentWithBase>R
 */
    if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":83
 *     while itr.is_not_equal(gens_end):
 *         print "converting polynomial"
 *         c_sage_poly = PY_NEW(MPolynomial_libsingular)             # <<<<<<<<<<<<<<
 *         c_sage_poly._parent = <ParentWithBase>R
 *         c_sage_poly._poly = singularPolynomial(itr.obj()) # FIXME
 */
    __pyx_t_4 = PY_NEW(((PyObject *)((PyObject*)__pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_c_sage_poly));
    __pyx_v_c_sage_poly = ((struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":84
 *         print "converting polynomial"
 *         c_sage_poly = PY_NEW(MPolynomial_libsingular)
 *         c_sage_poly._parent = <ParentWithBase>R             # <<<<<<<<<<<<<<
 *         c_sage_poly._poly = singularPolynomial(itr.obj()) # FIXME
 *         l.append(c_sage_poly)
 */
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4sage_9structure_11parent_base_ParentWithBase *)__pyx_v_R)));
    __Pyx_GIVEREF(__pyx_v_R);
    __Pyx_GOTREF(__pyx_v_c_sage_poly->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._parent);
    __Pyx_DECREF(((PyObject *)__pyx_v_c_sage_poly->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._parent));
    __pyx_v_c_sage_poly->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_base._parent = ((struct __pyx_obj_4sage_9structure_6parent_Parent *)__pyx_v_R);

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":85
 *         c_sage_poly = PY_NEW(MPolynomial_libsingular)
 *         c_sage_poly._parent = <ParentWithBase>R
 *         c_sage_poly._poly = singularPolynomial(itr.obj()) # FIXME             # <<<<<<<<<<<<<<
 *         l.append(c_sage_poly)
 *         itr.inc()
 */
    __pyx_v_c_sage_poly->_poly = singularPolynomial(__pyx_v_itr.operator*());

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":86
 *         c_sage_poly._parent = <ParentWithBase>R
 *         c_sage_poly._poly = singularPolynomial(itr.obj()) # FIXME
 *         l.append(c_sage_poly)             # <<<<<<<<<<<<<<
 *         itr.inc()
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_l, ((PyObject *)__pyx_v_c_sage_poly)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":87
 *         c_sage_poly._poly = singularPolynomial(itr.obj()) # FIXME
 *         l.append(c_sage_poly)
 *         itr.inc()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_v_itr.operator++();
  }

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":90
 * 
 * 
 *     print "converted polynomials to:",l             # <<<<<<<<<<<<<<
 *     py_res = minAssGTZ(R.ideal(l))
 *     print "Result from singular:",py_res
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_INCREF(__pyx_v_l);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_l);
  __Pyx_GIVEREF(__pyx_v_l);
  if (__Pyx_Print(__pyx_t_4, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":91
 * 
 *     print "converted polynomials to:",l
 *     py_res = minAssGTZ(R.ideal(l))             # <<<<<<<<<<<<<<
 *     print "Result from singular:",py_res
 * 
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__minAssGTZ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_R, __pyx_n_s__ideal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_l);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_l);
  __Pyx_GIVEREF(__pyx_v_l);
  __pyx_t_3 = PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_py_res);
  __pyx_v_py_res = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":92
 *     print "converted polynomials to:",l
 *     py_res = minAssGTZ(R.ideal(l))
 *     print "Result from singular:",py_res             # <<<<<<<<<<<<<<
 * 
 *     for i in py_res:
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_7));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7));
  __Pyx_INCREF(__pyx_v_py_res);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_py_res);
  __Pyx_GIVEREF(__pyx_v_py_res);
  if (__Pyx_Print(__pyx_t_3, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":94
 *     print "Result from singular:",py_res
 * 
 *     for i in py_res:             # <<<<<<<<<<<<<<
 *         I = R.ideal(i)
 *         res.push_back(fromSingularIdeal(gf_ring[0],
 */
  if (PyList_CheckExact(__pyx_v_py_res) || PyTuple_CheckExact(__pyx_v_py_res)) {
    __pyx_t_6 = 0; __pyx_t_3 = __pyx_v_py_res; __Pyx_INCREF(__pyx_t_3);
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_py_res); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_3))) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
      if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++;
    } else {
      __pyx_t_2 = PyIter_Next(__pyx_t_3);
      if (!__pyx_t_2) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":95
 * 
 *     for i in py_res:
 *         I = R.ideal(i)             # <<<<<<<<<<<<<<
 *         res.push_back(fromSingularIdeal(gf_ring[0],
 *             sage_ideal_to_singular_ideal(I)))
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_R, __pyx_n_s__ideal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_i);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_v_I);
    __pyx_v_I = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":97
 *         I = R.ideal(i)
 *         res.push_back(fromSingularIdeal(gf_ring[0],
 *             sage_ideal_to_singular_ideal(I)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_7 = __pyx_f_4sage_5rings_10polynomial_34multi_polynomial_ideal_libsingular_sage_ideal_to_singular_ideal(__pyx_v_I); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_res->push_back(fromSingularIdeal((__pyx_v_gf_ring[0]), __pyx_t_7));
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("sage_link.minimal_associated_primes");
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_R);
  __Pyx_DECREF(__pyx_v_l);
  __Pyx_DECREF((PyObject *)__pyx_v_c_sage_poly);
  __Pyx_DECREF(__pyx_v_py_res);
  __Pyx_DECREF(__pyx_v_i);
  __Pyx_DECREF(__pyx_v_I);
  __Pyx_RefNannyFinishContext();
}

static struct PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("sage_link"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_n_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 1},
  {&__pyx_n_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 1},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_n_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 1},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
  {&__pyx_n_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 1},
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
  {&__pyx_n_s__PolynomialRing, __pyx_k__PolynomialRing, sizeof(__pyx_k__PolynomialRing), 0, 0, 1, 1},
  {&__pyx_n_s__QQ, __pyx_k__QQ, sizeof(__pyx_k__QQ), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___parent, __pyx_k___parent, sizeof(__pyx_k___parent), 0, 0, 1, 1},
  {&__pyx_n_s___poly, __pyx_k___poly, sizeof(__pyx_k___poly), 0, 0, 1, 1},
  {&__pyx_n_s__begin, __pyx_k__begin, sizeof(__pyx_k__begin), 0, 0, 1, 1},
  {&__pyx_n_s__end, __pyx_k__end, sizeof(__pyx_k__end), 0, 0, 1, 1},
  {&__pyx_n_s__ff, __pyx_k__ff, sizeof(__pyx_k__ff), 0, 0, 1, 1},
  {&__pyx_n_s__getField, __pyx_k__getField, sizeof(__pyx_k__getField), 0, 0, 1, 1},
  {&__pyx_n_s__ideal, __pyx_k__ideal, sizeof(__pyx_k__ideal), 0, 0, 1, 1},
  {&__pyx_n_s__inc, __pyx_k__inc, sizeof(__pyx_k__inc), 0, 0, 1, 1},
  {&__pyx_n_s__isRationals, __pyx_k__isRationals, sizeof(__pyx_k__isRationals), 0, 0, 1, 1},
  {&__pyx_n_s__is_not_equal, __pyx_k__is_not_equal, sizeof(__pyx_k__is_not_equal), 0, 0, 1, 1},
  {&__pyx_n_s__libs, __pyx_k__libs, sizeof(__pyx_k__libs), 0, 0, 1, 1},
  {&__pyx_n_s__minAssGTZ, __pyx_k__minAssGTZ, sizeof(__pyx_k__minAssGTZ), 0, 0, 1, 1},
  {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
  {&__pyx_n_s__primdec__lib, __pyx_k__primdec__lib, sizeof(__pyx_k__primdec__lib), 0, 0, 1, 1},
  {&__pyx_n_s__push_back, __pyx_k__push_back, sizeof(__pyx_k__push_back), 0, 0, 1, 1},
  {&__pyx_n_s__sage, __pyx_k__sage, sizeof(__pyx_k__sage), 0, 0, 1, 1},
  {&__pyx_n_s__singular, __pyx_k__singular, sizeof(__pyx_k__singular), 0, 0, 1, 1},
  {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initsage_link(void); /*proto*/
PyMODINIT_FUNC initsage_link(void)
#else
PyMODINIT_FUNC PyInit_sage_link(void); /*proto*/
PyMODINIT_FUNC PyInit_sage_link(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  #if CYTHON_REFNANNY
  void* __pyx_refnanny = NULL;
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_sage_link(void)", __LINE__, __FILE__);
  #endif
  __pyx_init_filenames();
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("sage_link"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_sage_link) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  /*--- Type import code ---*/
  __pyx_ptype_4sage_9structure_11sage_object_SageObject = __Pyx_ImportType("sage.structure.sage_object", "SageObject", sizeof(struct __pyx_obj_4sage_9structure_11sage_object_SageObject)); if (unlikely(!__pyx_ptype_4sage_9structure_11sage_object_SageObject)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_10generators_Generators = __Pyx_ImportType("sage.structure.generators", "Generators", sizeof(struct __pyx_obj_4sage_9structure_10generators_Generators)); if (unlikely(!__pyx_ptype_4sage_9structure_10generators_Generators)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_10generators_Generators->tp_dict, &__pyx_vtabptr_4sage_9structure_10generators_Generators) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_10generators_Generators_finite = __Pyx_ImportType("sage.structure.generators", "Generators_finite", sizeof(struct __pyx_obj_4sage_9structure_10generators_Generators_finite)); if (unlikely(!__pyx_ptype_4sage_9structure_10generators_Generators_finite)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_10generators_Generators_finite->tp_dict, &__pyx_vtabptr_4sage_9structure_10generators_Generators_finite) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_10generators_Generators_list = __Pyx_ImportType("sage.structure.generators", "Generators_list", sizeof(struct __pyx_obj_4sage_9structure_10generators_Generators_list)); if (unlikely(!__pyx_ptype_4sage_9structure_10generators_Generators_list)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_10generators_Generators_list->tp_dict, &__pyx_vtabptr_4sage_9structure_10generators_Generators_list) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_10generators_Generators_naturals = __Pyx_ImportType("sage.structure.generators", "Generators_naturals", sizeof(struct __pyx_obj_4sage_9structure_10generators_Generators_naturals)); if (unlikely(!__pyx_ptype_4sage_9structure_10generators_Generators_naturals)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_10generators_Generators_naturals->tp_dict, &__pyx_vtabptr_4sage_9structure_10generators_Generators_naturals) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_10generators_Generators_none = __Pyx_ImportType("sage.structure.generators", "Generators_none", sizeof(struct __pyx_obj_4sage_9structure_10generators_Generators_none)); if (unlikely(!__pyx_ptype_4sage_9structure_10generators_Generators_none)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_10generators_Generators_none->tp_dict, &__pyx_vtabptr_4sage_9structure_10generators_Generators_none) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_10generators_Generators_lazy_all = __Pyx_ImportType("sage.structure.generators", "Generators_lazy_all", sizeof(struct __pyx_obj_4sage_9structure_10generators_Generators_lazy_all)); if (unlikely(!__pyx_ptype_4sage_9structure_10generators_Generators_lazy_all)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_10generators_Generators_lazy_all->tp_dict, &__pyx_vtabptr_4sage_9structure_10generators_Generators_lazy_all) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_15category_object_CategoryObject = __Pyx_ImportType("sage.structure.category_object", "CategoryObject", sizeof(struct __pyx_obj_4sage_9structure_15category_object_CategoryObject)); if (unlikely(!__pyx_ptype_4sage_9structure_15category_object_CategoryObject)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_6parent_Parent = __Pyx_ImportType("sage.structure.parent", "Parent", sizeof(struct __pyx_obj_4sage_9structure_6parent_Parent)); if (unlikely(!__pyx_ptype_4sage_9structure_6parent_Parent)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_6parent_Parent->tp_dict, &__pyx_vtabptr_4sage_9structure_6parent_Parent) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_10parent_old_Parent = __Pyx_ImportType("sage.structure.parent_old", "Parent", sizeof(struct __pyx_obj_4sage_9structure_10parent_old_Parent)); if (unlikely(!__pyx_ptype_4sage_9structure_10parent_old_Parent)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_10parent_old_Parent->tp_dict, &__pyx_vtabptr_4sage_9structure_10parent_old_Parent) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_11parent_base_ParentWithBase = __Pyx_ImportType("sage.structure.parent_base", "ParentWithBase", sizeof(struct __pyx_obj_4sage_9structure_11parent_base_ParentWithBase)); if (unlikely(!__pyx_ptype_4sage_9structure_11parent_base_ParentWithBase)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_11parent_base_ParentWithBase->tp_dict, &__pyx_vtabptr_4sage_9structure_11parent_base_ParentWithBase) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_11parent_gens_ParentWithGens = __Pyx_ImportType("sage.structure.parent_gens", "ParentWithGens", sizeof(struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithGens)); if (unlikely(!__pyx_ptype_4sage_9structure_11parent_gens_ParentWithGens)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_11parent_gens_ParentWithGens->tp_dict, &__pyx_vtabptr_4sage_9structure_11parent_gens_ParentWithGens) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens = __Pyx_ImportType("sage.structure.parent_gens", "ParentWithMultiplicativeAbelianGens", sizeof(struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens)); if (unlikely(!__pyx_ptype_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens->tp_dict, &__pyx_vtabptr_4sage_9structure_11parent_gens_ParentWithMultiplicativeAbelianGens) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens = __Pyx_ImportType("sage.structure.parent_gens", "ParentWithAdditiveAbelianGens", sizeof(struct __pyx_obj_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens)); if (unlikely(!__pyx_ptype_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens->tp_dict, &__pyx_vtabptr_4sage_9structure_11parent_gens_ParentWithAdditiveAbelianGens) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_Ring = __Pyx_ImportType("sage.rings.ring", "Ring", sizeof(struct __pyx_obj_4sage_5rings_4ring_Ring)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_Ring)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_Ring->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_Ring) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_CommutativeRing = __Pyx_ImportType("sage.rings.ring", "CommutativeRing", sizeof(struct __pyx_obj_4sage_5rings_4ring_CommutativeRing)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_CommutativeRing)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_CommutativeRing->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_CommutativeRing) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_IntegralDomain = __Pyx_ImportType("sage.rings.ring", "IntegralDomain", sizeof(struct __pyx_obj_4sage_5rings_4ring_IntegralDomain)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_IntegralDomain)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_IntegralDomain->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_IntegralDomain) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_DedekindDomain = __Pyx_ImportType("sage.rings.ring", "DedekindDomain", sizeof(struct __pyx_obj_4sage_5rings_4ring_DedekindDomain)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_DedekindDomain)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_DedekindDomain->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_DedekindDomain) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_PrincipalIdealDomain = __Pyx_ImportType("sage.rings.ring", "PrincipalIdealDomain", sizeof(struct __pyx_obj_4sage_5rings_4ring_PrincipalIdealDomain)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_PrincipalIdealDomain)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_PrincipalIdealDomain->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_PrincipalIdealDomain) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_EuclideanDomain = __Pyx_ImportType("sage.rings.ring", "EuclideanDomain", sizeof(struct __pyx_obj_4sage_5rings_4ring_EuclideanDomain)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_EuclideanDomain)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_EuclideanDomain->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_EuclideanDomain) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_Field = __Pyx_ImportType("sage.rings.ring", "Field", sizeof(struct __pyx_obj_4sage_5rings_4ring_Field)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_Field)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_Field->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_Field) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_FiniteField = __Pyx_ImportType("sage.rings.ring", "FiniteField", sizeof(struct __pyx_obj_4sage_5rings_4ring_FiniteField)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_FiniteField)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_FiniteField->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_FiniteField) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_Algebra = __Pyx_ImportType("sage.rings.ring", "Algebra", sizeof(struct __pyx_obj_4sage_5rings_4ring_Algebra)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_Algebra)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_Algebra->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_Algebra) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_4ring_CommutativeAlgebra = __Pyx_ImportType("sage.rings.ring", "CommutativeAlgebra", sizeof(struct __pyx_obj_4sage_5rings_4ring_CommutativeAlgebra)); if (unlikely(!__pyx_ptype_4sage_5rings_4ring_CommutativeAlgebra)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_4ring_CommutativeAlgebra->tp_dict, &__pyx_vtabptr_4sage_5rings_4ring_CommutativeAlgebra) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_Element = __Pyx_ImportType("sage.structure.element", "Element", sizeof(struct __pyx_obj_4sage_9structure_7element_Element)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_Element->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_Element) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_ModuleElement = __Pyx_ImportType("sage.structure.element", "ModuleElement", sizeof(struct __pyx_obj_4sage_9structure_7element_ModuleElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_ModuleElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_ModuleElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_ModuleElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_RingElement = __Pyx_ImportType("sage.structure.element", "RingElement", sizeof(struct __pyx_obj_4sage_9structure_7element_RingElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_RingElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_RingElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_RingElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_MonoidElement = __Pyx_ImportType("sage.structure.element", "MonoidElement", sizeof(struct __pyx_obj_4sage_9structure_7element_MonoidElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_MonoidElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_MonoidElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_MonoidElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_MultiplicativeGroupElement = __Pyx_ImportType("sage.structure.element", "MultiplicativeGroupElement", sizeof(struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_MultiplicativeGroupElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_MultiplicativeGroupElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_MultiplicativeGroupElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_AdditiveGroupElement = __Pyx_ImportType("sage.structure.element", "AdditiveGroupElement", sizeof(struct __pyx_obj_4sage_9structure_7element_AdditiveGroupElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_AdditiveGroupElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_AdditiveGroupElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_AdditiveGroupElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_CommutativeRingElement = __Pyx_ImportType("sage.structure.element", "CommutativeRingElement", sizeof(struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_CommutativeRingElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_CommutativeRingElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_CommutativeRingElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_IntegralDomainElement = __Pyx_ImportType("sage.structure.element", "IntegralDomainElement", sizeof(struct __pyx_obj_4sage_9structure_7element_IntegralDomainElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_IntegralDomainElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_IntegralDomainElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_IntegralDomainElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_DedekindDomainElement = __Pyx_ImportType("sage.structure.element", "DedekindDomainElement", sizeof(struct __pyx_obj_4sage_9structure_7element_DedekindDomainElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_DedekindDomainElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_DedekindDomainElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_DedekindDomainElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_PrincipalIdealDomainElement = __Pyx_ImportType("sage.structure.element", "PrincipalIdealDomainElement", sizeof(struct __pyx_obj_4sage_9structure_7element_PrincipalIdealDomainElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_PrincipalIdealDomainElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_PrincipalIdealDomainElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_PrincipalIdealDomainElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_EuclideanDomainElement = __Pyx_ImportType("sage.structure.element", "EuclideanDomainElement", sizeof(struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_EuclideanDomainElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_EuclideanDomainElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_EuclideanDomainElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_FieldElement = __Pyx_ImportType("sage.structure.element", "FieldElement", sizeof(struct __pyx_obj_4sage_9structure_7element_FieldElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_FieldElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_FieldElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_FieldElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_FiniteFieldElement = __Pyx_ImportType("sage.structure.element", "FiniteFieldElement", sizeof(struct __pyx_obj_4sage_9structure_7element_FiniteFieldElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_FiniteFieldElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_FiniteFieldElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_FiniteFieldElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_AlgebraElement = __Pyx_ImportType("sage.structure.element", "AlgebraElement", sizeof(struct __pyx_obj_4sage_9structure_7element_AlgebraElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_AlgebraElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_AlgebraElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_AlgebraElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_CommutativeAlgebraElement = __Pyx_ImportType("sage.structure.element", "CommutativeAlgebraElement", sizeof(struct __pyx_obj_4sage_9structure_7element_CommutativeAlgebraElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_CommutativeAlgebraElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_CommutativeAlgebraElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_CommutativeAlgebraElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_CommutativeAlgebra = __Pyx_ImportType("sage.structure.element", "CommutativeAlgebra", sizeof(struct __pyx_obj_4sage_9structure_7element_CommutativeAlgebra)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_CommutativeAlgebra)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_CommutativeAlgebra->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_CommutativeAlgebra) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_InfinityElement = __Pyx_ImportType("sage.structure.element", "InfinityElement", sizeof(struct __pyx_obj_4sage_9structure_7element_InfinityElement)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_InfinityElement)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_InfinityElement->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_InfinityElement) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_Vector = __Pyx_ImportType("sage.structure.element", "Vector", sizeof(struct __pyx_obj_4sage_9structure_7element_Vector)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_Vector)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_Vector->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_Vector) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_Matrix = __Pyx_ImportType("sage.structure.element", "Matrix", sizeof(struct __pyx_obj_4sage_9structure_7element_Matrix)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_Matrix)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_Matrix->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_Matrix) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_9structure_7element_CoercionModel = __Pyx_ImportType("sage.structure.element", "CoercionModel", sizeof(struct __pyx_obj_4sage_9structure_7element_CoercionModel)); if (unlikely(!__pyx_ptype_4sage_9structure_7element_CoercionModel)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_CoercionModel->tp_dict, &__pyx_vtabptr_4sage_9structure_7element_CoercionModel) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial = __Pyx_ImportType("sage.rings.polynomial.multi_polynomial", "MPolynomial", sizeof(struct __pyx_obj_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial)); if (unlikely(!__pyx_ptype_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial->tp_dict, &__pyx_vtabptr_4sage_5rings_10polynomial_16multi_polynomial_MPolynomial) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic = __Pyx_ImportType("sage.rings.polynomial.multi_polynomial_ring_generic", "MPolynomialRing_generic", sizeof(struct __pyx_obj_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic)); if (unlikely(!__pyx_ptype_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic->tp_dict, &__pyx_vtabptr_4sage_5rings_10polynomial_29multi_polynomial_ring_generic_MPolynomialRing_generic) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular = __Pyx_ImportType("sage.rings.polynomial.multi_polynomial_libsingular", "MPolynomial_libsingular", sizeof(struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular)); if (unlikely(!__pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular->tp_dict, &__pyx_vtabptr_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular = __Pyx_ImportType("sage.rings.polynomial.multi_polynomial_libsingular", "MPolynomialRing_libsingular", sizeof(struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular)); if (unlikely(!__pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_GetVtable(__pyx_ptype_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular->tp_dict, &__pyx_vtabptr_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Function import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("sage.structure.element"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_1, "generic_power_c", (void (**)(void))&__pyx_f_4sage_9structure_7element_generic_power_c, "PyObject *(PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __Pyx_ImportModule("sage.rings.polynomial.multi_polynomial_libsingular"); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_2, "new_MP", (void (**)(void))&__pyx_f_4sage_5rings_10polynomial_28multi_polynomial_libsingular_new_MP, "struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular *(struct __pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingular *, polyrec *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_ImportModule("sage.rings.polynomial.multi_polynomial_ideal_libsingular"); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_3, "singular_ideal_to_sage_sequence", (void (**)(void))&__pyx_f_4sage_5rings_10polynomial_34multi_polynomial_ideal_libsingular_singular_ideal_to_sage_sequence, "PyObject *(ip_sideal *, ip_sring *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportFunction(__pyx_t_3, "sage_ideal_to_singular_ideal", (void (**)(void))&__pyx_f_4sage_5rings_10polynomial_34multi_polynomial_ideal_libsingular_sage_ideal_to_singular_ideal, "ip_sideal *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  /*--- Execution code ---*/

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":3
 * #import sage.all
 * 
 * print "loading module"             # <<<<<<<<<<<<<<
 * 
 * from sage.rings.polynomial.multi_polynomial_libsingular cimport \
 */
  if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/ext/stdsage.pxi":52
 * # This is necessary on some platforms, e.g., Cygwin, so
 * # do not delete it!
 * init_csage()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  init_csage();

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":14
 * include "sage/ext/stdsage.pxi"
 * 
 * print "loading module"             # <<<<<<<<<<<<<<
 * 
 * cdef extern from "polynomial.h":
 */
  if (__Pyx_PrintOne(((PyObject *)__pyx_kp_s_8)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":58
 * 
 * 
 * from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing             # <<<<<<<<<<<<<<
 * from sage.rings.rational_field import QQ
 * 
 */
  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__PolynomialRing));
  PyList_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__PolynomialRing));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PolynomialRing));
  __pyx_t_5 = __Pyx_Import(((PyObject *)__pyx_n_s_9), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__PolynomialRing); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__PolynomialRing, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":59
 * 
 * from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
 * from sage.rings.rational_field import QQ             # <<<<<<<<<<<<<<
 * 
 * import sage.libs.singular
 */
  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__QQ));
  PyList_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_n_s__QQ));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__QQ));
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s_10), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__QQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__QQ, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":61
 * from sage.rings.rational_field import QQ
 * 
 * import sage.libs.singular             # <<<<<<<<<<<<<<
 * minAssGTZ = sage.libs.singular.ff.primdec__lib.minAssGTZ
 * 
 */
  __pyx_t_4 = __Pyx_Import(((PyObject *)__pyx_n_s_11), 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sage, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":62
 * 
 * import sage.libs.singular
 * minAssGTZ = sage.libs.singular.ff.primdec__lib.minAssGTZ             # <<<<<<<<<<<<<<
 * 
 * cdef public void minimal_associated_primes(GFanPolynomialSetList* res,
 */
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sage); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__libs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__singular); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__ff); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__primdec__lib); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__minAssGTZ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__minAssGTZ, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "/Users/anders/eclipse-workspace/gfan/sage_link.pyx":1
 * #import sage.all             # <<<<<<<<<<<<<<
 * 
 * print "loading module"
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_5)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;

  /* "/Users/anders/math/software/sage-4.3.2/devel/sage/sage/structure/element.pxd":2
 * 
 * # It is important to keep this line here, basically to trick Pyrex.             # <<<<<<<<<<<<<<
 * # If you remove this line then other modules that cimport element
 * # from other directories will fail.
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (__pyx_m) {
    __Pyx_AddTraceback("init sage_link");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init sage_link");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

static const char *__pyx_filenames[] = {
  "sage_link.pyx",
  "sage_object.pxd",
  "generators.pxd",
  "category_object.pxd",
  "parent.pxd",
  "parent_old.pxd",
  "parent_base.pxd",
  "parent_gens.pxd",
  "ring.pxd",
  "element.pxd",
  "multi_polynomial.pxd",
  "multi_polynomial_ring_generic.pxd",
  "multi_polynomial_libsingular.pxd",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

static INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

#if PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}

static int __Pyx_Print(PyObject *arg_tuple, int newline) {
    PyObject *f;
    PyObject* v;
    int i;

    if (!(f = __Pyx_GetStdout()))
        return -1;
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                return -1;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            return -1;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            return -1;
        PyFile_SoftSpace(f, 0);
    }
    return 0;
}

#else /* Python 3 has a print function */

static int __Pyx_Print(PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (!__pyx_print) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (!newline) {
        if (!__pyx_print_kwargs) {
            __pyx_print_kwargs = PyDict_New();
            if (!__pyx_print_kwargs)
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (!end_string)
                return -1;
            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
}

#endif

#if PY_MAJOR_VERSION < 3

static int __Pyx_PrintOne(PyObject *o) {
    PyObject *f;
    if (!(f = __Pyx_GetStdout()))
        return -1;
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    return 0;
    /* the line below is just to avoid compiler
     * compiler warnings about unused functions */
    return __Pyx_Print(NULL, 0);
}

#else /* Python 3 has a print function */

static int __Pyx_PrintOne(PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_New(1);
    if (unlikely(!arg_tuple))
        return -1;
    Py_INCREF(o);
    PyTuple_SET_ITEM(arg_tuple, 0, o);
    res = __Pyx_Print(arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}

#endif

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__ = __Pyx_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_CallFunctionObjArgs(__import__,
        name, global_dict, empty_dict, list, NULL);
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 INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


#if PY_MAJOR_VERSION < 3
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 {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(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
    }

    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

#else /* Python 3+ */

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;

    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (!PyExceptionClass_Check(type)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }

    PyErr_SetObject(type, value);

    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }

bad:
    return;
}
#endif

static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    long size)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;

    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(class_name);
    #else
    py_name = PyUnicode_FromString(class_name);
    #endif
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError, 
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s does not appear to be the correct type object",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;

    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(name);
    #else
    py_name = PyUnicode_FromString(name);
    #endif
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

static int __Pyx_GetVtable(PyObject *dict, void *vtabptr) {
    PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
    if (!ob)
        goto bad;
#if PY_VERSION_HEX < 0x03010000
    *(void **)vtabptr = PyCObject_AsVoidPtr(ob);
#else
    *(void **)vtabptr = PyCapsule_GetPointer(ob, 0);
#endif
    if (!*(void **)vtabptr)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportFunction
#define __PYX_HAVE_RT_ImportFunction
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
#if PY_VERSION_HEX < 0x03010000
    const char *desc, *s1, *s2;
#endif

    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, funcname);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%s does not export expected C function %s",
                PyModule_GetName(module), funcname);
        goto bad;
    }
#if PY_VERSION_HEX < 0x03010000
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C function %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), funcname, sig, desc);
        goto bad;
    }
    tmp.p = PyCObject_AsVoidPtr(cobj);
#else
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C function %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    tmp.p = PyCapsule_GetPointer(cobj, sig);
#endif
    *f = tmp.fp;
    if (!(*f))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*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(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   if (x == Py_True) return 1;
   else if ((x == Py_False) | (x == Py_None)) return 0;
   else return PyObject_IsTrue(x);
}

static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
