/usr/include/opengm/operations/adder.hxx is in libopengm-dev 2.3.6+20160905-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | #pragma once
#ifndef OPENGM_OPERATION_ADDER_HXX
#define OPENGM_OPERATION_ADDER_HXX
namespace opengm {
/// Addition as a binary operation
///
/// \ingroup operators
struct Adder
{
/// neutral element (with return)
template<class T>
static T neutral()
{ return static_cast<T>(0); }
/// neutral element (call by reference)
template<class T>
static void neutral(T& out)
{ out = static_cast<T>(0); }
/// inverse neutral element (with return)
template<class T>
static T ineutral()
{ return static_cast<T>(0); }
/// inverse neutral element (call by reference)
template<class T>
static void ineutral(T& out)
{ out = static_cast<T>(0); }
/// operation (in-place)
template<class T1, class T2>
static void op(const T1& in, T2& out)
{ out += in; }
/// operation (not in-place)
template<class T1,class T2,class T3>
static void op(const T1& in1, const T2& in2, T3& out)
{ out = in1 + in2; }
/// inverse operation (in-place)
template<class T1, class T2>
static void iop(const T1& in, T2& out)
{ out -= in; }
/// inverse operation (not in-place)
template<class T1,class T2,class T3>
static void iop(const T1& in1, const T2& in2, T3& out)
{ out = in1 - in2; }
/// bool operation flag
static bool hasbop()
{ return false; }
/// hyper-operation (in-place)
template<class T1, class T2>
static void hop(const T1& in, T2& out)
{ out *= in; }
/// hyper-operation (not in-place)
template<class T1,class T2, class T3>
static void hop(const T1& in1, const T2& in2, T3& out)
{ out = in1 * in2; }
/// inverse hyper-operation (in-place)
template<class T1,class T2>
static void ihop(const T1& in, T2& out)
{ out /= in; }
/// inverse hyper-operation (same type, not in-place)
template<class T1, class T2, class T3>
static void ihop(const T1& in1, const T2& in2, T3& out)
{ out = in1 / in2; }
};
} // namespace opengm
#endif // #ifndef OPENGM_OPERATION_ADDER_HXX
|