From c4a1b596483b494ead45755dca1805cae6b5615c Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 17 Jul 2023 09:24:19 -0400 Subject: VPTree: use a secondary hash-table for point lookups --- include/framework/RecordInterface.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/framework') 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 #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 +struct RecordHash { + size_t operator()(R const &rec) const { + return hash_bytes((char *) &rec, sizeof(R)); + } +}; + } -- cgit v1.2.3