diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2023-07-17 09:24:19 -0400 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2023-07-17 09:24:19 -0400 |
| commit | c4a1b596483b494ead45755dca1805cae6b5615c (patch) | |
| tree | 540c112d1c12306bf1bb6e36d9b71bbedc122130 /include/framework | |
| parent | 12915304570507e00848aba700f0ed3a26dbb9b6 (diff) | |
| download | dynamic-extension-c4a1b596483b494ead45755dca1805cae6b5615c.tar.gz | |
VPTree: use a secondary hash-table for point lookups
Diffstat (limited to 'include/framework')
| -rw-r--r-- | include/framework/RecordInterface.h | 9 |
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)); + } +}; + } |