Documentation
¶
Overview ¶
Package kdtree implements a k-d tree data structure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KDTree ¶
type KDTree struct {
// contains filtered or unexported fields
}
KDTree represents the k-d tree.
func (*KDTree) Balance ¶
func (t *KDTree) Balance()
Balance rebalances the k-d tree by recreating it.
func (*KDTree) KNN ¶
KNN returns the k-nearest neighbours of the given point. The points are sorted by the distance to the given points. Starting with the nearest.
func (*KDTree) RangeSearch ¶
RangeSearch returns all points in the given range r.
Returns an empty slice when input is nil or len(r) does not equal Point.Dimensions().
Directories
¶
Path | Synopsis |
---|---|
Package kdrange contains k-dimensional range struct and helpers.
|
Package kdrange contains k-dimensional range struct and helpers. |
Package points contains multiple example implementations of the kdtree.Point interface.
|
Package points contains multiple example implementations of the kdtree.Point interface. |
Click to show internal directories.
Click to hide internal directories.