/usr/include/opengm/operations/normalize.hxx is in libopengm-dev 2.3.6-2.
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 | #pragma once
#ifndef OPENGM_OPERATION_NORMALIZE_HXX
#define OPENGM_OPERATION_NORMALIZE_HXX
#include <typeinfo>
#include "opengm/opengm.hxx"
#include "opengm/operations/multiplier.hxx"
namespace opengm
{
/// Normalization w.r.t. a binary operation (e.g. Multiplier) and a unary accumulation (e.g. Integrator)
struct Normalization {
template<class ACC, class OP, class T>
static void normalize(T& out) {
typename T::ValueType v;
out.template accumulate<ACC>(v);
if(typeid(OP) == typeid(opengm::Multiplier) && v <= 0.00001) {
return;
}
if(typeid(OP) == typeid(opengm::Multiplier)) {
OPENGM_ASSERT(v > 0.00001);
}
OP::iop(v,out);
}
};
} // namespace opengm
#endif // #ifndef OPENGM_OPERATION_NORMAIZE_HXX
|