Description

A k-dimensional tree implementation for D.

Package Information

Version0.1.0 (2016-Mar-25)
Repositoryhttps://github.com/Mihail-K/kdtree
LicenseMIT
CopyrightCopyright © 2016, Mihail K
AuthorsMihail-K
Registered byMihail K
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

kdtree

A k-dimensional tree implementation for D.

Example Code

import kdtree;

void main()
{
    // Construct a 2-Dimensional tree of integers.
    auto tree = KDNode!(2, int).build([0, 0], [0, 1], [1, 0], [1, 1]);

    // Find the node closest to (-3, 5).
    auto near = tree.nearest([-3, 5].kdPoint);
    assert(near == [0, 1].kdPoint);
}

Caveats

kdtree is currently not intended for altering constructed trees. It's limited to constructing trees from a series of data points and performing nearest-neighbour lookups.

License

MIT

Available versions

0.1.0 ~master