Loading...
Searching...
No Matches
vector_wrap.cc
Go to the documentation of this file.
#include "kernel/mod2.h"
#ifdef HAVE_PYTON
#include <boost/python.hpp>
#include "Poly.h"
#include "vector_wrap.h"
#include "ring_wrap.h"
using boost::python::self;
static boost::python::object Vector_as_str(Vector& p)
{
using boost::python::str;
//ring r=p.getRing();
char* out=p.c_string();
return boost::python::str(out,strlen(out));
}
static Ring Vector_get_Ring(const Vector & p){
return p.getRing();
}
void export_vector(){
boost::python::class_<Vector>("Vector")
.def(boost::python::init <>())
.def("__str__", Vector_as_str)
// .def("__str__", Poly_as_str)
.def("__iter__", boost::python::iterator<Vector>())
.def(-self)
.def(self+=self)
.def(self+self)
.def(self*=Number())
.def(Poly() * self)
.def(Number() * self)
.def("ring",Vector_get_Ring);
}
#endif
Poly.h
p
int p
Definition cfModGcd.cc:4086
Number
Definition Number.h:34
Ring
Definition ring_wrap.h:21
Vector
Definition Poly.h:509
mod2.h
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()