My Project  debian-1:4.1.1-p2+ds-4
Macros | Functions
mod2.h File Reference
#include "singularconfig.h"
#include "misc/auxiliary.h"

Go to the source code of this file.

Macros

#define HAVE_SVD
 
#define VERSION   "4.1.1"
 
#define SINGULAR_MAJOR_VERSION   4
 
#define SINGULAR_MINOR_VERSION   1
 
#define SINGULAR_SUB_VERSION   1
 
#define S_ROOT_DIR   ""
 
#define HAVE_GETTIMEOFDAY   1
 
#define TIME_WITH_SYS_TIME   1
 
#define HAVE_SYS_TIME_H   1
 
#define TIMER_RESOLUTION   1
 
#define SIQ   1
 
#define FAST_AND_DIRTY
 
#define HAVE_EIGENVAL   1
 
#define HAVE_GMS   1
 
#define HAVE_SIMPLEIPC   1
 
#define HAVE_PCV   1
 
#define HAVE_UNITS
 
#define HAVE_LIBPARSER
 
#define PROFILER
 
#define HAVE_SPECTRUM   1
 
#define SINGULAR_PATCHLEVEL   2
 
#define SINGULAR_VERSION   ((SINGULAR_MAJOR_VERSION*1000 + SINGULAR_MINOR_VERSION*100 + SINGULAR_SUB_VERSION*10)+SINGULAR_PATCHLEVEL)
 
#define YYLPDEBUG   1
 
#define SEEK_END   2
 
#define SEEK_SET   0
 
#define LINKAGE
 
#define NO_INLINE
 
#define MDEBUG   0
 
#define OM_TRACK   4
 
#define OM_CHECK   1
 
#define OM_KEEP   0
 
#define OM_SING_KEEP   1000
 
#define KDEBUG   0
 
#define LDEBUG
 
#define RDEBUG
 
#define TEST
 
#define YYDEBUG   1
 
#define assume_violation(s, f, l)   dReportError("assume violation at %s:%d condition: %s", f,l,s)
 
#define assume(x)   _assume(x, __FILE__, __LINE__)
 
#define r_assume(x)   _r_assume(x, __FILE__, __LINE__)
 
#define _assume(x, f, l)
 
#define _r_assume(x, f, l)
 
#define __attribute__(x)   /*NOTHING*/
 
#define STRINGIFY(name)   #name
 
#define EXPANDED_STRINGIFY(name)   STRINGIFY(name)
 

Functions

void m2_end (int i)
 
static void HALT ()
 
int dReportError (const char *fmt,...)
 
void dErrorBreak ()
 

Macro Definition Documentation

◆ __attribute__

#define __attribute__ (   x)    /*NOTHING*/

Definition at line 424 of file mod2.h.

◆ _assume

#define _assume (   x,
  f,
  l 
)
Value:
do \
{ \
if (! (x)) \
{ \
assume_violation(#x, f, l); \
} \
} \
while (0)

Definition at line 387 of file mod2.h.

◆ _r_assume

#define _r_assume (   x,
  f,
  l 
)
Value:
do \
{ \
if (! (x)) \
{ \
assume_violation(#x, f, l); \
return 0; \
} \
} \
while (0)

Definition at line 397 of file mod2.h.

◆ assume

#define assume (   x)    _assume(x, __FILE__, __LINE__)

Definition at line 384 of file mod2.h.

◆ assume_violation

#define assume_violation (   s,
  f,
  l 
)    dReportError("assume violation at %s:%d condition: %s", f,l,s)

Definition at line 381 of file mod2.h.

◆ EXPANDED_STRINGIFY

#define EXPANDED_STRINGIFY (   name)    STRINGIFY(name)

Definition at line 428 of file mod2.h.

◆ FAST_AND_DIRTY

#define FAST_AND_DIRTY

Definition at line 38 of file mod2.h.

◆ HAVE_EIGENVAL

#define HAVE_EIGENVAL   1

Definition at line 41 of file mod2.h.

◆ HAVE_GETTIMEOFDAY

#define HAVE_GETTIMEOFDAY   1

Definition at line 27 of file mod2.h.

◆ HAVE_GMS

#define HAVE_GMS   1

Definition at line 44 of file mod2.h.

◆ HAVE_LIBPARSER

#define HAVE_LIBPARSER

Definition at line 65 of file mod2.h.

◆ HAVE_PCV

#define HAVE_PCV   1

Definition at line 51 of file mod2.h.

◆ HAVE_SIMPLEIPC

#define HAVE_SIMPLEIPC   1

Definition at line 47 of file mod2.h.

◆ HAVE_SPECTRUM

#define HAVE_SPECTRUM   1

Definition at line 77 of file mod2.h.

◆ HAVE_SVD

#define HAVE_SVD

Definition at line 14 of file mod2.h.

◆ HAVE_SYS_TIME_H

#define HAVE_SYS_TIME_H   1

Definition at line 29 of file mod2.h.

◆ HAVE_UNITS

#define HAVE_UNITS

Definition at line 62 of file mod2.h.

◆ KDEBUG

#define KDEBUG   0

Definition at line 300 of file mod2.h.

◆ LDEBUG

#define LDEBUG

Definition at line 303 of file mod2.h.

◆ LINKAGE

#define LINKAGE

Definition at line 137 of file mod2.h.

◆ MDEBUG

#define MDEBUG   0

Definition at line 176 of file mod2.h.

◆ NO_INLINE

#define NO_INLINE

Definition at line 149 of file mod2.h.

◆ OM_CHECK

#define OM_CHECK   1

Definition at line 274 of file mod2.h.

◆ OM_KEEP

#define OM_KEEP   0

Definition at line 280 of file mod2.h.

◆ OM_SING_KEEP

#define OM_SING_KEEP   1000

Definition at line 286 of file mod2.h.

◆ OM_TRACK

#define OM_TRACK   4

Definition at line 270 of file mod2.h.

◆ PROFILER

#define PROFILER

Definition at line 71 of file mod2.h.

◆ r_assume

#define r_assume (   x)    _r_assume(x, __FILE__, __LINE__)

Definition at line 385 of file mod2.h.

◆ RDEBUG

#define RDEBUG

Definition at line 305 of file mod2.h.

◆ S_ROOT_DIR

#define S_ROOT_DIR   ""

Definition at line 21 of file mod2.h.

◆ SEEK_END

#define SEEK_END   2

Definition at line 108 of file mod2.h.

◆ SEEK_SET

#define SEEK_SET   0

Definition at line 112 of file mod2.h.

◆ SINGULAR_MAJOR_VERSION

#define SINGULAR_MAJOR_VERSION   4

Definition at line 18 of file mod2.h.

◆ SINGULAR_MINOR_VERSION

#define SINGULAR_MINOR_VERSION   1

Definition at line 19 of file mod2.h.

◆ SINGULAR_PATCHLEVEL

#define SINGULAR_PATCHLEVEL   2

Definition at line 84 of file mod2.h.

◆ SINGULAR_SUB_VERSION

#define SINGULAR_SUB_VERSION   1

Definition at line 20 of file mod2.h.

◆ SINGULAR_VERSION

Definition at line 85 of file mod2.h.

◆ SIQ

#define SIQ   1

Definition at line 35 of file mod2.h.

◆ STRINGIFY

#define STRINGIFY (   name)    #name

Definition at line 427 of file mod2.h.

◆ TEST

#define TEST

Definition at line 307 of file mod2.h.

◆ TIME_WITH_SYS_TIME

#define TIME_WITH_SYS_TIME   1

Definition at line 28 of file mod2.h.

◆ TIMER_RESOLUTION

#define TIMER_RESOLUTION   1

Definition at line 32 of file mod2.h.

◆ VERSION

#define VERSION   "4.1.1"

Definition at line 17 of file mod2.h.

◆ YYDEBUG

#define YYDEBUG   1

Definition at line 312 of file mod2.h.

◆ YYLPDEBUG

#define YYLPDEBUG   1

Definition at line 92 of file mod2.h.

Function Documentation

◆ dErrorBreak()

void dErrorBreak ( )

