Changeset a9d624 in git for modules/python
- Timestamp:
- Sep 8, 2005, 2:47:18 PM (19 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
- Children:
- a171c0db5983b1b21803816bbc2059e6a2c2c01c
- Parents:
- d964f9729f190e72c24a8391d0e7b4ab964543a2
- Location:
- modules/python
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/python/ideal_wrap.cc
rd964f9 ra9d624 16 16 int i; 17 17 int s=p.size(); 18 tojoin.append("[");18 //tojoin.append("["); 19 19 for(i=0;i<s;i++){ 20 20 tojoin.append(Poly_as_str(p[i])); … … 22 22 tojoin.append(", "); 23 23 } 24 tojoin.append("]");24 //tojoin.append("]"); 25 25 str res=helper.join(tojoin); 26 26 return res; -
modules/python/interpretertester
rd964f9 ra9d624 39 39 return(m); 40 40 } 41 python_module::python("from Singular import number, polynomial, interpreter_id, get_idhdl,call_interpreter_method, i_arg_list, gen 41 python_module::python("from Singular import number, polynomial, interpreter_id, get_idhdl,call_interpreter_method, i_arg_list, gen, ideal 42 42 43 43 from interpreter import global_functions … … 46 46 x=polynomial('x') 47 47 y=polynomial('y') 48 i=ideal() 49 i.append(x) 50 i.append(x+y) 51 print i 52 print functions.groebner(i); 48 53 xy=x*y 49 54 -
modules/python/wrapper.h
rd964f9 ra9d624 1 //$Id: wrapper.h,v 1.2 5 2005-09-08 11:45:23bricken Exp $1 //$Id: wrapper.h,v 1.26 2005-09-08 12:47:18 bricken Exp $ 2 2 #ifndef PYTHON_SINGULAR_WRAPPER_HEADER 3 3 #define PYTHON_SINGULAR_WRAPPER_HEADER … … 18 18 #include "Poly.h" 19 19 #include "PowerSeries.h" 20 #include "Ideal.h" 20 21 #include "ideal_wrap.h" 21 22 #include <factory.h> … … 72 73 v->data=p.as_poly(); 73 74 v->rtyp=POLY_CMD; 75 internal_append(v); 76 } 77 void appendIdeal(const Ideal& p){ 78 leftv v=initArg(); 79 v->data=p.as_ideal(); 80 v->rtyp=IDEAL_CMD; 74 81 internal_append(v); 75 82 } … … 147 154 148 155 return to_python_value<Vector>()( Vector((poly) v->data, currRing)); 156 case IDEAL_CMD: 157 return to_python_value<Ideal>()(Ideal((ideal) v->data, currRing)); 149 158 case NUMBER_CMD: 150 159 … … 211 220 .def("append", &arg_list::appendArray) 212 221 .def("append", &arg_list::appendNumber) 213 .def("append", &arg_list::appendint) 214 .def("append", &arg_list::appendVector); 222 .def("append", &arg_list::appendint) 223 .def("append", &arg_list::appendIdeal) 224 .def("append", &arg_list::appendVector); 215 225 boost::python::class_<idhdl_wrap>("interpreter_id") 216 226 .def("is_zero", &idhdl_wrap::is_zero)
Note: See TracChangeset
for help on using the changeset viewer.