Changeset 67f14a in git for modules/python


Ignore:
Timestamp:
Aug 24, 2005, 12:36:26 PM (19 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
Children:
8d98a8cd3f42f1ead52a3b689f539a5856109e56
Parents:
7a2741ab1ddda92d10cf83f2683680382b00a49d
Message:
*bricken: faster compile on factory wrapper


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

Legend:

Unmodified
Added
Removed
  • modules/python/Makefile

    r7a2741 r67f14a  
    2121INSTALL_PROGRAM = ${INSTALL}
    2222INSTALL_DATA    = ${INSTALL} -m 644
    23 SRCS    = python.cc poly_wrap.cc vector_wrap.cc
    24 OBJS    = python.o poly_wrap.o vector_wrap.o
    25 DOBJS   = python.og poly_wrap.og vector_wrap.og
     23SRCS    = python.cc poly_wrap.cc vector_wrap.cc CF_wrap.cc
     24OBJS    = python.o poly_wrap.o vector_wrap.o CF_wrap.o
     25DOBJS   = python.og poly_wrap.og vector_wrap.og CF_wrap.og
    2626
    2727all:    python_module.so python_module_g.so
  • modules/python/wrapper.h

    r7a2741 r67f14a  
    1 //$Id: wrapper.h,v 1.18 2005-08-24 10:06:46 bricken Exp $
     1//$Id: wrapper.h,v 1.19 2005-08-24 10:36:26 bricken Exp $
    22#ifndef PYTHON_SINGULAR_WRAPPER_HEADER
    33#define PYTHON_SINGULAR_WRAPPER_HEADER
     
    2121#include "poly_wrap.h"
    2222#include "vector_wrap.h"
     23#include "CF_wrap.h"
    2324extern BOOLEAN errorreported;
    2425extern int inerror;
    2526using namespace boost::python;
    26 typedef std::basic_stringstream<char>  mysstream;
     27
    2728Vector unitVector0(int i){
    2829  return unitVector(i,currRing);
     
    3738  return boost::python::str(out,strlen(out));
    3839}
    39 static boost::python::object CF_as_str(const CanonicalForm& f)
    40 {
    41   using boost::python::str;
    42   mysstream s;
    43   s<<f;
    44   return boost::python::str(s.str());
    45 }
     40
    4641
    4742
     
    147142 
    148143
    149   mysstream s;
     144  std::basic_stringstream<char> s;
    150145  s<<i;
    151146  return boost::python::str(s.str());
     
    170165   
    171166    .def(boost::python::init <const int>());
    172   boost::python::class_<CanonicalForm>("canonical_form")
    173     .def(boost::python::init <const int>())
    174     .def(boost::python::init <const Variable>())
    175     .def("__str__", CF_as_str)
    176     .def(-self)
    177     .def(self*=self)
    178     .def(self+=self)
    179     .def(self-=self)
    180     .def(self/=self)
    181     .def(self==self)
    182     .def(self+self)
    183     .def(self*self)
    184     .def(self/self)
    185     .def(self-self)
    186     .def(int()==self)
    187     .def(int()+self)
    188     .def(int()*self)
    189     .def(int()/self)
    190     .def(int()-self)
    191     .def(self==int())
    192     .def(self+int())
    193     .def(self*int())
    194     .def(self/int())
    195     .def(self-int())
    196     .def(self*=int())
    197     .def(self+=int())
    198     .def(self-=int())
    199     .def(self/=int());
     167  export_CF();
    200168  boost::python::class_<Number>("number")
    201169    .def(boost::python::init <int>())
Note: See TracChangeset for help on using the changeset viewer.