summaryrefslogtreecommitdiffstats
path: root/include/framework/interface/Record.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2024-02-08 16:38:44 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2024-02-08 16:39:08 -0500
commit711769574e647839677739192698e400529efe75 (patch)
tree6262e9aa99123cfdc6c9930020662a4dc9c136eb /include/framework/interface/Record.h
parent923e27797f6fd3a2b04f1a7a8d990a49374f4c61 (diff)
downloaddynamic-extension-711769574e647839677739192698e400529efe75.tar.gz
Updated VPTree to new shard/query interfaces
Diffstat (limited to 'include/framework/interface/Record.h')
-rw-r--r--include/framework/interface/Record.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/framework/interface/Record.h b/include/framework/interface/Record.h
index 457078d..29df4b6 100644
--- a/include/framework/interface/Record.h
+++ b/include/framework/interface/Record.h
@@ -212,4 +212,23 @@ struct RecordHash {
}
};
+template <typename R>
+class DistCmpMax {
+public:
+ DistCmpMax(R *baseline) : P(baseline) {}
+
+ inline bool operator()(const R *a, const R *b) requires WrappedInterface<R> {
+ return a->rec.calc_distance(P->rec) > b->rec.calc_distance(P->rec);
+ }
+
+ inline bool operator()(const R *a, const R *b) requires (!WrappedInterface<R>){
+ return a->calc_distance(*P) > b->calc_distance(*P);
+ }
+
+private:
+ R *P;
+};
+
+
+
}