kdtree

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 4 Imported by: 0

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