Changeset b29766f in git
- Timestamp:
- Sep 14, 2005, 10:25:33 AM (19 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 52a99a7189a6617d18ad745bc17acc7cccaa2c4f
- Parents:
- 2c522621b85484816c0f82af12f0dc6508ee36e7
- Location:
- modules/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/python/interpreter_support.cc
r2c52262 rb29766f 6 6 #include "Ideal.h" 7 7 #include "structs.h" 8 8 #include "ipshell.h" 9 9 #include "numbers.h" 10 10 … … 109 109 if (args!=NULL){ 110 110 args->CleanUp(); 111 } 111 omFreeBin(args, sleftv_bin); 112 } 113 112 114 } 113 115 void appendPoly(const Poly& p){ … … 252 254 errorreported=inerror=0; 253 255 return res; 256 } 257 PyObject* call_builtin_method(const char* name, Ideal i){ 258 arg_list l; 259 l.appendIdeal(i); 260 leftv a=l.args; 261 int cmd_n=-1; 262 IsCmd(name,cmd_n); 263 if (cmd_n<0){ 264 Py_INCREF(Py_None); 265 PrintS("is not a cmd"); 266 return Py_None; 267 268 } else { 269 leftv res=(leftv)omAllocBin(sleftv_bin); 270 res->Init(); 271 iiExprArith1(res,a,cmd_n); 272 buildPyObjectFromLeftv(res); 273 //cleanup not to forget 274 } 254 275 } 255 276 static boost::python::str idhdl_as_str(idhdl_wrap iw){ … … 289 310 .def("__str__", idhdl_as_str); 290 311 def("call_interpreter_method",call_interpreter_method); 312 def("cbm",call_builtin_method); 291 313 def("transfer_to_python",buildPyObjectFromIdhdl); 292 314 } -
modules/python/interpretertester
r2c52262 rb29766f 46 46 functions=global_functions() 47 47 print functions.testproc1() 48 print 'hi' 48 49 x=polynomial('x') 49 50 y=polynomial('y') … … 53 54 print i 54 55 print functions.groebner(i); 56 #print functions.std(i); 55 57 xy=x*y 56 58 functions.f=xy
Note: See TracChangeset
for help on using the changeset viewer.