Documentation
¶
Index ¶
- type Item
- type Numeric
- 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]) PushNewItem(value *T, priority int)
- func (pq PriorityQueue[T]) Swap(i, j int)
- func (pq *PriorityQueue[T]) Update(value *T, priority int)
- type Queue
- type Stack
- type Vector
- type Vector3d
- func (this Vector3d) Add(vec Vector3d) Vector3d
- func (this *Vector3d) Divide(vec Vector3d) Vector3d
- func (this Vector3d) IsEqualTo(vec Vector3d) bool
- func (this Vector3d) Length() float64
- func (this *Vector3d) LengthSquared() int
- func (this *Vector3d) Multiply(vec Vector3d) Vector3d
- func (this *Vector3d) Subtract(vec Vector3d) Vector3d
- func (this *Vector3d) ToString() string
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
TODO: this is a pain with generics
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]) PushNewItem ¶
func (pq *PriorityQueue[T]) PushNewItem(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 Vector ¶
type Vector[T Numeric] struct { X, Y T }
func (*Vector[T]) AngleDegrees ¶
func (*Vector[T]) AngleRadians ¶
type Vector3d ¶
type Vector3d struct {
X, Y, Z int
}
func NewVector3d ¶
func (*Vector3d) LengthSquared ¶
Click to show internal directories.
Click to hide internal directories.