hoesler / kdtree

A Scala k-d tree library
Apache License 2.0
4 stars 2 forks source link

kdtree

Build Status

A Scala library containing a k-d tree implementation.

Description

Trees are immutable. Construction is done asynchronously using a fork-join approach.

Usage

val nodes: Seq[(HyperPoint, String)] = List(
    (HyperPoint(2, 3), "A"),
    (HyperPoint(5, 4), "B")
)

val tree = KDTree(nodes)

tree.filterRange(HyperSphere(HyperPoint(7, 2), 1.5))
tree.findNeighbours(HyperPoint(9.1, 6.1), k = 1)