Class KdTree<T extends KdTree.KdNode>

java.lang.Object
org.episteme.core.mathematics.structures.KdTree<T>
Type Parameters:
T - The type of object stored, must carry coordinates.

public class KdTree<T extends KdTree.KdNode> extends Object
Generic K-d Tree implementation for organizing points in a k-dimensional space. Useful for nearest neighbor searches.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Constructor Details

    • KdTree

      public KdTree(int k)
  • Method Details

    • insert

      public void insert(T item)
    • findNearest

      public T findNearest(T target)
    • rebuild

      public void rebuild(List<T> items)
      Rebalances the tree by rebuilding it from a list of nodes.
      Parameters:
      items - List of all items to be in the tree