summaryrefslogtreecommitdiffstats
path: root/include/framework
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2023-07-17 09:24:19 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2023-07-17 09:24:19 -0400
commitc4a1b596483b494ead45755dca1805cae6b5615c (patch)
tree540c112d1c12306bf1bb6e36d9b71bbedc122130 /include/framework
parent12915304570507e00848aba700f0ed3a26dbb9b6 (diff)
downloaddynamic-extension-c4a1b596483b494ead45755dca1805cae6b5615c.tar.gz
VPTree: use a secondary hash-table for point lookups
Diffstat (limited to 'include/framework')
-rw-r--r--include/framework/RecordInterface.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/framework/RecordInterface.h b/include/framework/RecordInterface.h
index 6936a8b..ab4c6f9 100644
--- a/include/framework/RecordInterface.h
+++ b/include/framework/RecordInterface.h
@@ -14,6 +14,7 @@
#include <cmath>
#include "util/base.h"
+#include "util/hash.h"
namespace de {
@@ -117,4 +118,12 @@ struct Point{
return sqrt(pow(x - other.x, 2) + pow(y - other.y, 2));
}
};
+
+template<RecordInterface R>
+struct RecordHash {
+ size_t operator()(R const &rec) const {
+ return hash_bytes((char *) &rec, sizeof(R));
+ }
+};
+
}