source: git/kernel/mod2.h @ 15ff9a

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