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 325 of file ipprint.cc.

326 {
327  BOOLEAN print=(printlevel>myynest);
328  if ((u->next!=NULL)&&(u->Typ()==INT_CMD))
329  {
330  print= (((int)((long)(u->Data()))) > 0);
331  u=u->next;
332  }
333  if (print)
334  {
335  // BOOLEAN r=FALSE;
336  leftv h=u;
337  leftv hh;
338  while (h!=NULL)
339  {
340  hh=h->next;
341  h->next=NULL;
342  if (jjPRINT(res, h)) return TRUE;
343  PrintS((char*)res->data);
344  omFree(res->data);
345  PrintLn();
346  h->next=hh;
347  h=hh;
348  }
349  }
350  return FALSE;
351 }
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
Definition: gb_hack.h:53
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
void PrintLn()
Definition: reporter.cc:322
Definition: tok.h:85
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
int Typ()
Definition: subexpr.cc:949
void * data
Definition: subexpr.h:89
int myynest
Definition: febase.cc:46
BOOLEAN jjPRINT(leftv res, leftv u)
Definition: ipprint.cc:257
#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:1091
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 257 of file ipprint.cc.

258 {
259  SPrintStart();
260  BOOLEAN bo=FALSE;
261  switch(u->Typ())
262  {
263  case INTVEC_CMD:
264  bo=ipPrint_INTVEC(u);
265  break;
266 
267  case INTMAT_CMD:
268  bo=ipPrint_INTMAT(u);
269  break;
270 
271  case MATRIX_CMD:
272  bo=ipPrint_MA(u);
273  break;
274 
275  case IDEAL_CMD:
276  {
277  char* s = u->String(NULL, FALSE, 2);
278  PrintS(s);
279  PrintLn();
280  omFree(s);
281  break;
282  }
283 
284  case MODUL_CMD:
285  {
287  ipPrint_MA0(m, u->Name());
288  id_Delete((ideal *) &m,currRing);
289  break;
290  }
291 
292  case VECTOR_CMD:
293  bo=ipPrint_V(u);
294  break;
295 
296  case RING_CMD:
297  case QRING_CMD:
298  bo=ipPrint_RING(u);
299  break;
300 
301  #ifdef SINGULAR_4_1
302  case CRING_CMD:
303  bo=ipPrint_CRING(u);
304  break;
305  #endif
306 
307  default:
308  u->Print();
309  break;
310  }
311  char *s=SPrintEnd();
312  if (u->next==NULL)
313  {
314  int l=strlen(s);
315  if (s[l-1]=='\n') s[l-1]='\0';
316  }
317  res->data=(void*)s;
318  return bo;
319 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
void PrintLn()
Definition: reporter.cc:322
#define FALSE
Definition: auxiliary.h:140
ideal id_Copy(ideal h1, const ring r)
static BOOLEAN ipPrint_MA(leftv u)
Definition: ipprint.cc:188
const ideal
Definition: gb_hack.h:42
void id_Delete(ideal *h, ring r)
static BOOLEAN ipPrint_RING(leftv u)
Definition: ipprint.cc:198
static void ipPrint_MA0(matrix m, const char *name)
Definition: ipprint.cc:63
int Typ()
Definition: subexpr.cc:949
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:700
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:231
#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:215
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:1091
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 398 of file ipprint.cc.

399 {
400 /* ==================== betti ======================================== */
401  if ((u->Typ()==INTMAT_CMD)&&(strcmp((char *)v->Data(),"betti")==0))
402  {
403  SPrintStart();
404  ipPrintBetti(u);
405  char *s = SPrintEnd();
406  s[strlen(s)]='\0';
407  res->data=s;
408  }
409  else
410 /* ======================== end betti ================================= */
411  {
412  char* ns = omStrDup((char*) v->Data());
413  int dim = 1;
414  if (strlen(ns) == 3 && ns[1] == '2')
415  {
416  dim = 2;
417  ns[1] = ns[2];
418  ns[2] = '\0';
419  }
420  if (strcmp(ns,"%l") == 0)
421  {
422  res->data = (char*) u->String(NULL, TRUE, dim);
423  if (dim == 2)
424  {
425  char* ns = (char*) omAlloc(strlen((char*) res->data) + 2);
426  strcpy(ns, (char*) res->data);
427  omFree(res->data);
428  strcat(ns, "\n");
429  res->data = ns;
430  }
431  }
432  else if (strcmp(ns,"%t") == 0)
433  {
434  SPrintStart();
435  type_cmd(u);
436  res->data = SPrintEnd();
437  if (dim != 2)
438  ((char*)res->data)[strlen((char*)res->data) -1] = '\0';
439  }
440  else if (strcmp(ns,"%;") == 0)
441  {
442  SPrintStart();
443  u->Print();
444  if (dim == 2) PrintLn();
445  res->data = SPrintEnd();
446  }
447  else if (strcmp(ns,"%p") == 0)
448  {
449  iiExprArith1(res, u, PRINT_CMD);
450  }
451  else if (strcmp(ns,"%b") == 0 && (u->Typ()==INTMAT_CMD))
452  {
453  SPrintStart();
454  ipPrintBetti(u);
455  if (dim == 2) PrintLn();
456  res->data = SPrintEnd();
457  }
458  else
459  {
460  res->data = u->String(NULL, FALSE, dim);
461  if (dim == 2)
462  {
463  char* ns = (char*) omAlloc(strlen((char*) res->data) + 2);
464  strcpy(ns, (char*) res->data);
465  omFree(res->data);
466  strcat(ns, "\n");
467  res->data = ns;
468  }
469  }
470  omFree(ns);
471  }
472  return FALSE;
473 }
Definition: tok.h:124
const CanonicalForm int s
Definition: facAbsFact.cc:55
void PrintLn()
Definition: reporter.cc:322
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:8289
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
void type_cmd(leftv v)
Definition: ipshell.cc:248
int Typ()
Definition: subexpr.cc:949
#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:700
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:353
void * Data()
Definition: subexpr.cc:1091
void SPrintStart()
Definition: reporter.cc:256
#define omStrDup(s)
Definition: omAllocDecl.h:263