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

§ leftv

typedef sleftv* leftv

Definition at line 11 of file ipprint.h.

Function Documentation

§ jjDBPRINT()

BOOLEAN jjDBPRINT ( leftv  res,
leftv  u 
)

Definition at line 322 of file ipprint.cc.

323 {
324  BOOLEAN print=(printlevel>myynest);
325  if ((u->next!=NULL)&&(u->Typ()==INT_CMD))
326  {
327  print= (((int)((long)(u->Data()))) > 0);
328  u=u->next;
329  }
330  if (print)
331  {
332  // BOOLEAN r=FALSE;
333  leftv h=u;
334  leftv hh;
335  while (h!=NULL)
336  {
337  hh=h->next;
338  h->next=NULL;
339  if (jjPRINT(res, h)) return TRUE;
340  PrintS((char*)res->data);
341  omFree(res->data);
342  PrintLn();
343  h->next=hh;
344  h=hh;
345  }
346  }
347  return FALSE;
348 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
void PrintLn()
Definition: reporter.cc:310
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
int myynest
Definition: febase.cc:46
BOOLEAN jjPRINT(leftv res, leftv u)
Definition: ipprint.cc:255
#define omFree(addr)
Definition: omAllocDecl.h:261
void PrintS(const char *s)
Definition: reporter.cc:284
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
int printlevel
Definition: febase.cc:42
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88

§ jjPRINT()

BOOLEAN jjPRINT ( leftv  res,
leftv  u 
)

Definition at line 255 of file ipprint.cc.

256 {
257  SPrintStart();
258  BOOLEAN bo=FALSE;
259  switch(u->Typ())
260  {
261  case INTVEC_CMD:
262  bo=ipPrint_INTVEC(u);
263  break;
264 
265  case INTMAT_CMD:
266  bo=ipPrint_INTMAT(u);
267  break;
268 
269  case MATRIX_CMD:
270  bo=ipPrint_MA(u);
271  break;
272 
273  case IDEAL_CMD:
274  {
275  char* s = u->String(NULL, FALSE, 2);
276  PrintS(s);
277  PrintLn();
278  omFree(s);
279  break;
280  }
281 
282  case MODUL_CMD:
283  {
285  ipPrint_MA0(m, u->Name());
286  id_Delete((ideal *) &m,currRing);
287  break;
288  }
289 
290  case VECTOR_CMD:
291  bo=ipPrint_V(u);
292  break;
293 
294  case RING_CMD:
295  bo=ipPrint_RING(u);
296  break;
297 
298  #ifdef SINGULAR_4_1
299  case CRING_CMD:
300  bo=ipPrint_CRING(u);
301  break;
302  #endif
303 
304  default:
305  u->Print();
306  break;
307  }
308  char *s=SPrintEnd();
309  if (u->next==NULL)
310  {
311  int l=strlen(s);
312  if (s[l-1]=='\n') s[l-1]='\0';
313  }
314  res->data=(void*)s;
315  return bo;
316 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
void PrintLn()
Definition: reporter.cc:310
#define FALSE
Definition: auxiliary.h:97
ideal id_Copy(ideal h1, const ring r)
copy an ideal
static BOOLEAN ipPrint_MA(leftv u)
Definition: ipprint.cc:186
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
static BOOLEAN ipPrint_RING(leftv u)
Definition: ipprint.cc:196
static void ipPrint_MA0(matrix m, const char *name)
Definition: ipprint.cc:60
int Typ()
Definition: subexpr.cc:979
const char * Name()
Definition: subexpr.h:122
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:723
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
Definition: tok.h:55
static BOOLEAN ipPrint_V(leftv u)
Definition: ipprint.cc:229
#define omFree(addr)
Definition: omAllocDecl.h:261
static BOOLEAN ipPrint_INTMAT(leftv u)
Definition: ipprint.cc:42
int m
Definition: cfEzgcd.cc:119
void PrintS(const char *s)
Definition: reporter.cc:284
matrix id_Module2Matrix(ideal mod, const ring R)
Definition: tok.h:99
static BOOLEAN ipPrint_CRING(leftv u)
Definition: ipprint.cc:213
char * SPrintEnd()
Definition: reporter.cc:273
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
static BOOLEAN ipPrint_INTVEC(leftv u)
Definition: ipprint.cc:31
void * Data()
Definition: subexpr.cc:1121
void SPrintStart()
Definition: reporter.cc:246
int BOOLEAN
Definition: auxiliary.h:88
int l
Definition: cfEzgcd.cc:94

§ jjPRINT_FORMAT()

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

Definition at line 395 of file ipprint.cc.

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