File: switch.m2

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (45 lines) | stat: -rw-r--r-- 1,511 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
-- Copyright 1999-2002 by Anton Leykin and Harrison Tsai 

---------------------------------------------------------------------------------
-- InfoLevel switch 
-- determines how often and of which depth remarks are made by D-routines
-- Suggested levels:
-- 	1: "still-alive" remarks as "localize: computing b-function..."
--     	    	      	   	     ^^^^^^^^
--         (should include a reference to the routine talking)
--     
-- 	2: benchmarks: "time = ..."
--      666: debugging info, reserved for developers.
---------------------------------------------------------------------------------
 
INFOLEVEL := 0

Dtrace  = method()
Dtrace ZZ := ZZ => level -> (t := INFOLEVEL;  INFOLEVEL = level; t)
getDtrace = () -> INFOLEVEL

-- prints Info 
-- format: pInfo(min_level, Thing)
pInfo = method();
pInfo(ZZ, Thing) := (minLevel, s) -> (
     if minLevel <= getDtrace() then print s ;
     << flush;
     ); 
pInfo(ZZ, List) := (minLevel, l) -> (
     if minLevel <= getDtrace() then (
	  scan(l, u-><<u); 
     	  << endl << flush;
	  )
     ); 
----------------------------------------------------------------------------------
-- Homogenization switch 
-- determines whether homogenized Weyl algebra is used in certain algorithms
---------------------------------------------------------------------------------- 
HOMOGENIZATION := true

setHomSwitch = method ()
setHomSwitch(Boolean) := Boolean => s -> (
     t := HOMOGENIZATION; 
     HOMOGENIZATION = s; 
     t) 
getHomSwitch = ()->HOMOGENIZATION