priorityqueue

package
v1.19.13 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID   uint64
	Dist float32
}

type ItemWithIndex

type ItemWithIndex struct {
	ID    uint64
	Index uint64
	Dist  float32
}

type Queue

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

func NewMax

func NewMax(capacity int) *Queue

func NewMin

func NewMin(capacity int) *Queue

func (*Queue) Cap

func (l *Queue) Cap() int

func (*Queue) Insert

func (l *Queue) Insert(id uint64, distance float32) int

func (*Queue) Items added in v1.19.7

func (l *Queue) Items(k int) ([]uint64, []float32)

func (*Queue) Last added in v1.19.7

func (*Queue) Last() (Item, bool)

func (*Queue) Len

func (l *Queue) Len() int

func (*Queue) Pop

func (l *Queue) Pop() Item

func (*Queue) ReSort added in v1.19.7

func (l *Queue) ReSort(id uint64, distance float32)

func (*Queue) Reset

func (l *Queue) Reset()

func (*Queue) ResetCap

func (l *Queue) ResetCap(capacity int)

func (*Queue) Top

func (l *Queue) Top() Item

type QueueWithIndex

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

func NewMaxWithIndex

func NewMaxWithIndex(capacity int) *QueueWithIndex

func NewMinWithIndex

func NewMinWithIndex(capacity int) *QueueWithIndex

func (*QueueWithIndex) Cap

func (l *QueueWithIndex) Cap() int

func (*QueueWithIndex) Insert

func (l *QueueWithIndex) Insert(id uint64, index uint64, distance float32) int

func (*QueueWithIndex) Items added in v1.19.7

func (l *QueueWithIndex) Items(k int) ([]uint64, []float32)

func (*QueueWithIndex) Last added in v1.19.7

func (*QueueWithIndex) Last() (Item, bool)

func (*QueueWithIndex) Len

func (l *QueueWithIndex) Len() int

func (*QueueWithIndex) Pop

func (l *QueueWithIndex) Pop() ItemWithIndex

func (*QueueWithIndex) ReSort added in v1.19.7

func (l *QueueWithIndex) ReSort(id uint64, distance float32)

func (*QueueWithIndex) Reset

func (l *QueueWithIndex) Reset()

func (*QueueWithIndex) ResetCap

func (l *QueueWithIndex) ResetCap(capacity int)

func (*QueueWithIndex) Top

func (l *QueueWithIndex) Top() ItemWithIndex

type SortedQueue added in v1.19.7

type SortedQueue interface {
	Len() int
	Insert(id uint64, distance float32) int
	ReSort(id uint64, distance float32)
	Items(k int) ([]uint64, []float32)
	Pop() Item
	Top() Item
	Last() (Item, bool)
}

Jump to

Keyboard shortcuts

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