My Project
Functions
intvec_wrap.cc File Reference
#include "kernel/mod2.h"
#include <boost/python.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include "IIntvec.h"
#include "intvec_wrap.h"

Go to the source code of this file.

Functions

static boost::python::object intvec_as_str (const Intvec &p)
 
void export_intvec ()
 

Function Documentation

◆ export_intvec()

void export_intvec ( )

Definition at line 30 of file intvec_wrap.cc.

30  {
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 }
static boost::python::object intvec_as_str(const Intvec &p)
Definition: intvec_wrap.cc:10

◆ intvec_as_str()

static boost::python::object intvec_as_str ( const Intvec p)
static

Definition at line 10 of file intvec_wrap.cc.

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 }
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4080
const CanonicalForm int s
Definition: facAbsFact.cc:51
CanonicalForm res
Definition: facAbsFact.cc:60
char * str(leftv arg)
Definition: shared.cc:704