kdtree-diddiz 0.2.0-alpha
A k-dimensional tree implementation for D.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
kdtree
A k-dimensional tree implementation for D.
Example Code
import kdtree;
void main()
{
// Construct a 2-Dimensional tree of integers:
auto root = kdTree([[0, 0], [1, 1], [1, 0], [0, 1]]);
// Find the node closest to (-3, 5):
auto near = tree.nearest([-3, 5]);
assert(near == [0, 1]);
// Add new point (25, 0):
root.add([25, 0]);
}
Caveats
kdtree is currently not intended for altering constructed trees. It's limited to constructing trees from a series of data points, adding new points and performing nearest-neighbour lookups. It is not possible to remove points.
License
MIT
- 0.2.0-alpha released 7 years ago
- diddiz/kdtree
- MIT
- Copyright © 2016, Mihail K, Robin Kupper
- Authors:
- Dependencies:
- fluent-asserts
- Versions:
-
0.2.0-alpha 2017-Dec-14 ~master 2017-Dec-14 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
0 downloads total
-
- Score:
- 1.1
- Short URL:
- kdtree-diddiz.dub.pm