Documentation ¶
Index ¶
- Constants
- func CreateMeta(path, file string, tree, dim, K int) error
- func HeapSort(array []sorter, order, last int)
- type Angular
- type Converter
- type Distance
- type Fcntl
- type File
- type Flock
- type Free
- type GannoyIndex
- func (g *GannoyIndex) AddItem(key int, w []float64) error
- func (g *GannoyIndex) AddItems(keys []int, ws [][]float64) error
- func (g *GannoyIndex) GetAllNns(v []float64, n, searchK int) ([]int, error)
- func (g *GannoyIndex) GetNnsByKey(key, n, searchK int) ([]int, error)
- func (g GannoyIndex) MetaFile() string
- func (g GannoyIndex) PrintTree()
- func (g *GannoyIndex) RemoveItem(key int) error
- func (g GannoyIndex) Tree()
- func (g *GannoyIndex) UpdateItem(key int, w []float64) error
- type Locker
- type Maps
- type Node
- type Nodes
- type Queue
- type RandRandom
- type Random
- type Storage
Constants ¶
View Source
const ( ADD int = iota DELETE UPDATE )
View Source
const ( ASC int = iota DESC )
View Source
const F_OFD_SETLKW = 38
View Source
const VERSION string = "0.0.1"
Variables ¶
This section is empty.
Functions ¶
func CreateMeta ¶
Types ¶
type Fcntl ¶
type Fcntl struct { }
Only Linux and kernel version 3.15 or later. This depends on open file description lock (F_OFD_SETLKW).
type File ¶
type File struct { K int // contains filtered or unexported fields }
func (*File) UpdateParent ¶
type GannoyIndex ¶
type GannoyIndex struct { K int // contains filtered or unexported fields }
func NewGannoyIndex ¶
func NewGannoyIndex(metaFile string, distance Distance, random Random) (GannoyIndex, error)
func (*GannoyIndex) AddItems ¶
func (g *GannoyIndex) AddItems(keys []int, ws [][]float64) error
Bulk insert. Currently, This method dosen't support mutex. So, this method must be called only from converter.
func (*GannoyIndex) GetAllNns ¶
func (g *GannoyIndex) GetAllNns(v []float64, n, searchK int) ([]int, error)
func (*GannoyIndex) GetNnsByKey ¶
func (g *GannoyIndex) GetNnsByKey(key, n, searchK int) ([]int, error)
func (GannoyIndex) MetaFile ¶
func (g GannoyIndex) MetaFile() string
func (GannoyIndex) PrintTree ¶
func (g GannoyIndex) PrintTree()
func (*GannoyIndex) RemoveItem ¶
func (g *GannoyIndex) RemoveItem(key int) error
func (GannoyIndex) Tree ¶
func (g GannoyIndex) Tree()
func (*GannoyIndex) UpdateItem ¶
func (g *GannoyIndex) UpdateItem(key int, w []float64) error
type RandRandom ¶
type RandRandom struct { }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.