资 源 简 介
Kche-tree is a set of C++ templates for generic cache-aware and non-mutable kd-trees. Its main purpose is to provide an easy to use but powerful implementation of the typical kd-tree structure functionality with very low latencies.
It provides the following basic operations:
* Build: create a kd-tree from a training set of feature vectors. Median splitting is used to keep the tree balanced. Cost: O(n log² n).
* K nearest neighbours: retrieve the K nearest neighbours of a given feature vector. Estimated average cost: O(log K log n).
* All neighbours within a range: retrieve all the neighbours inside a maximum distance radius from a given feature vector. Estimated average cost: O(log m log n) with m the number of neighbours in the range.
The template has been designed to minimize the number of cache misses combined with many algorithmic techniques and ideas.
Here are some of its features:
* Can dynamically def