Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:16:53

0001 #ifndef PhysicsTools_Utilities_Numerical_h
0002 #define PhysicsTools_Utilities_Numerical_h
0003 #include <cassert>
0004 namespace funct {
0005 
0006   template <int n>
0007   struct Numerical {
0008     Numerical() {}
0009     Numerical(int m) { assert(m == n); }
0010     static const int value = n;
0011     double operator()() const { return n; }
0012     operator double() const { return n; }
0013     double operator()(double) const { return n; }
0014     double operator()(double, double) const { return n; }
0015   };
0016 
0017   template <int n>
0018   const Numerical<n>& num() {
0019     static Numerical<n> c;
0020     return c;
0021   }
0022 
0023 }  // namespace funct
0024 
0025 #endif