My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
Singular
dyn_modules
python
poly_wrap.cc
Go to the documentation of this file.
1
#include "
kernel/mod2.h
"
2
#ifdef HAVE_PYTHON
3
#include <boost/python.hpp>
4
#include "
Poly.h
"
5
#include "
ring_wrap.h
"
6
#include "
intvec_wrap.h
"
7
#include "
poly_wrap.h
"
8
9
using
boost::python::self;
10
boost::python::str
Poly_as_str
(
const
Poly
&
p
)
11
{
12
using
boost::python::str;
13
//ring r=p.getRing();
14
15
char
* out=
p
.c_string();
16
return
boost::python::str(out,strlen(out));
17
}
18
boost::python::str
Vector_as_str
(
const
Vector
&
p
)
19
{
20
using
boost::python::str;
21
//ring r=p.getRing();
22
23
char
* out=
p
.c_string();
24
return
boost::python::str(out,strlen(out));
25
}
26
static
Ring
Poly_get_Ring
(
const
Poly
&
p
){
27
return
p
.getRing();
28
}
29
void
export_poly
()
30
{
31
boost::python::class_<Poly>(
"Polynomial"
,
"Wrapper for poly of Singular"
)
32
.def(
"ring"
,
Poly_get_Ring
)
33
.def(boost::python::init <int>())
34
.def(boost::python::init <Poly>())
35
// .def(boost::python::init <std::vector<int> >())
36
.def(boost::python::init <Number>())
37
.def(boost::python::init <Intvec> ())
38
.def(
"__str__"
,
Poly_as_str
)
39
.def(
"__iter__"
, boost::python::iterator<Poly>())
40
//read monomials (only) from string
41
.def(boost::python::init <const char* >())
42
43
.def(
"leadCoef"
,&
Poly::leadCoef
)
44
.def(
"leadExp"
, &
Poly::leadExp
)
45
46
.def(-self)
47
.def(self*=self)
48
.def(self+=self)
49
// .def(self-=self)
50
//.def(self/=self)
51
//.def(self==self)
52
.def(self+self)
53
.def(self*=
Number
())
54
.def(
Number
()*self)
55
.def(self+
Number
())
56
.def(self+=
Number
())
57
.def(self*=
Number
())
58
59
.def(self*self);
60
61
}
62
#endif
Poly.h
p
int p
Definition
cfModGcd.cc:4086
Number
Definition
Number.h:34
PolyBase< POLY_VARIANT_RING, Poly, MyErrorHandler >::leadExp
Intvec leadExp()
Definition
Poly.h:352
PolyBase< POLY_VARIANT_RING, Poly, MyErrorHandler >::leadCoef
Number leadCoef()
Definition
Poly.h:433
Ring
Definition
ring_wrap.h:21
Vector
Definition
Poly.h:509
intvec_wrap.h
mod2.h
export_poly
void export_poly()
Definition
poly_wrap.cc:29
Poly_get_Ring
static Ring Poly_get_Ring(const Poly &p)
Definition
poly_wrap.cc:26
Poly_as_str
boost::python::str Poly_as_str(const Poly &p)
Definition
poly_wrap.cc:10
Vector_as_str
boost::python::str Vector_as_str(const Vector &p)
Definition
poly_wrap.cc:18
poly_wrap.h
ring_wrap.h
Poly
Definition
janet.h:15
Generated on
for My Project by
doxygen 1.17.0
for
Singular