Loading...
Searching...
No Matches
ring_wrap.cc File Reference
`#include "kernel/mod2.h"`
`#include <boost/python.hpp>`
`#include "Singular/ipshell.h"`
`#include "ring_wrap.h"`
`#include "poly_wrap.h"`

Go to the source code of this file.

## Functions

static boost::python::object | Ring_as_str (const Ring &r)
void | ring_set (Ring &R)
void | export_ring ()

## Function Documentation

## export_ring()

void export_ring | ( |  | ) |

Definition at line 32 of file ring_wrap.cc.

{
boost::python::class_<Ring>("Ring", "reference to a Singular ring")
.def("__str__", Ring_as_str)
.def("set", ring_set,"equivalent to the singular command setring, which is not mapped as it is a command")
.def(boost::python::init <>());
}
ring_set
void ring_set(Ring &R)
Definition ring_wrap.cc:15
Ring_as_str
static boost::python::object Ring_as_str(const Ring &r)
Definition ring_wrap.cc:7

## Ring_as_str()

boost::python::object Ring_as_str | ( | const Ring & | r | ) |

static

Definition at line 7 of file ring_wrap.cc.

{
using boost::python::str;
StringSetS("");
rWrite(r.pimpl.get());
char* out=StringEndS();
return boost::python::str(out,strlen(out));
}
Ring::pimpl
intrusive_ptr< ip_sring > pimpl
Definition ring_wrap.h:23
StringSetS
void StringSetS(const char *st)
Definition reporter.cc:128
StringEndS
char * StringEndS()
Definition reporter.cc:151
rWrite
void rWrite(ring r, BOOLEAN details)
Definition ring.cc:227

## ring_set()

void ring_set | ( | Ring & | R | ) |

Definition at line 15 of file ring_wrap.cc.

{
ring r=R.pimpl.get();
idhdl h=rFindHdl(r,NULL);
if (h==NULL)
{
char name_buffer[100];
STATIC_VAR int ending=0;
ending++;
sprintf(name_buffer, "PYTHON_RING_VAR%d",ending);
h=enterid(name_buffer,0,RING_CMD,&IDROOT);
IDRING(h)=r;
r->ref++;
}
rSetHdl(h);
for(int i=myynest;i>=0;i--) iiLocalRing[i]=r;
}
i
int i
Definition cfEzgcd.cc:132
myynest
VAR int myynest
Definition febase.cc:41
STATIC_VAR
#define STATIC_VAR
Definition globaldefs.h:7
RING_CMD
@ RING_CMD
Definition grammar.cc:282
enterid
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:279
IDROOT
#define IDROOT
Definition ipid.h:19
IDRING
#define IDRING(a)
Definition ipid.h:127
iiLocalRing
VAR ring * iiLocalRing
Definition iplib.cc:482
rFindHdl
idhdl rFindHdl(ring r, idhdl n)
Definition ipshell.cc:1701
rSetHdl
void rSetHdl(idhdl h)
Definition ipshell.cc:5129
h
STATIC_VAR Poly * h
Definition janet.cc:971
NULL
#define NULL
Definition omList.c:12
idhdl
idrec * idhdl
Definition ring.h:22
R
#define R
Definition sirandom.c:27