ThePEG  1.8.0
Debug.h
1 // -*- C++ -*-
2 //
3 // Debug.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_Debug_H
10 #define ThePEG_Debug_H
11 // This is the declaration of the Debug class.
12 
13 #include <vector>
14 
15 namespace ThePEG {
16 
21 class Debug {
22 
23 public:
24 
28  enum Levels {
29  noDebug = 0,
32  full = 9
33  };
34 
38  static int level;
39 
45  static bool isset;
46 
54  static std::vector<bool> debugItems;
55 
60  static void debugItem(int item, bool on);
61 
65  static void setDebug(int ilev);
66 
71  static bool debugItem(int item)
72  {
73  if ( level == noDebug ) return false;
74  if ( level == full ) return true;
75  return ( item < 0 || std::size_t(item) >= debugItems.size() )? false:
76  debugItems[item];
77  }
78 
86  static void unmaskFpuErrors();
90  static void unmaskFpuOverflow();
94  static void unmaskFpuUnderflow();
98  static void unmaskFpuDivZero();
102  static void unmaskFpuDenorm();
106  static void unmaskFpuInvalid();
110  static void maskFpuErrors();
114  static void maskFpuOverflow();
118  static void maskFpuUnderflow();
122  static void maskFpuDivZero();
126  static void maskFpuDenorm();
130  static void maskFpuInvalid();
132 
133 };
134 
135 }
136 
137 #endif /* ThePEG_Debug_H */