Documentation
¶
Index ¶
- type NodeDistance
- type NodeDistanceHeap
- type NodeStack
- type NodeVisitMap
- type Nodes
- func (set *Nodes) Add(n contract.Node) bool
- func (set Nodes) Clone() contract.Nodes
- func (set Nodes) Count() uint
- func (set *Nodes) Get(nID contract.NodeID) contract.Node
- func (set *Nodes) Has(nID contract.NodeID) bool
- func (set Nodes) Range() contract.NChannel
- func (set *Nodes) Remove(nID contract.NodeID) bool
- func (set Nodes) Values() []contract.Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeDistance ¶
NodeDistance contains distance to a node.
func NewNodeDistance ¶
func NewNodeDistance(nID contract.NodeID, d float64) NodeDistance
NewNodeDistance crates a new NodeDistance instance.
type NodeDistanceHeap ¶
type NodeDistanceHeap []NodeDistance
NodeDistanceHeap is a heap of node distances. It is used in the PQ implementation.
func (NodeDistanceHeap) Len ¶
func (heap NodeDistanceHeap) Len() int
Len returns length of the heap.
func (NodeDistanceHeap) Less ¶
func (heap NodeDistanceHeap) Less(i, j int) bool
Less compares elements.
func (*NodeDistanceHeap) Pop ¶
func (heap *NodeDistanceHeap) Pop() interface{}
Pop removes an element from the tail of the heap. Used by heap.Pop().
func (*NodeDistanceHeap) Push ¶
func (heap *NodeDistanceHeap) Push(v interface{})
Push adds an element to the heap. Used by heap.Push().
type NodeStack ¶
NodeStack is a slice of nodes.
type NodeVisitMap ¶
NodeVisitMap is a map of visited nodes. Used in iterators.
func (*NodeVisitMap) Visit ¶
func (m *NodeVisitMap) Visit(nID contract.NodeID)
Visit marks nID as visited and increments the visit counter.
type Nodes ¶
Nodes is a set of INode instances.
func (*Nodes) Add ¶
Add adds a node to the set and returns true if it had been inserted for the first time.