4 // ---------------------------------------------------------------------------
7 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
9 // This file contains definitions of some usefull utilities and macros.
18 #if defined(CLHEP_TARGET_H)
19 #include CLHEP_TARGET_H
21 #include "CLHEP/config/CLHEP-default.h"
25 // **** You should probably not touch anything below this line: ****
27 typedef double HepDouble;
29 typedef float HepFloat;
32 typedef bool HepBoolean;
34 typedef int HepBoolean;
36 const HepBoolean hep_false = 0;
37 #define false hep_false
40 const HepBoolean hep_true = 1;
43 #endif /* HEP_HAVE_BOOL */
45 #ifdef HEP_SHORT_NAMES
46 typedef HepBoolean Boolean;
50 #define M_PI_2 1.57079632679489661923
54 #define M_PI 3.14159265358979323846
58 #define M_2PI 6.28318530717958647692
61 #ifndef CLHEP_MAX_MIN_DEFINED
62 #define CLHEP_MAX_MIN_DEFINED
64 inline const T& min(const T& a, const T& b) {
65 // Break this into two lines to avoid an incorrect warning with
66 // Cfront-based compilers.
67 const T& retval = b < a ? b : a;
72 inline const T& max(const T& a, const T& b) {
73 // Break this into two lines to avoid an incorrect warning with
74 // Cfront-based compilers.
75 const T& retval = a < b ? b : a;
80 #ifndef CLHEP_SQR_ABS_DEFINED
81 #define CLHEP_SQR_ABS_DEFINED
83 inline T sqr(const T& x) {
88 inline T abs(const T& a) {
89 return a < 0 ? -a : a;
93 #ifdef HEP_DEBUG_INLINE
94 #define HEP_NO_INLINE_IN_DECLARATION
97 #ifdef HEP_NO_INLINE_IN_DECLARATION
98 #define HEP_NO_INLINE_IN_TEMPLATE_DECLARATION
101 // Default to generate random matrix
103 #ifndef HEP_USE_RANDOM
104 #define HEP_USE_RANDOM
107 // GNU g++ compiler can optimize when returning an object.
108 // However g++ on HP cannot deal with this.
110 #undef HEP_GNU_OPTIMIZED_RETURN
113 #endif /* _CLHEP_H_ */