Documentation
¶
Index ¶
- type Item
- type Queue
- func (q *Queue[T]) Cap() int
- func (q *Queue[T]) Insert(id uint64, distance float32) int
- func (q *Queue[T]) InsertAndPop(id uint64, score float64, limit int, worstDist *float64, val T)
- func (q *Queue[T]) InsertWithValue(id uint64, distance float32, val T) int
- func (q *Queue[T]) Len() int
- func (q *Queue[T]) Pop() Item[T]
- func (q *Queue[T]) Reset()
- func (q *Queue[T]) ResetCap(capacity int)
- func (q *Queue[T]) ShouldEnqueue(distance float32, limit int) bool
- func (q *Queue[T]) Top() Item[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T supportedValueType] struct {
// contains filtered or unexported fields
}
Queue is a priority queue supporting generic item values
func NewMinWithId ¶ added in v1.28.0
NewMin constructs a priority queue which prioritizes items with larger distance and smaller ID: - higher scores first - if tied, lower document id first Thus, the signs in the Less function are opposite for scores and ids
func (*Queue[T]) InsertAndPop ¶ added in v1.28.0
func (*Queue[T]) InsertWithValue ¶ added in v1.23.0
InsertWithValue creates an item with a T type value and adds it to the queue
func (*Queue[T]) ResetCap ¶
ResetCap drops existing queue items, and allocates a new queue with the given capacity
func (*Queue[T]) ShouldEnqueue ¶ added in v1.28.0
Click to show internal directories.
Click to hide internal directories.