00001 #ifndef PhysicsTools_Utilities_Numerical_h 00002 #define PhysicsTools_Utilities_Numerical_h 00003 #include <cassert> 00004 namespace funct { 00005 00006 template<int n> struct Numerical { 00007 Numerical() { } 00008 Numerical(int m) { assert(m == n); } 00009 static const int value = n; 00010 double operator()() const { return n; } 00011 operator double() const { return n; } 00012 double operator()(double) const { return n; } 00013 double operator()(double, double) const { return n; } 00014 }; 00015 00016 template<int n> const Numerical<n>& num() 00017 { static Numerical<n> c; return c; } 00018 00019 } 00020 00021 #endif