From 99d957ea185c3641e407b73a757bc9e2b5673686 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 17 Jul 2023 13:50:42 -0400 Subject: VPTree: changed Point format to a D-dimensional point. --- include/framework/RecordInterface.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'include/framework') diff --git a/include/framework/RecordInterface.h b/include/framework/RecordInterface.h index ab4c6f9..a3f6814 100644 --- a/include/framework/RecordInterface.h +++ b/include/framework/RecordInterface.h @@ -100,22 +100,40 @@ struct WeightedRecord { } }; -template +template struct Point{ - V x; - V y; + V data[D]; inline bool operator==(const Point& other) const { - return x == other.x && y == other.y; + for (size_t i=0; i other.data[i]) { + return false; + } + } + + return false; } inline double calc_distance(const Point& other) const { - return sqrt(pow(x - other.x, 2) + pow(y - other.y, 2)); + double dist = 0; + for (size_t i=0; i