Changeset b29766f in git


Ignore:
Timestamp:
Sep 14, 2005, 10:25:33 AM (19 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
52a99a7189a6617d18ad745bc17acc7cccaa2c4f
Parents:
2c522621b85484816c0f82af12f0dc6508ee36e7
Message:
*bricken: cleaning up, builtin in prep


git-svn-id: file:///usr/local/Singular/svn/trunk@8613 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
modules/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/python/interpreter_support.cc

    r2c52262 rb29766f  
    66#include "Ideal.h"
    77#include "structs.h"
    8 
     8#include "ipshell.h"
    99#include "numbers.h"
    1010
     
    109109    if (args!=NULL){
    110110      args->CleanUp();
    111     }
     111      omFreeBin(args, sleftv_bin);
     112    }
     113   
    112114  }
    113115  void appendPoly(const Poly& p){
     
    252254  errorreported=inerror=0;
    253255  return res;
     256}
     257PyObject* 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  }
    254275}
    255276static boost::python::str idhdl_as_str(idhdl_wrap iw){
     
    289310    .def("__str__", idhdl_as_str);
    290311  def("call_interpreter_method",call_interpreter_method);
     312  def("cbm",call_builtin_method);
    291313  def("transfer_to_python",buildPyObjectFromIdhdl);
    292314}
  • modules/python/interpretertester

    r2c52262 rb29766f  
    4646functions=global_functions()
    4747print functions.testproc1()
     48print 'hi'
    4849x=polynomial('x')
    4950y=polynomial('y')
     
    5354print i
    5455print functions.groebner(i);
     56#print functions.std(i);
    5557xy=x*y
    5658functions.f=xy
Note: See TracChangeset for help on using the changeset viewer.