source: git/kernel/mod2.h @ 57592b3

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