From 8ffc1482c88fd1c503524f6e328f69fe3fdede6c Mon Sep 17 00:00:00 2001 From: Arnur Nigmetov Date: Thu, 31 May 2018 20:44:59 +0200 Subject: Fix bug in point cloud version. internal_p was not respected by DynamicPointTraits, l_2 distance was always used. --- geom_matching/wasserstein/include/hera_infinity.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 geom_matching/wasserstein/include/hera_infinity.h (limited to 'geom_matching/wasserstein/include/hera_infinity.h') diff --git a/geom_matching/wasserstein/include/hera_infinity.h b/geom_matching/wasserstein/include/hera_infinity.h new file mode 100644 index 0000000..5a446e7 --- /dev/null +++ b/geom_matching/wasserstein/include/hera_infinity.h @@ -0,0 +1,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 + inline bool is_infinity(const Real& x) + { + return x == Real(-1); + }; + + template + inline Real get_infinity() + { + return Real(-1); + } +} + +#endif //WASSERSTEIN_HERA_INFINITY_H -- cgit v1.2.3