Typedefs | Functions
ipprint.h File Reference
#include <kernel/structs.h>

Go to the source code of this file.

Typedefs

typedef sleftvleftv
 

Functions

BOOLEAN jjPRINT (leftv res, leftv u)
 
BOOLEAN jjPRINT_FORMAT (leftv res, leftv u, leftv v)
 
BOOLEAN jjDBPRINT (leftv res, leftv u)
 

Typedef Documentation

typedef sleftv* leftv

Definition at line 11 of file ipprint.h.

Function Documentation

BOOLEAN jjDBPRINT ( leftv  res,
leftv  u 
)

Definition at line 326 of file ipprint.cc.

327 {
328  BOOLEAN print=(printlevel>myynest);
329  if ((u->next!=NULL)&&(u->Typ()==INT_CMD))
330  {
331  print= (((int)((long)(u->Data()))) > 0);
332  u=u->next;
333  }
334  if (print)
335  {
336  // BOOLEAN r=FALSE;
337  leftv h=u;
338  leftv hh;
339  while (h!=NULL)
340  {
341  hh=h->next;
342  h->next=NULL;
343  if (jjPRINT(res, h)) return TRUE;
344  PrintS((char*)res->data);
345  omFree(res->data);
346  PrintLn();
347  h->next=hh;
348  h=hh;
349  }
350  }
351  return FALSE;
352 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
void PrintLn()
Definition: reporter.cc:327
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
int Typ()
Definition: subexpr.cc:969
void * data
Definition: subexpr.h:89
int myynest
Definition: febase.cc:46
BOOLEAN jjPRINT(leftv res, leftv u)
Definition: ipprint.cc:258
#define omFree(addr)
Definition: omAllocDecl.h:261
void PrintS(const char *s)
Definition: reporter.cc:294
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1111
int printlevel
Definition: febase.cc:42
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
BOOLEAN jjPRINT ( leftv  res,
leftv  u 
)

Definition at line 258 of file ipprint.cc.

259 {
260  SPrintStart();
261  BOOLEAN bo=FALSE;
262  switch(u->Typ())
263  {
264  case INTVEC_CMD:
265  bo=ipPrint_INTVEC(u);
266  break;
267 
268  case INTMAT_CMD:
269  bo=ipPrint_INTMAT(u);
270  break;
271 
272  case MATRIX_CMD:
273  bo=ipPrint_MA(u);
274  break;
275 
276  case IDEAL_CMD:
277  {
278  char* s = u->String(NULL, FALSE, 2);
279  PrintS(s);
280  PrintLn();
281  omFree(s);
282  break;
283  }
284 
285  case MODUL_CMD:
286  {
288  ipPrint_MA0(m, u->Name());
289  id_Delete((ideal *) &m,currRing);
290  break;
291  }
292 
293  case VECTOR_CMD:
294  bo=ipPrint_V(u);
295  break;
296 
297  case RING_CMD:
298  case QRING_CMD:
299  bo=ipPrint_RING(u);
300  break;
301 
302  #ifdef SINGULAR_4_1
303  case CRING_CMD:
304  bo=ipPrint_CRING(u);
305  break;
306  #endif
307 
308  default:
309  u->Print();
310  break;
311  }
312  char *s=SPrintEnd();
313  if (u->next==NULL)
314  {
315  int l=strlen(s);
316  if (s[l-1]=='\n') s[l-1]='\0';
317  }
318  res->data=(void*)s;
319  return bo;
320 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
void PrintLn()
Definition: reporter.cc:327
#define FALSE
Definition: auxiliary.h:140
ideal id_Copy(ideal h1, const ring r)
copy an ideal
static BOOLEAN ipPrint_MA(leftv u)
Definition: ipprint.cc:189
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
static BOOLEAN ipPrint_RING(leftv u)
Definition: ipprint.cc:199
static void ipPrint_MA0(matrix m, const char *name)
Definition: ipprint.cc:63
int Typ()
Definition: subexpr.cc:969
const char * Name()
Definition: subexpr.h:121
void Print(leftv store=NULL, int spaces=0)
Called by type_cmd (e.g. "r;") or as default in jPRINT.
Definition: subexpr.cc:73
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
Definition: subexpr.cc:720
void * data
Definition: subexpr.h:89
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: tok.h:56
static BOOLEAN ipPrint_V(leftv u)
Definition: ipprint.cc:232
#define omFree(addr)
Definition: omAllocDecl.h:261
static BOOLEAN ipPrint_INTMAT(leftv u)
Definition: ipprint.cc:45
int m
Definition: cfEzgcd.cc:119
void PrintS(const char *s)
Definition: reporter.cc:294
matrix id_Module2Matrix(ideal mod, const ring R)
Definition: tok.h:88
static BOOLEAN ipPrint_CRING(leftv u)
Definition: ipprint.cc:216
char * SPrintEnd()
Definition: reporter.cc:283
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
static BOOLEAN ipPrint_INTVEC(leftv u)
Definition: ipprint.cc:34
void * Data()
Definition: subexpr.cc:1111
void SPrintStart()
Definition: reporter.cc:256
Definition: tok.h:126
int BOOLEAN
Definition: auxiliary.h:131
int l
Definition: cfEzgcd.cc:94
BOOLEAN jjPRINT_FORMAT ( leftv  res,
leftv  u,
leftv  v 
)

Definition at line 399 of file ipprint.cc.

400 {
401 /* ==================== betti ======================================== */
402  if ((u->Typ()==INTMAT_CMD)&&(strcmp((char *)v->Data(),"betti")==0))
403  {
404  SPrintStart();
405  ipPrintBetti(u);
406  char *s = SPrintEnd();
407  s[strlen(s)]='\0';
408  res->data=s;
409  }
410  else
411 /* ======================== end betti ================================= */
412  {
413  char* ns = omStrDup((char*) v->Data());
414  int dim = 1;
415  if (strlen(ns) == 3 && ns[1] == '2')
416  {
417  dim = 2;
418  ns[1] = ns[2];
419  ns[2] = '\0';
420  }
421  if (strcmp(ns,"%l") == 0)
422  {
423  res->data = (char*) u->String(NULL, TRUE, dim);
424  if (dim == 2)
425  {
426  char* ns = (char*) omAlloc(strlen((char*) res->data) + 2);
427  strcpy(ns, (char*) res->data);
428  omFree(res->data);
429  strcat(ns, "\n");
430  res->data = ns;
431  }
432  }
433  else if (strcmp(ns,"%t") == 0)
434  {
435  SPrintStart();
436  type_cmd(u);
437  res->data = SPrintEnd();
438  if (dim != 2)
439  ((char*)res->data)[strlen((char*)res->data) -1] = '\0';
440  }
441  else if (strcmp(ns,"%;") == 0)
442  {
443  SPrintStart();
444  u->Print();
445  if (dim == 2) PrintLn();
446  res->data = SPrintEnd();
447  }
448  else if (strcmp(ns,"%p") == 0)
449  {
450  iiExprArith1(res, u, PRINT_CMD);
451  }
452  else if (strcmp(ns,"%b") == 0 && (u->Typ()==INTMAT_CMD))
453  {
454  SPrintStart();
455  ipPrintBetti(u);
456  if (dim == 2) PrintLn();
457  res->data = SPrintEnd();
458  }
459  else
460  {
461  res->data = u->String(NULL, FALSE, dim);
462  if (dim == 2)
463  {
464  char* ns = (char*) omAlloc(strlen((char*) res->data) + 2);
465  strcpy(ns, (char*) res->data);
466  omFree(res->data);
467  strcat(ns, "\n");
468  res->data = ns;
469  }
470  }
471  omFree(ns);
472  }
473  return FALSE;
474 }
Definition: tok.h:124
const CanonicalForm int s
Definition: facAbsFact.cc:55
void PrintLn()
Definition: reporter.cc:327
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8330
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void type_cmd(leftv v)
Definition: ipshell.cc:251
int Typ()
Definition: subexpr.cc:969
#define omAlloc(size)
Definition: omAllocDecl.h:210
void Print(leftv store=NULL, int spaces=0)
Called by type_cmd (e.g. "r;") or as default in jPRINT.
Definition: subexpr.cc:73
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
Definition: subexpr.cc:720
void * data
Definition: subexpr.h:89
#define omFree(addr)
Definition: omAllocDecl.h:261
int dim(ideal I, ring r)
char * SPrintEnd()
Definition: reporter.cc:283
#define NULL
Definition: omList.c:10
static void ipPrintBetti(leftv u)
Definition: ipprint.cc:354
void * Data()
Definition: subexpr.cc:1111
void SPrintStart()
Definition: reporter.cc:256
#define omStrDup(s)
Definition: omAllocDecl.h:263