Loading...
Searching...
No Matches
poly_wrap.h File Reference
`#include <boost/python.hpp>`
`#include "kernel/mod2.h"`
`#include "Poly.h"`

Go to the source code of this file.

## Functions

void | export_poly ()
boost::python::str | Poly_as_str (const Poly &p)
boost::python::str | Vector_as_str (const Vector &p)

## Function Documentation

## export_poly()

void export_poly | ( |  | ) |

Definition at line 29 of file poly_wrap.cc.

{
boost::python::class_<Poly>("Polynomial", "Wrapper for poly of Singular")
.def("ring",Poly_get_Ring)
.def(boost::python::init <int>())
.def(boost::python::init <Poly>())
// .def(boost::python::init <std::vector<int> >())
.def(boost::python::init <Number>())
.def(boost::python::init <Intvec> ())
.def("__str__", Poly_as_str)
.def("__iter__", boost::python::iterator<Poly>())
//read monomials (only) from string
.def(boost::python::init <const char* >())
.def("leadCoef",&Poly::leadCoef)
.def("leadExp", &Poly::leadExp)
.def(-self)
.def(self*=self)
.def(self+=self)
// .def(self-=self)
//.def(self/=self)
//.def(self==self)
.def(self+self)
.def(self*=Number())
.def(Number()*self)
.def(self+Number())
.def(self+=Number())
.def(self*=Number())
.def(self*self);
}
Number
Definition Number.h:34
PolyBase< POLY_VARIANT_RING, Poly, MyErrorHandler >::leadExp
Intvec leadExp()
Definition Poly.h:352
PolyBase< POLY_VARIANT_RING, Poly, MyErrorHandler >::leadCoef
Number leadCoef()
Definition Poly.h:433
Poly_get_Ring
static Ring Poly_get_Ring(const Poly &p)
Definition poly_wrap.cc:26
Poly_as_str
boost::python::str Poly_as_str(const Poly &p)
Definition poly_wrap.cc:10

## Poly_as_str()

boost::python::str Poly_as_str | ( | const Poly & | p | ) |

Definition at line 10 of file poly_wrap.cc.

{
using boost::python::str;
//ring r=p.getRing();
char* out=p.c_string();
return boost::python::str(out,strlen(out));
}
p
int p
Definition cfModGcd.cc:4086

## Vector_as_str()

boost::python::str Vector_as_str | ( | const Vector & | p | ) |

Definition at line 18 of file poly_wrap.cc.

{
using boost::python::str;
//ring r=p.getRing();
char* out=p.c_string();
return boost::python::str(out,strlen(out));
}