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

325 {
326  BOOLEAN print=(printlevel>myynest);
327  if ((u->next!=NULL)&&(u->Typ()==INT_CMD))
328  {
329  print= (((int)((long)(u->Data()))) > 0);
330  u=u->next;
331  }
332  if (print)
333  {
334  // BOOLEAN r=FALSE;
335  leftv h=u;
336  leftv hh;
337  while (h!=NULL)
338  {
339  hh=h->next;
340  h->next=NULL;
341  if (jjPRINT(res, h)) return TRUE;
342  PrintS((char*)res->data);
343  omFree(res->data);
344  PrintLn();
345  h->next=hh;
346  h=hh;
347  }
348  }
349  return FALSE;
350 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
void PrintLn()
Definition: reporter.cc:310
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:95
#define TRUE
Definition: auxiliary.h:99
int Typ()
Definition: subexpr.cc:1004
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:284
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1146
int printlevel
Definition: febase.cc:42
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:86

§ jjPRINT()

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  bo=ipPrint_RING(u);
298  break;
299 
300  #ifdef SINGULAR_4_1
301  case CRING_CMD:
302  bo=ipPrint_CRING(u);
303  break;
304  #endif
305 
306  default:
307  u->Print();
308  break;
309  }
310  char *s=SPrintEnd();
311  if (u->next==NULL)
312  {
313  int l=strlen(s);
314  if (s[l-1]=='\n') s[l-1]='\0';
315  }
316  res->data=(void*)s;
317  return bo;
318 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
void PrintLn()
Definition: reporter.cc:310
#define FALSE
Definition: auxiliary.h:95
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:1004
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:758
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:10
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:42
int m
Definition: cfEzgcd.cc:119
void PrintS(const char *s)
Definition: reporter.cc:284
matrix id_Module2Matrix(ideal mod, const ring R)
static BOOLEAN ipPrint_CRING(leftv u)
Definition: ipprint.cc:215
char * SPrintEnd()
Definition: reporter.cc:273
leftv next
Definition: subexpr.h:87
#define NULL
Definition: omList.c:10
static BOOLEAN ipPrint_INTVEC(leftv u)
Definition: ipprint.cc:31
void * Data()
Definition: subexpr.cc:1146
void SPrintStart()
Definition: reporter.cc:246
int BOOLEAN
Definition: auxiliary.h:86
int l
Definition: cfEzgcd.cc:94

§ jjPRINT_FORMAT()

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

Definition at line 397 of file ipprint.cc.

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