Changeset 7a2741 in git
- Timestamp:
- Aug 24, 2005, 12:06:46 PM (19 years ago)
- Branches:
- (u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
- Children:
- 67f14ad6b5d0aa2edbdc38a0c96bcedc91df7ad8
- Parents:
- c300ecadf7d5fa33f3ab124f335b6cd1b59424b0
- Location:
- modules/python
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/python/Makefile
rc300eca r7a2741 21 21 INSTALL_PROGRAM = ${INSTALL} 22 22 INSTALL_DATA = ${INSTALL} -m 644 23 SRCS = python.cc poly_wrap.cc 24 OBJS = python.o poly_wrap.o 25 DOBJS = python.og poly_wrap.og 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 26 26 27 27 all: python_module.so python_module_g.so 28 28 29 %.o: %.cc Makefile wrapper.h29 %.o: %.cc Makefile 30 30 ${CXX} ${CFLAGS} -c -fPIC -DPIC $< -o $*.o 31 31 32 %.og: %.cc Makefile wrapper.h32 %.og: %.cc Makefile 33 33 ${CXX} ${DCFLAGS} -c -fPIC -DPIC $< -o $*.og 34 34 -
modules/python/wrapper.h
rc300eca r7a2741 1 //$Id: wrapper.h,v 1.1 7 2005-08-24 09:27:07bricken Exp $1 //$Id: wrapper.h,v 1.18 2005-08-24 10:06:46 bricken Exp $ 2 2 #ifndef PYTHON_SINGULAR_WRAPPER_HEADER 3 3 #define PYTHON_SINGULAR_WRAPPER_HEADER … … 20 20 #include <factory.h> 21 21 #include "poly_wrap.h" 22 #include "vector_wrap.h" 22 23 extern BOOLEAN errorreported; 23 24 extern int inerror; … … 44 45 } 45 46 46 static boost::python::object Vector_as_str(Vector& p) 47 { 48 using boost::python::str; 49 //ring r=p.getRing(); 50 51 char* out=p.c_string(); 52 return boost::python::str(out,strlen(out)); 53 } 47 54 48 55 49 … … 232 226 .def(self/=int()); 233 227 234 boost::python::class_<Vector>("vector") 235 .def(boost::python::init <>()) 236 .def("__str__", Vector_as_str) 237 238 // .def("__str__", Poly_as_str) 239 .def("__iter__", boost::python::iterator<Vector>()) 240 .def(-self) 241 .def(self+=self) 242 243 .def(self+self) 244 .def(self*=Number()) 245 .def(Poly() * self) 246 .def(Number() * self); 228 export_vector(); 247 229 boost::python::class_<PowerSeries>("power_series") 248 230 .def(boost::python::init <const PowerSeries::numerator_type &,const PowerSeries::denominator_type&>())
Note: See TracChangeset
for help on using the changeset viewer.