My Project  debian-1:4.1.1-p2+ds-4build3
intvec_wrap.cc
Go to the documentation of this file.
1 #include "kernel/mod2.h"
2 #ifdef HAVE_PYTHON_MOD
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
37 
Intvec
Definition: IIntvec.h:6
intvec_wrap.h
i
int i
Definition: cfEzgcd.cc:125
res
CanonicalForm res
Definition: facAbsFact.cc:64
mod2.h
IIntvec.h
export_intvec
void export_intvec()
p
int p
Definition: cfModGcd.cc:4019
s
const CanonicalForm int s
Definition: facAbsFact.cc:55