dkdtree

package module
v0.0.0-...-00c6c16 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

README

dkdtree

A disk-backed KD tree for datasets that don't fit into memory.

See the docs at https://godoc.org/github.com/jtolds/dkdtree

Documentation

Overview

Package dkdtree implements a disk-backed kd-tree for datasets too large for memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Dim         uint32
	Left, Right int64
	Point       Point
}

type Point

type Point struct {
	Pos  []float64
	Data []byte
}

type PointDistance

type PointDistance struct {
	Point
	Distance float64
}

type PointSet

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

func NewPointSet

func NewPointSet(path string, dims, maxDataLen int) (*PointSet, error)

func (*PointSet) Add

func (pl *PointSet) Add(p Point) error

func (*PointSet) Close

func (pl *PointSet) Close() error

type Tree

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

func CreateTree

func CreateTree(path, tmpdir string, points *PointSet) (*Tree, error)

func OpenTree

func OpenTree(path string) (*Tree, error)

func (*Tree) Close

func (t *Tree) Close() error

func (*Tree) Count

func (t *Tree) Count() int64

func (*Tree) Nearest

func (t *Tree) Nearest(p Point, n int) ([]PointDistance, error)

func (*Tree) NearestExhaustive

func (t *Tree) NearestExhaustive(p Point, n int) ([]PointDistance, error)

NearestExhaustive just scans every point. This might be faster if your data has high dimensionality.

func (*Tree) Node

func (t *Tree) Node(id int64) (Node, error)

func (*Tree) Root

func (t *Tree) Root() (Node, error)

Jump to

Keyboard shortcuts

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