Loading...
Searching...
No Matches
number_wrap.cc File Reference
`#include "kernel/mod2.h"`
`#include <boost/python.hpp>`
`#include "Number.h"`
`#include "number_wrap.h"`
`#include "ring_wrap.h"`

Go to the source code of this file.

## Functions

static boost::python::object | Number_as_str (const Number &n)
static Ring | Number_get_Ring (const Number &n)
void | export_number ()

## Function Documentation

## export_number()

void export_number | ( |  | ) |

Definition at line 19 of file number_wrap.cc.

{
boost::python::class_<Number>("Number")
.def(boost::python::init <int>("creates a number in currRing by default, more complex constructs can be fetched from the interpreter"))
.def("__str__", Number_as_str)
.def(-self)
.def(self*=self)
.def(self+=self)
.def(self-=self)
.def(self/=self)
.def(self==self)
.def(self+self)
.def(self*self)
.def(self/self)
.def(self-self)
.def(int()==self)
.def(int()+self)
.def(int()*self)
.def(int()/self)
.def(int()-self)
.def(self==int())
.def(self+int())
.def(self*int())
.def(self/int())
.def(self-int())
.def(self*=int())
.def(self+=int())
.def(self-=int())
.def(self/=int())
.def("ring",Number_get_Ring);
}
Number_get_Ring
static Ring Number_get_Ring(const Number &n)
Definition number_wrap.cc:16
Number_as_str
static boost::python::object Number_as_str(const Number &n)
Definition number_wrap.cc:8

## Number_as_str()

boost::python::object Number_as_str | ( | const Number & | n | ) |

static

Definition at line 8 of file number_wrap.cc.

{
using boost::python::str;
StringSetS("");
n.write();
char* out=StringEndS();
return boost::python::str(out,strlen(out));
}
Number::write
void write() const
Definition Number.h:202
StringSetS
void StringSetS(const char *st)
Definition reporter.cc:128
StringEndS
char * StringEndS()
Definition reporter.cc:151

## Number_get_Ring()

Ring Number_get_Ring | ( | const Number & | n | ) |

static

Definition at line 16 of file number_wrap.cc.

{
return n.getRing();
}
Number::getRing
ring getRing() const
Definition Number.h:212