FastNeighbors

package module
v0.0.0-...-4e6766b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 7 Imported by: 0

README

FastKNN

An implementation of fast KNN algorithm using KDTrees

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptiveRadius

type AdaptiveRadius struct {
	Regions  []CircularRegion
	RBFCoefs []float64
	RBFVar   float64
}

func NewAdaptiveRadius

func NewAdaptiveRadius(regions []CircularRegion) AdaptiveRadius

func (AdaptiveRadius) RadiusAt

func (ar AdaptiveRadius) RadiusAt(center []float64) float64

type CircularRegion

type CircularRegion struct {
	Center []float64
	Radius float64
}

type Interval

type Interval struct {
	LBound, UBound float64
}

type KDLeaf

type KDLeaf struct {
	BoundingBox []Interval
	Points      []Point
}

type KDTree

type KDTree struct {
	BoundingBox []Interval
	DivisionDim int
	NumPoints   int
	LSubTree    *KDTree
	RSubTree    *KDTree
	LLeaf       *KDLeaf
	RLeaf       *KDLeaf
}

func NewKDTree

func NewKDTree(pointLocations [][]float64, numPointsPerLeaf int, relaxation float64) *KDTree

func (KDTree) ComputeDensity

func (kdtree KDTree) ComputeDensity(center []float64, radius float64) int

func (KDTree) FindAdaptiveDensityPeaks

func (kdtree KDTree) FindAdaptiveDensityPeaks(scale float64) []int

func (KDTree) FindAllNeighbors

func (kdtree KDTree) FindAllNeighbors(radius float64) [][]Point

func (KDTree) FindDensityPeaks

func (kdtree KDTree) FindDensityPeaks(radius float64) []int

func (KDTree) FindNeighbors

func (kdtree KDTree) FindNeighbors(center []float64, radius float64) []Point

func (KDTree) ForEachLeaf

func (kdtree KDTree) ForEachLeaf(f func(leaf *KDLeaf))

func (KDTree) GetLeafClusters

func (kdtree KDTree) GetLeafClusters() [][]int

type Point

type Point struct {
	ID  int
	Vec []float64
}

Jump to

Keyboard shortcuts

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