summaryrefslogtreecommitdiff
path: root/geom_matching/wasserstein/include/hera_infinity.h
blob: 8d86dbb8b5174bf51fc587da73b8f50d1d8ada18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef WASSERSTEIN_HERA_INFINITY_H
#define WASSERSTEIN_HERA_INFINITY_H

// we cannot assume that template parameter Real will always provide infinity() value,
// so value -1.0 is used to encode infinity (l_inf norm is used by default)

namespace hera {

    template<class Real = double>
    inline bool is_infinity(const Real& x)
    {
        return x == Real(-1);
    };

    template<class Real = double>
    inline constexpr Real get_infinity()
    {
        return Real(-1);
    }
}

#endif //WASSERSTEIN_HERA_INFINITY_H