My Project
Loading...
Searching...
No Matches
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"
7using boost::python::self;
8
9static 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}
17static Ring Vector_get_Ring(const Vector & p){
18 return p.getRing();
19}
20void 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
int p
Definition: cfModGcd.cc:4078
Definition: Number.h:34
Definition: ring_wrap.h:21
Definition: Poly.h:509
boost::python::str Vector_as_str(const Vector &p)
Definition: poly_wrap.cc:18
Definition: janet.h:15
void export_vector()