kdtree

package
v0.0.0-...-74ae077 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2022 License: MIT Imports: 4 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SortData

type SortData struct {
	RowData [][]float64
	Data    []int
	Feature int
}

func (SortData) Len

func (d SortData) Len() int

func (SortData) Less

func (d SortData) Less(i, j int) bool

func (SortData) Swap

func (d SortData) Swap(i, j int)

type Tree

type Tree struct {
	// contains filtered or unexported fields
}

Tree is a kdtree.

func New

func New() *Tree

New return a Tree pointer.

func (*Tree) Build

func (t *Tree) Build(data [][]float64) error

Build builds the kdtree with specific data.

func (*Tree) Search

func (t *Tree) Search(k int, disType pairwise.PairwiseDistanceFunc, target []float64) ([]int, []float64, error)

Search return srcRowNo([]int) and length([]float64) contained k nearest neighbors from specific distance function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL