Documentation
¶
Index ¶
- Variables
- func NewKDNode[T Comparable[T]](value T) *kdNode[T]
- type Comparable
- type KDTree
- func (t *KDTree[T]) Add(value T) bool
- func (t *KDTree[T]) Delete(value T) bool
- func (t *KDTree[T]) Encode() []byte
- func (t *KDTree[T]) FindMin(targetDimension int) (T, bool)
- func (t *KDTree[T]) NearestNeighbor(value T) (T, bool)
- func (t *KDTree[T]) Query(getRelativePosition func(T, int) RelativePosition) []T
- func (t *KDTree[T]) String() string
- func (t *KDTree[T]) Values() []T
- type Relation
- type RelativePosition
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTreeNotSetup = fmt.Errorf("tree is not setup, make sure you create the tree using NewTree")
Functions ¶
func NewKDNode ¶
func NewKDNode[T Comparable[T]](value T) *kdNode[T]
Types ¶
type Comparable ¶
type KDTree ¶
type KDTree[T Comparable[T]] struct { // contains filtered or unexported fields }
func NewKDTreeFromBytes ¶
func NewKDTreeFromBytes[T Comparable[T]](encodedBytes []byte, decodeItemFunc func([]byte) T) *KDTree[T]
func NewKDTreeWithValues ¶
func NewKDTreeWithValues[T Comparable[T]](d int, vs []T) *KDTree[T]
func (*KDTree[T]) NearestNeighbor ¶
func (*KDTree[T]) Query ¶
func (t *KDTree[T]) Query(getRelativePosition func(T, int) RelativePosition) []T
type RelativePosition ¶
type RelativePosition int
const ( BeforeRange RelativePosition = iota InRange AfterRange )
Click to show internal directories.
Click to hide internal directories.