CMS 3D CMS Logo

Numerical.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_Utilities_Numerical_h
2 #define PhysicsTools_Utilities_Numerical_h
3 #include <cassert>
4 namespace funct {
5 
6  template <int n>
7  struct Numerical {
8  Numerical() {}
9  Numerical(int m) { assert(m == n); }
10  static const int value = n;
11  double operator()() const { return n; }
12  operator double() const { return n; }
13  double operator()(double) const { return n; }
14  double operator()(double, double) const { return n; }
15  };
16 
17  template <int n>
18  const Numerical<n>& num() {
19  static Numerical<n> c;
20  return c;
21  }
22 
23 } // namespace funct
24 
25 #endif
const Numerical< n > & num()
Definition: Numerical.h:18
Definition: Abs.h:5
Numerical(int m)
Definition: Numerical.h:9
assert(be >=bs)
double operator()() const
Definition: Numerical.h:11
Definition: value.py:1
double operator()(double) const
Definition: Numerical.h:13
double operator()(double, double) const
Definition: Numerical.h:14