Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
52c4d0ba
Commit
52c4d0ba
authored
Jul 01, 2004
by
Lynn Garren
Browse files
restore abs function - G4 calls abs(HepLorentzVector)
parent
1de900cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
config/config/TemplateFunctions.h
View file @
52c4d0ba
...
...
@@ -2,7 +2,7 @@
#ifdef ENABLE_BACKWARDS_COMPATIBILITY
// -*- C++ -*-
// CLASSDOC OFF
// $Id: TemplateFunctions.h,v 1.1.2.
2
2004/0
6/30
1
5
:38:
30
garren Exp $
// $Id: TemplateFunctions.h,v 1.1.2.
3
2004/0
7/01
1
7
:38:
51
garren Exp $
// ---------------------------------------------------------------------------
// CLASSDOC ON
//
...
...
@@ -19,6 +19,8 @@
#include
<cmath>
// double abs()
#include
<stdlib.h>
// int abs()
#include
"CLHEP/config/CLHEP.h"
using
namespace
std
;
// Geant 4.6.2 still has at least one reference to sqr
...
...
@@ -33,6 +35,18 @@ inline T sqr(const T& x) {
}
#endif
// Geant4 calls abs(CLHEP::HepLorentzVector)
#ifndef CLHEP_ABS_DEFINED
#define CLHEP_ABS_DEFINED
#ifdef abs
#undef abs
#endif
template
<
class
T
>
inline
T
abs
(
const
T
&
a
)
{
return
a
<
0
?
-
a
:
a
;
}
#endif
#endif
/* HEP_TEMPLATEFUNCTIONS_H */
#endif // ENABLE_BACKWARDS_COMPATIBILITY
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment