summaryrefslogtreecommitdiff
path: root/geom_matching/wasserstein/include/dnn/local/search-functors.h
diff options
context:
space:
mode:
Diffstat (limited to 'geom_matching/wasserstein/include/dnn/local/search-functors.h')
-rw-r--r--geom_matching/wasserstein/include/dnn/local/search-functors.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/geom_matching/wasserstein/include/dnn/local/search-functors.h b/geom_matching/wasserstein/include/dnn/local/search-functors.h
index f257d0c..1419f22 100644
--- a/geom_matching/wasserstein/include/dnn/local/search-functors.h
+++ b/geom_matching/wasserstein/include/dnn/local/search-functors.h
@@ -1,8 +1,12 @@
-#ifndef DNN_LOCAL_SEARCH_FUNCTORS_H
-#define DNN_LOCAL_SEARCH_FUNCTORS_H
+#ifndef HERA_WS_DNN_LOCAL_SEARCH_FUNCTORS_H
+#define HERA_WS_DNN_LOCAL_SEARCH_FUNCTORS_H
#include <boost/range/algorithm/heap_algorithm.hpp>
+namespace hera
+{
+namespace ws
+{
namespace dnn
{
@@ -28,7 +32,7 @@ struct NNRecord
typedef typename HandleDistance::PointHandle PointHandle;
typedef typename HandleDistance::DistanceType DistanceType;
- NNRecord() { result.d = std::numeric_limits<DistanceType>::infinity(); }
+ NNRecord() { result.d = std::numeric_limits<DistanceType>::max(); }
DistanceType operator()(PointHandle p, DistanceType d) { if (d < result.d) { result.p = p; result.d = d; } return result.d; }
HandleDistance result;
};
@@ -67,7 +71,7 @@ struct kNNRecord
result.push_back(HandleDistance(p,d));
boost::push_heap(result);
if (result.size() < k)
- return std::numeric_limits<DistanceType>::infinity();
+ return std::numeric_limits<DistanceType>::max();
} else if (d < result[0].d)
{
boost::pop_heap(result);
@@ -84,6 +88,8 @@ struct kNNRecord
HDContainer result;
};
-}
+} // dnn
+} // ws
+} // hera
#endif // DNN_LOCAL_SEARCH_FUNCTORS_H