Documentation ¶
Index ¶
- type IntHeap
- type Item
- type PriorityQueue
- func (pq *PriorityQueue[T]) Get() *T
- func (pq *PriorityQueue[T]) Init()
- func (pq PriorityQueue[T]) Len() int
- func (pq PriorityQueue[T]) Less(i, j int) bool
- func (pq *PriorityQueue[T]) NewItem(value *T, priority, index int)
- func (pq *PriorityQueue[T]) Pop() interface{}
- func (pq *PriorityQueue[T]) Push(x interface{})
- func (pq *PriorityQueue[T]) PushValue(value *T, priority int)
- func (pq PriorityQueue[T]) Swap(i, j int)
- func (pq *PriorityQueue[T]) Update(value *T, priority int)
- type Set
- type Stack
- type Vector3d
- func (v Vector3d) Add(b Vector3d) Vector3d
- func (v *Vector3d) DistanceTo(b Vector3d) float64
- func (v *Vector3d) Divide(b Vector3d) Vector3d
- func (v Vector3d) Length() float64
- func (v *Vector3d) LengthSquared() int
- func (v *Vector3d) Multiply(b Vector3d) Vector3d
- func (v *Vector3d) String() string
- func (v *Vector3d) Subtract(b Vector3d) Vector3d
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item[T any] struct { // contains filtered or unexported fields }
An Item is something we manage in a priority queue.
type PriorityQueue ¶
A PriorityQueue implements heap.Interface and holds Items.
func (*PriorityQueue[T]) Get ¶
func (pq *PriorityQueue[T]) Get() *T
func (*PriorityQueue[T]) Init ¶
func (pq *PriorityQueue[T]) Init()
func (PriorityQueue[T]) Len ¶
func (pq PriorityQueue[T]) Len() int
func (PriorityQueue[T]) Less ¶
func (pq PriorityQueue[T]) Less(i, j int) bool
func (*PriorityQueue[T]) NewItem ¶
func (pq *PriorityQueue[T]) NewItem(value *T, priority, index int)
sets index manually
func (*PriorityQueue[T]) Pop ¶
func (pq *PriorityQueue[T]) Pop() interface{}
func (*PriorityQueue[T]) Push ¶
func (pq *PriorityQueue[T]) Push(x interface{})
func (*PriorityQueue[T]) PushValue ¶
func (pq *PriorityQueue[T]) PushValue(value *T, priority int)
sets index automatically
func (PriorityQueue[T]) Swap ¶
func (pq PriorityQueue[T]) Swap(i, j int)
func (*PriorityQueue[T]) Update ¶
func (pq *PriorityQueue[T]) Update(value *T, priority int)
update modifies the priority and value of an Item in the queue.
type Set ¶
type Set[T comparable] map[T]struct{}
type Vector3d ¶
type Vector3d struct {
X, Y, Z int
}
func NewVector3d ¶
func (*Vector3d) DistanceTo ¶
func (*Vector3d) LengthSquared ¶
Click to show internal directories.
Click to hide internal directories.