Skip to content
Snippets Groups Projects
Verified Commit 95c853f6 authored by David Procházka's avatar David Procházka
Browse files

ADD: k into rank

parent 17814074
No related branches found
No related tags found
No related merge requests found
...@@ -88,7 +88,7 @@ public class MHTree extends Algorithm implements Serializable { ...@@ -88,7 +88,7 @@ public class MHTree extends Algorithm implements Serializable {
} }
} else { } else {
for (Node child : ((InternalNode) node).getChildren()) { for (Node child : ((InternalNode) node).getChildren()) {
searchState.queue.add(new ObjectToNodeDistanceRank(searchState.queryObject, child)); searchState.queue.add(new ObjectToNodeDistanceRank(searchState.queryObject, child, operation.getK()));
} }
} }
} }
...@@ -100,7 +100,7 @@ public class MHTree extends Algorithm implements Serializable { ...@@ -100,7 +100,7 @@ public class MHTree extends Algorithm implements Serializable {
LocalAbstractObject queryObject = operation.getQueryObject(); LocalAbstractObject queryObject = operation.getQueryObject();
PriorityQueue<ObjectToNodeDistanceRank> queue = new PriorityQueue<>(); PriorityQueue<ObjectToNodeDistanceRank> queue = new PriorityQueue<>();
queue.add(new ObjectToNodeDistanceRank(queryObject, root)); queue.add(new ObjectToNodeDistanceRank(queryObject, root, operation.getK()));
while (!queue.isEmpty()) { while (!queue.isEmpty()) {
if (approxState != null && approxState.stop()) { if (approxState != null && approxState.stop()) {
...@@ -121,7 +121,7 @@ public class MHTree extends Algorithm implements Serializable { ...@@ -121,7 +121,7 @@ public class MHTree extends Algorithm implements Serializable {
} }
} else { } else {
for (Node child : ((InternalNode) node).getChildren()) { for (Node child : ((InternalNode) node).getChildren()) {
queue.add(new ObjectToNodeDistanceRank(queryObject, child)); queue.add(new ObjectToNodeDistanceRank(queryObject, child, operation.getK()));
} }
} }
} }
......
...@@ -16,7 +16,7 @@ public class SearchState { ...@@ -16,7 +16,7 @@ public class SearchState {
public SearchState(MHTree tree, ApproxKNNQueryOperation operation) { public SearchState(MHTree tree, ApproxKNNQueryOperation operation) {
this.queue = new PriorityQueue<>(); this.queue = new PriorityQueue<>();
this.queue.add(new ObjectToNodeDistanceRank(operation.getQueryObject(), tree.getRoot())); this.queue.add(new ObjectToNodeDistanceRank(operation.getQueryObject(), tree.getRoot(), operation.getK()));
this.queryObject = operation.getQueryObject(); this.queryObject = operation.getQueryObject();
this.approxState = ApproxState.create(operation, tree); this.approxState = ApproxState.create(operation, tree);
this.recall = 0d; this.recall = 0d;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment