summaryrefslogtreecommitdiffstats
path: root/include/framework/RecordInterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/framework/RecordInterface.h')
-rw-r--r--include/framework/RecordInterface.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/framework/RecordInterface.h b/include/framework/RecordInterface.h
index 85a0794..cea9fbe 100644
--- a/include/framework/RecordInterface.h
+++ b/include/framework/RecordInterface.h
@@ -49,6 +49,7 @@ concept WrappedInterface = RecordInterface<R> && requires(R r, R s, bool b) {
{r.set_tombstone(b)};
{r.is_tombstone()} -> std::convertible_to<bool>;
{r < s} -> std::convertible_to<bool>;
+ {r == s} ->std::convertible_to<bool>;
};
template<RecordInterface R>
@@ -79,6 +80,11 @@ struct Wrapped {
inline bool operator<(const Wrapped& other) const {
return rec < other.rec || (rec == other.rec && header < other.header);
}
+
+ inline bool operator==(const Wrapped& other) const {
+ return rec == other.rec;
+ }
+
};
template <typename K, typename V>
@@ -185,10 +191,10 @@ struct EuclidPoint{
inline double calc_distance(const EuclidPoint& other) const {
double dist = 0;
for (size_t i=0; i<D; i++) {
- dist += pow(data[i] - other.data[i], 2);
+ dist += (data[i] - other.data[i]) * (data[i] - other.data[i]);
}
- return sqrt(dist);
+ return std::sqrt(dist);
}
};