Definition at line 139 of file dError.cc.

142 {}

◆ dReportError()

int dReportError ( const char *  fmt,
  ... 
)

Definition at line 43 of file dError.cc.

43 {
44 
45 int dReportError(const char* fmt, ...)
46 {
47 #if 0
48 #ifdef HAVE_EXECINFO_H
49 #define SIZE 50
50  void *buffer[SIZE+1]; int ret;
51 #endif
52 #endif
53 
54  va_list ap;
55  va_start(ap, fmt);
56 #ifndef MAKE_DISTRIBUTION
57  fprintf(stderr, "\n// ***dError: ");
58  vfprintf(stderr, fmt, ap);
59 #if !defined(OM_NDEBUG)
60  #ifdef omPrintCurrentBackTraceMax
61  fprintf(stderr, " occurred at: \n");
62  omPrintCurrentBackTraceMax(stderr, 8);
63  #endif
64 #endif
65 
66 #if 0
67 #ifdef HAVE_EXECINFO_H
68  ret = backtrace( buffer, SIZE ); // execinfo.h
69  fprintf(stderr, "\nExecinfo backtrace (with %zd stack frames): \n", ret);
70 
71 #ifndef HAVE_GCC_ABI_DEMANGLE
72  backtrace_symbols_fd(buffer, ret, STDERR_FILENO); // execinfo.h
73 #else
74  char **ptr = backtrace_symbols( buffer, ret ); // execinfo.h
75 
76  int status;
77  char *demangledName;
78  char *s;
79  char *ss;
80  for (int i = 0; i < ret; i++)
81  {
82  status = -1;
83 
84  s = ptr[i];
85 // fprintf (stderr, " #%02d: %s\n", i, s);
86 
87  ss = index(s, '(');
88  ss[0] = 0;
89  fprintf (stderr, " #%02d: '%s': ", i, s);
90  ss[0] = '('; s = ss + 1;
91 
92  ss = index(s, '+');
93 
94  if ( ss != NULL )
95  {
96  ss[0] = 0;
97  demangledName = abi::__cxa_demangle( s, NULL, NULL, &status ); // cxxabi.h!
98  if( status == 0 && demangledName != NULL )
99  fprintf (stderr, " '%s'", (demangledName[0] != 0)? demangledName: s);
100  else
101  fprintf (stderr, " '%s'", s);
102 
103  malloc_free( demangledName );
104  ss[0] = '+';
105  s = ss + 1;
106  }
107 
108  ss = index(s, ')');
109  if( s != ss)
110  {
111  ss[0] = 0;
112  fprintf (stderr, " + %s", s);
113  ss[0] = ')';
114  }
115 
116  fprintf (stderr, " %s\n", ss + 2);
117  }
118  malloc_free (ptr);
119 #endif
120 #endif
121 
122 #undef SIZE
123 #endif
124 
125  dErrorBreak();
126 #else
127  fprintf(stderr, "\n// !!! YOU HAVE FOUND A BUG IN SINGULAR.");
128  fprintf(stderr, "// !!! Please, email the input\n// and the following error message to singular@mathematik.uni-kl.de")
129  vfprintf(stderr, fmt, ap);
130 #endif

◆ HALT()

static void HALT ( )
inlinestatic

Definition at line 123 of file mod2.h.

127 { m2_end(2);}

◆ m2_end()

void m2_end ( int  i)

Definition at line 1099 of file misc_ip.cc.

1100 {
1101  if (!m2_end_called)
1102  {
1103  extern FILE* File_Profiling;
1105  m2_end_called = TRUE;
1106 #ifdef HAVE_SIMPLEIPC
1107  for (int j = SIPC_MAX_SEMAPHORES-1; j >= 0; j--)
1108  {
1109  if (semaphore[j] != NULL)
1110  {
1111  while (sem_acquired[j] > 0)
1112  {
1113 #if PORTABLE_SEMAPHORES
1114  sem_post(semaphore[j]->sig);
1115 #else
1116  sem_post(semaphore[j]);
1117 #endif
1118  sem_acquired[j]--;
1119  }
1120  }
1121  }
1122 #endif // HAVE_SIMPLEIPC
1124  monitor(NULL,0);
1125 #ifdef PAGE_TEST
1126  mmEndStat();
1127 #endif
1130  {
1132  while(hh!=NULL)
1133  {
1134  //Print("close %s\n",hh->l->name);
1135  slPrepClose(hh->l);
1136  hh=(link_list)hh->next;
1137  }
1139 
1140  idhdl h = currPack->idroot;
1141  while(h != NULL)
1142  {
1143  if(IDTYP(h) == LINK_CMD)
1144  {
1145  idhdl hh=h->next;
1146  //Print("kill %s\n",IDID(h));
1147  killhdl(h, currPack);
1148  h = hh;
1149  }
1150  else
1151  {
1152  h = h->next;
1153  }
1154  }
1155  hh=ssiToBeClosed;
1156  while(hh!=NULL)
1157  {
1158  //Print("close %s\n",hh->l->name);
1159  slClose(hh->l);
1160  hh=ssiToBeClosed;
1161  }
1162  }
1163  if (!singular_in_batchmode)
1164  {
1165  if (i<=0)
1166  {
1167  //extern long all_farey;
1168  //extern long farey_cnt;
1169  //if (all_farey!=0L) printf("farey:%ld, cnt=%ld\n",all_farey,farey_cnt);
1170  if (TEST_V_QUIET)
1171  {
1172  if (i==0)
1173  printf("Auf Wiedersehen.\n");
1174  else
1175  printf("\n$Bye.\n");
1176  }
1177  //#ifdef sun
1178  // #ifndef __svr4__
1179  // _cleanup();
1180  // _exit(0);
1181  // #endif
1182  //#endif
1183  i=0;
1184  }
1185  else
1186  {
1187  printf("\nhalt %d\n",i);
1188  }
1189  }
1190  exit(i);
1191  }
1192 }
dErrorBreak
void dErrorBreak()
Definition: dError.cc:139
FALSE
#define FALSE
Definition: auxiliary.h:94
j
int j
Definition: facHensel.cc:105
status
int * status
Definition: si_signals.h:50
f
FILE * f
Definition: checklibs.c:9
semaphore
sipc_sem_t * semaphore[SIPC_MAX_SEMAPHORES]
Definition: semaphore.c:24
x
Variable x
Definition: cfModGcd.cc:4023
m2_end_called
volatile BOOLEAN m2_end_called
Definition: misc_ip.cc:1097
currPack
package currPack
Definition: ipid.cc:58
File_Profiling
FILE * File_Profiling
Definition: fevoices.cc:32
m2_end
void m2_end(int i)
Definition: misc_ip.cc:1099
ap
Definition: ap.h:35
singular_in_batchmode
BOOLEAN singular_in_batchmode
Definition: cntrlc.cc:67
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
monitor
void monitor(void *F, int mode)
Definition: febase.cc:66
h
static Poly * h
Definition: janet.cc:972
dReportError
int dReportError(const char *fmt,...)
Definition: dError.cc:43
killhdl
void killhdl(idhdl h, package proot)
Definition: ipid.cc:375
IDTYP
#define IDTYP(a)
Definition: ipid.h:113
idrec
Definition: idrec.h:33
malloc_free
static void malloc_free(void *ptr)
Definition: dError.cc:22
SIPC_MAX_SEMAPHORES
#define SIPC_MAX_SEMAPHORES
Definition: simpleipc.h:10
NULL
#define NULL
Definition: omList.c:9
l
int l
Definition: cfEzgcd.cc:93
omPrintCurrentBackTraceMax
int omPrintCurrentBackTraceMax(FILE *fd, int max)
Definition: omRet2Info.c:164
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
fe_reset_input_mode
void fe_reset_input_mode()
Definition: fereadl.c:824
index
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:585
LINK_CMD
Definition: tok.h:116
TEST_V_QUIET
#define TEST_V_QUIET
Definition: options.h:130
sem_acquired
int sem_acquired[SIPC_MAX_SEMAPHORES]
Definition: semaphore.c:25