Main Page
Namespaces
Classes
Package Documentation
PhysicsTools
Utilities
interface
Abs.h
Go to the documentation of this file.
1
#ifndef PhysicsTools_Utilities_Abs_h
2
#define PhysicsTools_Utilities_Abs_h
3
#include <cmath>
4
5
namespace
funct
{
6
7
template
<
typename
T>
8
struct
AbsStruct
{
9
AbsStruct
(
const
T
&
t
) :
_
(t) { }
10
inline
double
operator()
()
const
{ return ::fabs(
_
()); }
11
inline
operator
double()
const
{ return ::fabs(
_
()); }
12
T
_
;
13
};
14
15
template
<
typename
T>
16
struct
Abs
{
17
typedef
AbsStruct<T>
type
;
18
inline
static
type
compose
(
const
T
&
t
) {
return
type
(t); }
19
};
20
21
template
<
typename
T>
22
inline
typename
Abs<T>::type
abs
(
const
T
&
t
) {
23
return
Abs<T>::compose
(t);
24
}
25
26
}
27
28
#endif
funct
Definition:
Abs.h:5
funct::Abs::type
AbsStruct< T > type
Definition:
Abs.h:17
funct::Abs
Definition:
Abs.h:16
funct::Abs::compose
static type compose(const T &t)
Definition:
Abs.h:18
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
funct::AbsStruct::AbsStruct
AbsStruct(const T &t)
Definition:
Abs.h:9
funct::type
arg type
Definition:
Factorize.h:38
funct::AbsStruct::_
T _
Definition:
Abs.h:12
lumiQTWidget.t
t
Definition:
lumiQTWidget.py:50
T
long double T
Definition:
Basic3DVectorLD.h:57
funct::AbsStruct::operator()
double operator()() const
Definition:
Abs.h:10
funct::AbsStruct
Definition:
Abs.h:8
Generated for CMSSW Reference Manual by
1.8.11