Changeset d964f9 in git for modules


Ignore:
Timestamp:
Sep 8, 2005, 2:07:20 PM (19 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
a9d624694e33a149fccdcb1ff6736b0978116e1e
Parents:
4a21397125143f13495d844ecddd6e6a9b67b150
Message:
*bricken: further work on ideals


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

Legend:

Unmodified
Added
Removed
  • modules/python/ideal_wrap.cc

    r4a21397 rd964f9  
    77using boost::python::self;
    88using namespace boost::python;
    9 static boost::python::object Poly_as_str(Poly& p)
     9
     10static boost::python::object Ideal_as_str(Ideal& p)
    1011{
    1112  using boost::python::str;
    1213  //ring r=p.getRing();
    13  
    14   char* out=p.c_string();
    15   return boost::python::str(out,strlen(out));
     14  str helper;
     15  list tojoin;
     16  int i;
     17  int s=p.size();
     18  tojoin.append("[");
     19  for(i=0;i<s;i++){
     20    tojoin.append(Poly_as_str(p[i]));
     21    if (i<s-1)
     22      tojoin.append(", ");
     23  }
     24  tojoin.append("]");
     25  str res=helper.join(tojoin);
     26  return res;
    1627}
     28
     29
    1730void export_ideal()
    1831{
    1932   boost::python::class_<Ideal>("ideal")
    20     .def(boost::python::init <>())
     33     .def("__str__", Ideal_as_str)
     34     .def(boost::python::init <>())
    2135     .def(vector_indexing_suite<Ideal >());
     36   
    2237}
    2338
  • modules/python/idealtester

    r4a21397 rd964f9  
    1313for p in i:
    1414  print p
     15print i
    1516xy=polynomial('xy')
    1617print xy
  • modules/python/poly_wrap.cc

    r4a21397 rd964f9  
    44#include "Poly.h"
    55using boost::python::self;
    6 static boost::python::object Poly_as_str(Poly& p)
     6boost::python::str Poly_as_str(Poly& p)
    77{
    88  using boost::python::str;
  • modules/python/poly_wrap.h

    r4a21397 rd964f9  
    11#ifndef POLY_WRAP_HEADER
    22#define POLY_WRAP_HEADER
     3#include <boost/python.hpp>
     4#include "mod2.h"
     5#include "Poly.h"
    36void export_poly();
     7boost::python::str Poly_as_str(Poly& p);
    48#endif
Note: See TracChangeset for help on using the changeset viewer.