integrator.hxx

Go to the documentation of this file.
00001 #pragma once
00002 #ifndef OPENGM_OPERATIONS_INTEGRATOR_HXX
00003 #define OPENGM_OPERATIONS_INTEGRATOR_HXX
00004 
00005 #include "adder.hxx"
00006 
00007 namespace opengm {
00008 
00012 struct Integrator
00013 {
00015    template<class T>
00016       static T neutral()
00017          { return static_cast<T>(0); }
00018 
00020    template<class T>
00021       static void neutral(T& out)
00022          { out = static_cast<T>(0); }
00023 
00025    template<class T>
00026       static T ineutral()
00027          { return std::numeric_limits<T>::infinity(); }
00028 
00030    template<class T>
00031       static void ineutral(T& out)
00032          { out = std::numeric_limits<T>::infinity(); }
00033 
00035    template<class T1, class T2>
00036       static void op(const T1& in1, T2& out)
00037          { out += in1; }
00038 
00040    template<class T1,class T2,class T3>
00041       static void op(const T1 in1, const T2 in2, T3& out)
00042          { out = in1, out += in2; }
00043 
00045    template<class T1, class T2>
00046       static void iop(const T1& in1,  T2& out)
00047          { out - in1; }
00048 
00050    template<class T1,class T2,class T3>
00051       static void iop(const T1 in1, const T2 in2, T3& out)
00052          { out = in1, out -= in2; }
00053 
00055    static bool hasbop()
00056       { return false; }
00059    template<class T>
00060       static bool bop(const T& in1, const T& in2)
00061          { return false; }
00064    template<class T>
00065       static bool ibop(const T& in1, const T& in2)
00066          { return false; }
00067 };
00068 
00069 } // namespace opengm
00070 
00071 #endif // #ifndef OPENGM_OPERATIONS_INTEGRATOR_HXX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Jun 17 16:31:03 2013 for OpenGM by  doxygen 1.6.3