00001 #ifndef PhysicsTools_Utilities_Exp_h 00002 #define PhysicsTools_Utilities_Exp_h 00003 00004 #include <cmath> 00005 00006 namespace funct { 00007 00008 template<typename T> 00009 struct ExpStruct { 00010 ExpStruct(const T& t) : _(t) { } 00011 inline double operator()() const { return ::exp(_()); } 00012 T _; 00013 }; 00014 00015 template<typename T> 00016 struct Exp { 00017 typedef ExpStruct<T> type; 00018 inline static type compose(const T& t) { return type(t); } 00019 }; 00020 00021 template<typename T> 00022 inline typename Exp<T>::type exp(const T & t) { return Exp<T>::compose(t); } 00023 00024 } 00025 00026 #endif