My Project
Loading...
Searching...
No Matches
Singular
dyn_modules
python
intvec_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 <boost/python/suite/indexing/vector_indexing_suite.hpp>
5
#include "
IIntvec.h
"
6
#include "
intvec_wrap.h
"
7
8
9
using namespace
boost::python;
10
static
boost::python::object
intvec_as_str
(
const
Intvec
&
p
)
11
{
12
using
boost::python::str;
13
//ring r=p.getRing();
14
str helper;
15
list tojoin;
16
int
i
;
17
int
s
=
p
.size();
18
tojoin.append(
"["
);
19
for
(
i
=0;
i
<
s
;
i
++){
20
tojoin.append(str(
p
[
i
]));
21
if
(
i
<
s
-1)
22
tojoin.append(
", "
);
23
}
24
tojoin.append(
"]"
);
25
str
res
=helper.join(tojoin);
26
return
res
;
27
28
}
29
30
void
export_intvec
(){
31
boost::python::class_<Intvec>(
"IntVector"
)
32
.def(
"__str__"
,
intvec_as_str
)
33
.def(boost::python::init <>())
34
.def(boost::python::vector_indexing_suite<Intvec>());
35
}
36
#endif
IIntvec.h
i
int i
Definition
cfEzgcd.cc:132
p
int p
Definition
cfModGcd.cc:4086
Intvec
Definition
IIntvec.h:6
s
const CanonicalForm int s
Definition
facAbsFact.cc:51
res
CanonicalForm res
Definition
facAbsFact.cc:60
export_intvec
void export_intvec()
Definition
intvec_wrap.cc:30
intvec_as_str
static boost::python::object intvec_as_str(const Intvec &p)
Definition
intvec_wrap.cc:10
intvec_wrap.h
mod2.h
Generated on Thu Mar 20 2025 00:00:00 for My Project by
doxygen 1.13.2
for
Singular