source: git/kernel/mod2.h @ 95330f

fieker-DuValspielwiese
Last change on this file since 95330f was 95330f, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Switched-off suspicious kernel's functionality: eigenvals and gms NOTE: it seems that kernel's eigenval&gms are not tested in master and may produce wrong results (see https://github.com/Singular/Sources/issues/336) Suspicious tests include: Manual/fouriersystem.tst, Manual/Gauss-Manin_connection_1.tst, Manual/goodBasis.tst, Manual/monodromy.tst, Manual/qepcadsystem.tst, Manual/spectrum.tst, Manual/sppairs.tst, Manual/tmatrix.tst, Manual/vfilt.tst, Manual/vwfilt.tst + the following which run out of time: Manual/Gauss-Manin_connection.tst, Manual/monodromyB.tst, Manual/bernstein.tst, Short/gaussm_ex.tst, Short/monodromy_s.tst
  • Property mode set to 100644
File size: 13.3 KB
Line 
1/* -*-c++-*- */
2/*******************************************************************
3 *  Computer Algebra System SINGULAR
4 *
5 *  mod2.h: Main configuration file for Singular
6 *          DO NOT EDIT!
7 *
8 *******************************************************************/
9#ifndef MOD2_H
10#define MOD2_H
11
12#include <misc/auxiliary.h>
13
14#define SINGULAR_MAJOR_VERSION 0
15#define SINGULAR_MINOR_VERSION 0
16#define SINGULAR_SUB_VERSION 0
17#define S_ROOT_DIR ""
18
19/* Define version date as a string - temporarily*/
20#define S_VERSION2 ""
21
22/*******************************************************************
23 * Defines which are not set by configure
24 ******************************************************************/
25
26/*defines, which should be set by configure */
27#define HAVE_GETTIMEOFDAY 1
28#define TIME_WITH_SYS_TIME 1
29#define HAVE_SYS_TIME_H 1
30#define PROC_BUG 1
31/* Default value for timer resolution in ticks per second */
32/* set to 10 for resolution of tenth of a second, etc */
33#define TIMER_RESOLUTION 1
34
35/* Undefine to disable the quote/eval of expressions */
36#define SIQ 1
37
38/* Undefine to disable Gerhard's and Wilfried's fast and dirty std computations */
39#define FAST_AND_DIRTY
40
41#if 0
42/* defined(HAVE_DYNAMIC_LOADING)? TODO: the following features are not tested in legacy Singular! :( */
43
44/* eigenvalues */
45#define HAVE_EIGENVAL 1
46
47/* Gauss-Manin system */
48#define HAVE_GMS 1
49
50#endif
51
52/* linear algebra extensions from pcv.h/pcv.cc */
53#define HAVE_PCV 1
54
55/* procedures to compute groebner bases with the f5 implementation */
56/* still testing */
57#undef HAVE_F5
58
59/* procedures to compute groebner bases with the f5c implementation */
60/* still testing */
61#undef HAVE_F5C
62
63/* procedures to compute with units */
64#define HAVE_UNITS
65
66/* Define to use scanner when loading libraries */
67#define HAVE_LIBPARSER
68
69/*#define PROFILING*/
70#ifdef PROFILING
71#define PROFILER ,0,0
72#else
73#define PROFILER
74#endif
75
76/*******************************************************************
77 * Evaluate the set defines
78 ******************************************************************/
79/* Spectrum needs GMP */
80#define HAVE_SPECTRUM 1
81
82#if SIZEOF_VOIDP == 8
83/* SIZEOF_LONG == SIZEOF_VOIDP is guaranteed by configure */
84#define ALIGN_8
85#endif
86
87#define SINGULAR_PATCHLEVEL 0
88#define SINGULAR_VERSION ((SINGULAR_MAJOR_VERSION*1000 + SINGULAR_MINOR_VERSION*100 + SINGULAR_SUB_VERSION*10)+SINGULAR_PATCHLEVEL)
89
90/*******************************************************************
91 * Miscellanous Defines
92 ******************************************************************/
93#ifndef HAVE_LIBPARSER
94#  undef YYLPDEBUG
95#else
96#  define YYLPDEBUG 1
97#endif
98
99#ifndef FALSE
100#define FALSE       0
101#endif
102
103#ifndef TRUE
104#define TRUE        1
105#endif
106
107#ifndef NULL
108#define NULL        (0)
109#endif
110
111#ifndef SEEK_END
112#define SEEK_END 2
113#endif
114
115#ifndef SEEK_SET
116#define SEEK_SET 0
117#endif
118
119#define HALT() m2_end(2)
120
121/* define OLD_RES for res/sres/mres(i,j,k) */
122#undef OLD_RES
123
124/* the maximal ascii length of an int number + 1 = 11 for 32 bit int */
125/* #define MAX_INT_LEN 11 */
126
127
128#ifdef DO_PROFILE
129/* define to enable explicit profiling of some crucial inline
130 * routines and defines  */
131#undef DO_DEEP_PROFILE
132#endif
133
134/* define to enable assume */
135#ifndef HAVE_ASSUME
136#undef HAVE_ASSUME
137#endif
138
139/* define LINKAGE to "extern C" if compiling for shared libs */
140#ifndef LINKAGE
141#if defined(PIC)
142#define LINKAGE extern "C"
143#else
144#define LINKAGE
145#endif
146#endif
147
148
149/*******************************************************************
150 * DEBUG OPTIONS
151 * -- only significant for for compiling without -DNDEBUG
152 * -- you better know what your are doing, if you touch this
153 ******************************************************************/
154#ifndef NDEBUG
155
156/* undefine to enable inline */
157#define NO_INLINE
158
159/* undefine to disable assume -- should normally be defined for NDEBUG */
160#define HAVE_ASSUME
161
162/* undef PDEBUG to disable checks of polys
163
164 define PDEBUG to
165  0 for enabling pTest
166  1 plus tests in Level 1 poly routines (operations on monomials)
167  2 plus tests in Level 2 poly routines (operations on single exponents)
168 -- see also polys.h for more info
169
170 NOTE: you can set the value of PDEBUG on a per-file basis, before
171       including mod2.h, provided ! PDEBUG is defined in mod2.h E.g.:
172
173       #define PDEBUG 2
174       #include "mod2.h"
175       ...
176
177       makes sure that all poly operations in your file are done with
178       PDEBUG == 2
179 To break after an error occured, set a debugger breakpoint on
180 dErrorBreak.
181*/
182#ifndef PDEBUG
183#define PDEBUG 0
184#endif
185
186/* define MDEBUG to enable memory checks */
187#define MDEBUG 0
188
189#ifdef MDEBUG
190/* If ! defined(OM_NDEBUG) and (defined(OM_TRACK) or defined(OM_CHECK)
191   then omDebug routines are used for memory allocation/free:
192
193   The omDebug routines are controlled by the values of OM_TRACK, OM_CHECK
194   and OM_KEEP.  There meaning is roughly as follows:
195   OM_TRACK: strored with address                              : extra space
196     0     : no additional info is stored                      : 0
197     1     : file:line of location where address was allocated : 1 word
198     2     : plus backtrace of stack where adress was allocated: 6 words
199     3     : plus size/bin info and front-, and back padding   : 9 words
200     4     : plus file:line of location where adress was freed : 10 words
201     5     : plus backtrace of stack where adress was allocated: 15 words
202   OM_CHECK: checks done
203     0     : no checks
204     1     : constant-time checks: i.e. addr checks only
205     2     : plus linear-time checks and constant related bin check
206     3     : plus quadratic-time checks and linear-time related bin checks and
207             constant time all memory checks
208     4     : and so on
209     ==> for OM_CHECK >= 3 it gets rather slow
210   OM_KEEP:  determines whether addresses are really freed  (
211     0     : addresses are really freed
212     1     : addresses are only marked as free and not really freed.
213
214   OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis
215   (as can OM_NDEBUG),  e.g.:
216     #define OM_CHECK 3
217     #define OM_TRACK 5
218     #define OM_KEEP  1
219     #include "mod2.h"
220     #include <omalloc/omalloc.h>
221   ensures that all memory allocs/free in this file are done with
222   OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed
223   in this file are only marked as free and never really freed.
224 
225   To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set
226   om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and
227   om_Opts.Keep to the number of addresses which are kept before they are
228   actually freed. E.g.:
229     int check=om_Opts.MinCheck, track=om_Opts.MinTrack, keep= m_OPts.Keep;
230     om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
231     ExternalRoutine();
232     om_Opts.MinCheck = check; omOpts.MinTrack = track; omOpts.Keep = keep;
233   ensures that all calls omDebug routines  occuring during the computation of
234   ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and
235   calls to omFree only mark addresses as free and not really free them.
236
237   Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies
238   how many addresses are kept before they are actually freed, independently
239   of the value of OM_KEEP.
240
241   Some tips on possible values of OM_TRACK, OM_CHECK, OM_KEEP:
242   + To find out about an address that has been freed twice, first locate the
243     file(s) where the error occured, and then at the beginning of these files:
244       #define OM_CHECK 3
245       #define OM_TRACK 5
246       #define OM_KEEP  1
247       #include "mod2.h"
248       #include <omalloc/omalloc.h>
249     Under dynamic scope, do (e.g., from within the debugger):
250       om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
251   + to find out where "memory corruption" occured, increase value of
252     OM_CHECK - the higher this value is, the more consistency checks are
253     done (However a value > 3 checks the entire memory each time an omalloc
254     routine is used!)
255   
256   Some more tips on the usage of omalloc:
257   + omAlloc*, omRealloc*, omFree*, omCheck* omDebug* omTest* rotuines
258     assume that sizes are > 0 and pointers are != NULL
259   + omalloc*, omrealloc*, omfree* omcheck*, omdebug* omtest* routines allow
260     NULL pointers and sizes == 0
261   + You can safely use any free/realloc routine in combination with any alloc
262     routine (including the debug versions): E.g., an address allocated with
263     omAllocBin can be freed with omfree, or an adress allocated with
264     om(Debug)Alloc can be freed with omfree, or omFree, or omFreeSize, etc.
265     However, keep in mind that the efficiency decreases from
266     Bin over Size to General routines (i.e., omFreeBin is more efficient than
267     omFreeSize which is more efficient than omFree, likewise with the alloc
268     routines).
269   + if OM_CHECK is undefined or 0, then all omCheck routines do nothing
270   + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is
271     defined, then the "real" alloc/realloc/free macros are used, and all
272     omTest, omDebug and omCheck routines are undefined
273   + to break after an omError occured within a debugger,
274     set a breakpoint on dErrorBreak
275   + to do checks from within the debugger, or to do checks with explicit
276     check level, use omTest routines.
277*/
278
279/* by default, store alloc info and file/line where addr was freed */
280#ifndef OM_TRACK
281#define OM_TRACK 4
282#endif
283/* only do constant-time memory checks */
284#ifndef OM_CHECK
285#define OM_CHECK 1
286#endif
287/* Do actually free memory:
288   (be careful: if this is set, memory is never really freed,
289    but only marked as free) */
290#ifndef OM_KEEP
291#define OM_KEEP 0
292#endif
293/* but only after you have freed 1000 more addresses
294   (this is actually independent of the value of OM_KEEP and used
295   to initialize om_Opts.Keep) */
296#ifndef OM_SING_KEEP
297#define OM_SING_KEEP 1000
298#endif
299
300#endif /* MDEBUG */
301
302
303/* undef KDEBUG for check of data during std computations
304 *
305 * define KDEBUG to
306 * 0 for basic tests
307 * 1 for tests in kSpoly
308 * NOTE: You can locally enable tests in kspoly by setting the
309 *       define at the beginning of kspoly.cc
310 */
311#define KDEBUG 0
312
313/* define LDEBUG checking numbers, undefine otherwise */
314#define LDEBUG
315/* define RDEBUG checking rings (together with TRACE=9) */
316#define RDEBUG
317/* define TEST for non time critical tests, undefine otherwise */
318#define TEST
319
320/* #define PAGE_TEST */
321
322/* define YYDEBUG 1 for debugging bison texts, 0 otherwise */
323#define YYDEBUG 1
324
325/* define SPECTRUM_DEBUG and SPECTRUM_PRINT for debugging the spectrum code */
326/* define SPECTRUM_IOSTREAM to use C++ iostream for error messages          */
327
328/* #define SPECTRUM_DEBUG */
329/* #define SPECTRUM_PRINT */
330#undef  SPECTRUM_IOSTREAM
331
332#ifdef  SPECTRUM_DEBUG
333#define MULTICNT_DEBUG
334#define GMPRAT_DEBUG
335#define KMATRIX_DEBUG
336#define SPLIST_DEBUG
337#define NPOLYGON_DEBUG
338#define SEMIC_DEBUG
339#endif
340
341#ifdef  SPECTRUM_PRINT
342#define MULTICNT_PRINT
343#define GMPRAT_PRINT
344#define KMATRIX_PRINT
345#define SPLIST_PRINT
346#define NPOLYGON_PRINT
347#define SEMIC_PRINT
348#endif
349
350#ifdef  SPECTRUM_IOSTREAM
351#define MULTICNT_IOSTREAM
352#define GMPRAT_IOSTREAM
353#define KMATRIX_IOSTREAM
354#define SPLIST_IOSTREAM
355#define NPOLYGON_IOSTREAM
356#define SEMIC_IOSTREAM
357#endif
358
359
360#else /* not NDEBUG **************************************************** */
361
362#define NO_PDEBUG
363
364/* define YYDEBUG 1 for debugging bison texts, 0 otherwise */
365#define YYDEBUG 0
366
367#endif /* not NDEBUG */
368
369/*******************************************************************
370 *
371 * assume(x) -- a handy macro for assumptions
372 *
373 ******************************************************************/
374
375#ifdef __cplusplus
376extern "C" {
377#endif
378/* routine which is used to report the error/
379* returns 0 */
380extern int dReportError(const char* fmt, ...);
381/* within a debugger, set a breakpoint on dErrorBreak
382* which is called after the error has been reported */
383extern void dErrorBreak();
384#ifdef __cplusplus
385}
386#endif
387
388#ifndef HAVE_ASSUME
389#define assume(x) do {} while (0)
390#define r_assume(x) do {} while (0)
391#else /* ! HAVE_ASSUME */
392
393#define assume_violation(s,f,l) \
394  dReportError("assume violation at %s:%d condition: %s", f,l,s)
395
396#define assume(x)   _assume(x, __FILE__, __LINE__)
397#define r_assume(x) _r_assume(x, __FILE__, __LINE__)
398
399#define _assume(x, f, l)                        \
400do                                              \
401{                                               \
402  if (! (x))                                    \
403  {                                             \
404    assume_violation(#x, f, l);                 \
405  }                                             \
406}                                               \
407while (0)
408
409#define _r_assume(x, f, l)                      \
410do                                              \
411{                                               \
412  if (! (x))                                    \
413  {                                             \
414    assume_violation(#x, f, l);                 \
415    return 0;                                   \
416  }                                             \
417}                                               \
418while (0)
419#endif /* HAVE_ASSUME */
420
421/* do have RDEBUG, unless we are doing the very real thing */
422#ifdef HAVE_ASSUME
423#ifndef RDEBUG
424#define RDEBUG
425#endif
426#endif
427
428#if SIZEOF_VOIDP == 8
429#ifndef OM_CHECK
430#define OM_CHECK 0
431#endif
432#endif
433
434/* If we're not using GNU C, elide __attribute__ */
435#ifndef __GNUC__
436#  define  __attribute__(x)  /*NOTHING*/
437#endif
438
439#define STRINGIFY(name) #name
440#define EXPANDED_STRINGIFY(name) STRINGIFY(name)
441
442#endif /* MOD2_H  */
Note: See TracBrowser for help on using the repository browser.