Changeset a9d624 in git
- Timestamp:
- Sep 8, 2005, 2:47:18 PM (19 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- a171c0db5983b1b21803816bbc2059e6a2c2c01c
- Parents:
- d964f9729f190e72c24a8391d0e7b4ab964543a2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Ideal.h
rd964f9 ra9d624 1 1 #ifndef IDEAL_CPP_HEADER 2 2 #define IDEAL_CPP_HEADER 3 //$Id: Ideal.h,v 1. 1 2005-09-08 12:07:20bricken Exp $3 //$Id: Ideal.h,v 1.2 2005-09-08 12:47:04 bricken Exp $ 4 4 #include "Poly.h" 5 #include "ideals.h" 5 6 //base for ideals as well for modules 6 7 … … 43 44 return storage.end(); 44 45 } 45 size_type size() {46 size_type size() const{ 46 47 return storage.size(); 47 48 } … … 61 62 return insert(__pos,__first,__last); 62 63 } 64 63 65 }; 64 66 … … 68 70 Ideal(){ 69 71 } 72 Ideal(ideal i, ring r){ 73 for(int j=0;j<IDELEMS(i);j++){ 74 storage.push_back(Poly(i->m[j],r)); 75 } 76 } 70 77 Ideal(iterator first, 71 78 iterator last, … … 73 80 IdealBase<Poly>(first,last,__a){ 74 81 } 82 ideal as_ideal() const{ 83 //no checks for rings 84 int s=size(); 85 ideal result=idInit(s); 86 87 for(int i=0;i<s;i++){ 88 result->m[i]=storage[i].as_poly(); 89 } 90 return result; 91 } 75 92 }; 76 93 class Modul: -
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.