My Project
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
idhdl_wrap Class Reference

Public Member Functions

 idhdl_wrap (idhdl id)
 
 idhdl_wrap ()
 
bool is_zero ()
 
bool id_is_proc ()
 
bool print_type ()
 
void writePoly (const Poly &p)
 
void writeIdeal (const Ideal &p)
 
void writeModule (const Module &p)
 
void writeint (int p)
 
void writeNumber (const Number &p)
 
void writeVector (const Vector &p)
 
void writeArray (const NumpyArrayType &f)
 
void writeRing (const Ring &r)
 
void writeString (const char *s)
 
void writeIntvec (const Intvec &iv)
 
void writeList (arg_list &f)
 

Data Fields

idhdl id
 

Detailed Description

Definition at line 214 of file interpreter_support.cc.

Constructor & Destructor Documentation

◆ idhdl_wrap() [1/2]

idhdl_wrap::idhdl_wrap ( idhdl  id)
inline

Definition at line 218 of file interpreter_support.cc.

219 {
220 this->id=id;
221 }

◆ idhdl_wrap() [2/2]

idhdl_wrap::idhdl_wrap ( )
inline

Definition at line 222 of file interpreter_support.cc.

223 {
224 id=(idhdl) NULL;
225 }
#define NULL
Definition: omList.c:12
idrec * idhdl
Definition: ring.h:21

Member Function Documentation

◆ id_is_proc()

bool idhdl_wrap::id_is_proc ( )
inline

Definition at line 230 of file interpreter_support.cc.

231 {
232 return (id->typ==PROC_CMD);
233 }
int typ
Definition: idrec.h:43
@ PROC_CMD
Definition: grammar.cc:280

◆ is_zero()

bool idhdl_wrap::is_zero ( )
inline

Definition at line 226 of file interpreter_support.cc.

227 {
228 return id==NULL;
229 }

◆ print_type()

bool idhdl_wrap::print_type ( )
inline

Definition at line 234 of file interpreter_support.cc.

235 {
236 Print("type:%d\n",id->typ);
237 }
#define Print
Definition: emacs.cc:80

◆ writeArray()

void idhdl_wrap::writeArray ( const NumpyArrayType f)
inline

Definition at line 285 of file interpreter_support.cc.

286 {
287 if(id->typ=MATRIX_CMD)
288 {
290 id_Delete((ideal*) &id->data.umatrix,currRing);
291 id->data.umatrix=m;
292 }
293 }
int m
Definition: cfEzgcd.cc:128
FILE * f
Definition: checklibs.c:9
utypes data
Definition: idrec.h:40
@ MATRIX_CMD
Definition: grammar.cc:286
matrix matrixFromArray(const NumpyArrayType &f)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix

◆ writeIdeal()

void idhdl_wrap::writeIdeal ( const Ideal p)
inline

Definition at line 246 of file interpreter_support.cc.

247 {
248 if (id->typ==IDEAL_CMD)
249 {
250 id_Delete(&id->data.uideal, currRing);
251 id->data.uideal=p.as_ideal();
252 }
253 }
int p
Definition: cfModGcd.cc:4078
@ IDEAL_CMD
Definition: grammar.cc:284

◆ writeint()

void idhdl_wrap::writeint ( int  p)
inline

Definition at line 262 of file interpreter_support.cc.

263 {
264 if (id->typ==INT_CMD)
265 {
266 id->data.i=p;
267 }
268 }
@ INT_CMD
Definition: tok.h:96

◆ writeIntvec()

void idhdl_wrap::writeIntvec ( const Intvec iv)
inline

Definition at line 312 of file interpreter_support.cc.

313 {
314 if(id->typ=INTVEC_CMD)
315 {
316 delete id->data.iv;
317 id->data.iv=iv.allocate_legacy_intvec_copy();;
318 }
319 }
intvec * allocate_legacy_intvec_copy() const
Definition: IIntvec.h:21
@ INTVEC_CMD
Definition: tok.h:101

◆ writeList()

void idhdl_wrap::writeList ( arg_list f)
inline

Definition at line 320 of file interpreter_support.cc.

321 {
322 //warning f gets empty
323 if(id->typ=LIST_CMD)
324 {
325 id->data.l->Clean(currRing);
326 id->data.l=f.dumpToLists();
327 }
328 }
@ LIST_CMD
Definition: tok.h:118

◆ writeModule()

void idhdl_wrap::writeModule ( const Module p)
inline

Definition at line 254 of file interpreter_support.cc.

255 {
256 if (id->typ==MODUL_CMD)
257 {
258 id_Delete(&id->data.uideal, currRing);
259 id->data.uideal=p.as_module();
260 }
261 }
@ MODUL_CMD
Definition: grammar.cc:287

◆ writeNumber()

void idhdl_wrap::writeNumber ( const Number p)
inline

Definition at line 269 of file interpreter_support.cc.

270 {
271 if (id->typ==NUMBER_CMD)
272 {
273 n_Delete(&id->data.n, currRing);
274 id->data.n=p.as_number();
275 }
276 }
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:452
@ NUMBER_CMD
Definition: grammar.cc:288

◆ writePoly()

void idhdl_wrap::writePoly ( const Poly p)
inline

Definition at line 238 of file interpreter_support.cc.

239 {
240 if (id->typ==POLY_CMD)
241 {
242 p_Delete(&id->data.p, currRing);
243 id->data.p=p.as_poly();
244 }
245 }
@ POLY_CMD
Definition: grammar.cc:289
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:899

◆ writeRing()

void idhdl_wrap::writeRing ( const Ring r)
inline

Definition at line 294 of file interpreter_support.cc.

295 {
296 if(id->typ=RING_CMD)
297 {
298 r.pimpl->ref++;
299 ((ring) id->data.uring)->ref--;//FIXME: destruct it
300 ring r2=r.pimpl.get();
301 id->data.uring=r2;
302 }
303 }
intrusive_ptr< ip_sring > pimpl
Definition: ring_wrap.h:23
@ RING_CMD
Definition: grammar.cc:281

◆ writeString()

void idhdl_wrap::writeString ( const char *  s)
inline

Definition at line 304 of file interpreter_support.cc.

305 {
306 if(id->typ=STRING_CMD)
307 {
308 omFree((ADDRESS) id->data.ustring);
309 id->data.ustring=omStrDup(s);
310 }
311 }
void * ADDRESS
Definition: auxiliary.h:119
const CanonicalForm int s
Definition: facAbsFact.cc:51
#define omStrDup(s)
Definition: omAllocDecl.h:263
#define omFree(addr)
Definition: omAllocDecl.h:261
@ STRING_CMD
Definition: tok.h:185

◆ writeVector()

void idhdl_wrap::writeVector ( const Vector p)
inline

Definition at line 277 of file interpreter_support.cc.

278 {
279 if (id->typ==VECTOR_CMD)
280 {
281 p_Delete(&id->data.p, currRing);
282 id->data.p=p.as_poly();
283 }
284 }
@ VECTOR_CMD
Definition: grammar.cc:292

Field Documentation

◆ id

idhdl idhdl_wrap::id

Definition at line 217 of file interpreter_support.cc.


The documentation for this class was generated from the following file: