Skip to content

Commit

Permalink
BallTree WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaeschke committed Aug 11, 2024
1 parent 9a4bd15 commit 513ec88
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/main/java/org/tinspin/index/PointMultimap.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.tinspin.index;

import org.tinspin.index.array.PointArray;
import org.tinspin.index.balltree.BallTree;
import org.tinspin.index.kdtree.KDTree;
import org.tinspin.index.phtree.PHTreeMMP;
import org.tinspin.index.qthypercube.QuadTreeKD;
Expand Down Expand Up @@ -154,6 +155,17 @@ static <T> PointMultimap<T> createArray(int dims, int size) {
return new PointArray<>(dims, size);
}

/**
* Create a BallTree.
*
* @param dims Number of dimensions.
* @param <T> Value type
* @return New BallTree
*/
static <T> PointMultimap<T> createBallTree(int dims) {
return BallTree.create(dims);
}

/**
* Create a kD-Tree.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private <T> PointMultimap<T> createTree(int size, int dims) {
case ARRAY:
return PointMultimap.Factory.createArray(dims, size);
case BALL:
return PointMultimap.Factory.createKdTree(dims);
return PointMultimap.Factory.createBallTree(dims);
// //case CRITBIT: return new PointArray<>(dims, size);
case KDTREE:
return PointMultimap.Factory.createKdTree(dims);
Expand Down

0 comments on commit 513ec88

Please sign in to comment.