My Project
Singular
dyn_modules
python
vector_wrap.cc
Go to the documentation of this file.
1
#include "
kernel/mod2.h
"
2
#ifdef HAVE_PYTON
3
#include <boost/python.hpp>
4
#include "
Poly.h
"
5
#include "
vector_wrap.h
"
6
#include "
ring_wrap.h
"
7
using
boost::python::self;
8
9
static
boost::python::object
Vector_as_str
(
Vector
&
p
)
10
{
11
using
boost::python::str
;
12
//ring r=p.getRing();
13
14
char
* out=
p
.c_string();
15
return
boost::python::str
(out,strlen(out));
16
}
17
static
Ring
Vector_get_Ring(
const
Vector
&
p
){
18
return
p
.getRing();
19
}
20
void
export_vector
(){
21
boost::python::class_<Vector>(
"Vector"
)
22
.def(boost::python::init <>())
23
.def(
"__str__"
,
Vector_as_str
)
24
25
// .def("__str__", Poly_as_str)
26
.def(
"__iter__"
, boost::python::iterator<Vector>())
27
.def(-self)
28
.def(self+=self)
29
30
.def(self+self)
31
.def(self*=
Number
())
32
.def(
Poly
() * self)
33
.def(
Number
() * self)
34
.def(
"ring"
,Vector_get_Ring);
35
}
36
#endif
Poly.h
p
int p
Definition:
cfModGcd.cc:4078
Number
Definition:
Number.h:34
Ring
Definition:
ring_wrap.h:21
Vector
Definition:
Poly.h:509
mod2.h
LibThread::str
char * str(leftv arg)
Definition:
shared.cc:704
Vector_as_str
boost::python::str Vector_as_str(const Vector &p)
Definition:
poly_wrap.cc:18
ring_wrap.h
Poly
Definition:
janet.h:15
vector_wrap.h
export_vector
void export_vector()
Generated on Sun Apr 17 2022 10:43:55 for My Project by
doxygen 1.9.3
for
Singular