My Project
wrapper.h
Go to the documentation of this file.
1 #ifndef PYTHON_SINGULAR_WRAPPER_HEADER
2 #define PYTHON_SINGULAR_WRAPPER_HEADER
3 #include <Python.h>
4 #include <boost/python.hpp>
5 #include <sstream>
6 #include "kernel/mod2.h"
7 
8 
9 #include "kernel/structs.h"
10 #include "coeffs/numbers.h"
11 
12 #include "Singular/ipid.h"
13 #include "Singular/ipshell.h"
14 #include "Number.h"
15 #include "Poly.h"
16 #include "PowerSeries.h"
17 #include "Ideal.h"
18 #include "ideal_wrap.h"
19 #include "factory/factory.h"
20 #include "poly_wrap.h"
21 #include "vector_wrap.h"
22 #include "CF_wrap.h"
23 #include "number_wrap.h"
24 #include "interpreter_support.h"
25 #include "ring_wrap.h"
26 #include "intvec_wrap.h"
27 //using boost::python::numeric::array;
28 using boost::python::extract;
29 
30 using namespace boost::python;
31 
33 {
34  return unitVector(i,currRing);
35 }
36 
38 {
39  PrintS("hoho");
40  PyErr_SetString(PyExc_UserWarning, "Objects didn't have the same ring");
41 }
43 {
44  //Print("ref count after add: %d", currRing->ref);
45  register_exception_translator<
47  export_poly();
48  export_number();
49  export_vector();
50  //export_playground();
51  export_ideal();
52  export_module();
53  //export_interpreter();
54  export_ring();
55  export_intvec();
56  boost::python::class_<PowerSeries>("power_series")
57  .def(boost::python::init <const PowerSeries::numerator_type &,const PowerSeries::denominator_type&>())
58  .def("__iter__", boost::python::iterator<PowerSeries>());
59  boost::python::class_<VectorPowerSeries>("vector_power_series")
60  .def(boost::python::init <const VectorPowerSeries::numerator_type&,const VectorPowerSeries::denominator_type &>())
61  .def("__iter__", boost::python::iterator<VectorPowerSeries>());
62  def("gen",unitVector0);
63  // .def(self+=self)
64  // .def(self+self)
65  //.def(self*=Number())
66  //.def(Number() * self);
67 }
69 {
70  boost::python::class_<Variable>("variable")
71  .def(boost::python::init <const int, char>())
72  .def(boost::python::init <char>())
73  .def(boost::python::init <const int>());
74  export_CF();
75 }
77 {
79 }
80 #endif
void export_CF()
Definition: CF_wrap.cc:17
Vector unitVector(int i, ring r=currRing)
Definition: Poly.h:630
int i
Definition: cfEzgcd.cc:132
Variable x
Definition: cfModGcd.cc:4084
Definition: Poly.h:509
void export_module()
Definition: ideal_wrap.cc:68
void export_ideal()
Definition: ideal_wrap.cc:55
void export_interpreter()
void export_intvec()
Definition: intvec_wrap.cc:30
void export_number()
Definition: number_wrap.cc:19
void export_poly()
Definition: poly_wrap.cc:29
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
void PrintS(const char *s)
Definition: reporter.cc:284
void export_ring()
Definition: ring_wrap.cc:32
void export_vector()
BOOST_PYTHON_MODULE(Singular)
Definition: wrapper.h:42
Vector unitVector0(int i)
Definition: wrapper.h:32
void different_ring_translator(DifferentDomainException const &x)
Definition: wrapper.h:37