My Project
Loading...
Searching...
No Matches
Functions
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.

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

◆ Ring_as_str()

static boost::python::object Ring_as_str ( const Ring r)
static

Definition at line 7 of file ring_wrap.cc.

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

◆ ring_set()

void ring_set ( Ring R)

Definition at line 15 of file ring_wrap.cc.

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