Loading...
Searching...
No Matches
CF_wrap.cc
Go to the documentation of this file.
#include "kernel/mod2.h"
#ifdef HAVE_PYTHON
#include <sstream>
#include <boost/python.hpp>
#include "factory/factory.h"
using boost::python::self;
#ifndef NOSTREAMIO
static boost::python::object CF_as_str(const CanonicalForm& f)
{
using boost::python::str;
std::basic_stringstream<char> s;
s<<f;
return boost::python::str(s.str());
}
#endif
void export_CF(){
boost::python::class_<CanonicalForm>("canonical_form")
.def(boost::python::init <const int>())
.def(boost::python::init <const Variable>())
#ifndef NOSTREAMIO
.def("__str__", CF_as_str)
#endif
.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());
}
#endif
CF_as_str
static boost::python::object CF_as_str(const CanonicalForm &f)
Definition CF_wrap.cc:9
export_CF
void export_CF()
Definition CF_wrap.cc:17
f
FILE * f
Definition checklibs.c:9
CanonicalForm
factory's main class
Definition canonicalform.h:86
s
const CanonicalForm int s
Definition facAbsFact.cc:51
factory.h
factory.h' is the user interface to Factory.
mod2.h