summaryrefslogtreecommitdiff
path: root/geom_matching/wasserstein/include/hera_infinity.h
diff options
context:
space:
mode:
authorArnur Nigmetov <a.nigmetov@gmail.com>2018-05-31 20:44:59 +0200
committerArnur Nigmetov <a.nigmetov@gmail.com>2018-05-31 20:57:35 +0200
commit8ffc1482c88fd1c503524f6e328f69fe3fdede6c (patch)
treea858364713e1bf81b06b86fd7b3dcf782632a211 /geom_matching/wasserstein/include/hera_infinity.h
parent9693f140d91e751aabe46b76b89c332c7f307e17 (diff)
Fix bug in point cloud version.
internal_p was not respected by DynamicPointTraits, l_2 distance was always used.
Diffstat (limited to 'geom_matching/wasserstein/include/hera_infinity.h')
-rw-r--r--geom_matching/wasserstein/include/hera_infinity.h22
1 files changed, 22 insertions, 0 deletions
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<class Real = double>
+ inline bool is_infinity(const Real& x)
+ {
+ return x == Real(-1);
+ };
+
+ template<class Real = double>
+ inline Real get_infinity()
+ {
+ return Real(-1);
+ }
+}
+
+#endif //WASSERSTEIN_HERA_INFINITY_H