Changeset 67f14a in git for modules/python
- Timestamp:
- Aug 24, 2005, 12:36:26 PM (19 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
- Children:
- 8d98a8cd3f42f1ead52a3b689f539a5856109e56
- Parents:
- 7a2741ab1ddda92d10cf83f2683680382b00a49d
- Location:
- modules/python
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/python/Makefile
r7a2741 r67f14a 21 21 INSTALL_PROGRAM = ${INSTALL} 22 22 INSTALL_DATA = ${INSTALL} -m 644 23 SRCS = python.cc poly_wrap.cc vector_wrap.cc 24 OBJS = python.o poly_wrap.o vector_wrap.o 25 DOBJS = python.og poly_wrap.og vector_wrap.og 23 SRCS = python.cc poly_wrap.cc vector_wrap.cc CF_wrap.cc 24 OBJS = python.o poly_wrap.o vector_wrap.o CF_wrap.o 25 DOBJS = python.og poly_wrap.og vector_wrap.og CF_wrap.og 26 26 27 27 all: python_module.so python_module_g.so -
modules/python/wrapper.h
r7a2741 r67f14a 1 //$Id: wrapper.h,v 1.1 8 2005-08-24 10:06:46 bricken Exp $1 //$Id: wrapper.h,v 1.19 2005-08-24 10:36:26 bricken Exp $ 2 2 #ifndef PYTHON_SINGULAR_WRAPPER_HEADER 3 3 #define PYTHON_SINGULAR_WRAPPER_HEADER … … 21 21 #include "poly_wrap.h" 22 22 #include "vector_wrap.h" 23 #include "CF_wrap.h" 23 24 extern BOOLEAN errorreported; 24 25 extern int inerror; 25 26 using namespace boost::python; 26 typedef std::basic_stringstream<char> mysstream; 27 27 28 Vector unitVector0(int i){ 28 29 return unitVector(i,currRing); … … 37 38 return boost::python::str(out,strlen(out)); 38 39 } 39 static boost::python::object CF_as_str(const CanonicalForm& f) 40 { 41 using boost::python::str; 42 mysstream s; 43 s<<f; 44 return boost::python::str(s.str()); 45 } 40 46 41 47 42 … … 147 142 148 143 149 mysstreams;144 std::basic_stringstream<char> s; 150 145 s<<i; 151 146 return boost::python::str(s.str()); … … 170 165 171 166 .def(boost::python::init <const int>()); 172 boost::python::class_<CanonicalForm>("canonical_form") 173 .def(boost::python::init <const int>()) 174 .def(boost::python::init <const Variable>()) 175 .def("__str__", CF_as_str) 176 .def(-self) 177 .def(self*=self) 178 .def(self+=self) 179 .def(self-=self) 180 .def(self/=self) 181 .def(self==self) 182 .def(self+self) 183 .def(self*self) 184 .def(self/self) 185 .def(self-self) 186 .def(int()==self) 187 .def(int()+self) 188 .def(int()*self) 189 .def(int()/self) 190 .def(int()-self) 191 .def(self==int()) 192 .def(self+int()) 193 .def(self*int()) 194 .def(self/int()) 195 .def(self-int()) 196 .def(self*=int()) 197 .def(self+=int()) 198 .def(self-=int()) 199 .def(self/=int()); 167 export_CF(); 200 168 boost::python::class_<Number>("number") 201 169 .def(boost::python::init <int>())
Note: See TracChangeset
for help on using the changeset viewer.