From ac018f5f96c32c96158a239fbfeb9dc439c95548 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 24 Jul 2023 11:50:33 -0400 Subject: Cosine Similarity Type --- include/framework/RecordInterface.h | 52 ++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) (limited to 'include/framework') diff --git a/include/framework/RecordInterface.h b/include/framework/RecordInterface.h index 8d40590..85a0794 100644 --- a/include/framework/RecordInterface.h +++ b/include/framework/RecordInterface.h @@ -112,10 +112,10 @@ struct WeightedRecord { }; template -struct Point{ +struct CosinePoint{ V data[D]; - inline bool operator==(const Point& other) const { + inline bool operator==(const CosinePoint& other) const { for (size_t i=0; i +struct EuclidPoint{ + V data[D]; + + inline bool operator==(const EuclidPoint& other) const { + for (size_t i=0; i other.data[i]) { + return false; + } + } + + return false; + } + + inline double calc_distance(const EuclidPoint& other) const { double dist = 0; for (size_t i=0; i