|
ADS
Algorithms and Data Structures
|
an IndexedDaryHeap of ADS as a heap of LEMON, on the cross-reference map IM of the caller More...
#include <ADS/interop/lemon/Heaps.h>
Public types | |
| enum | State { IN_HEAP = 0 , PRE_HEAP = -1 , POST_HEAP = -2 } |
| the states of an item, those of LEMON More... | |
| using | ItemIntMap = IM |
| the cross-reference map | |
| using | Prio = PR |
| the priorities | |
| using | Item = typename IM::Key |
| the items | |
| using | Pair = std::pair< Item , Prio > |
| an item with its priority | |
| using | Key = CmpKey< PR , CMP > |
| the keys of the heap of ADS | |
| using | Heap = IndexedDaryHeap< Key , D , Policy > |
| the heap of ADS | |
Public member functions | |
| DaryHeap (ItemIntMap &m) | |
| the empty heap on the map \( m \) | |
| DaryHeap (ItemIntMap &m, const CMP &) | |
| the empty heap on the map \( m \), the comparator not kept | |
| int | size (void) const |
| the number of items | |
| bool | empty (void) const |
| whether there is no item | |
| void | clear (void) |
| all the items removed, the map left as it is (as in LEMON) | |
| void | push (const Item &i, const Prio &p) |
| inserts the item \( i \) with the priority \( p \), in a free slot | |
| void | push (const Pair &x) |
| inserts the pair \( x \) | |
| Item | top (void) const |
| the item of least priority | |
| Prio | prio (void) const |
| the least priority | |
| void | pop (void) |
| removes the item of least priority, POST_HEAP from now on | |
| void | erase (const Item &i) |
| removes the item \( i \), if it is in the heap | |
| Prio | operator[] (const Item &i) const |
| the priority of the item \( i \) | |
| void | set (const Item &i, const Prio &p) |
| the priority of \( i \) set to \( p \), inserting it if needed | |
| void | decrease (const Item &i, const Prio &p) |
| the priority of \( i \) lowered to \( p \) | |
| void | increase (const Item &i, const Prio &p) |
| the priority of \( i \) raised to \( p \) | |
| State | state (const Item &i) const |
| the state of the item \( i \), read from the map | |
| void | state (const Item &i, State st) |
| the state of \( i \) set to \( st \), removing it from the heap if it was there; IN_HEAP changes nothing | |
| Heap & | heap (void) |
| the heap of ADS, whose subject tells the changes, the slots their handles | |
| const Heap & | heap (void) const |
| the heap of ADS | |
| Heap::Subject & | subject (void) |
| the subject of the heap of ADS | |
| const Item & | item (int s) const |
| the item of the slot \( s \), the handle of the events | |
an IndexedDaryHeap of ADS as a heap of LEMON, on the cross-reference map IM of the caller
| using ADS::lemon_interop::DaryHeap< PR, IM, CMP, D, Policy >::Heap = IndexedDaryHeap< Key , D , Policy > |
the heap of ADS
| using ADS::lemon_interop::DaryHeap< PR, IM, CMP, D, Policy >::Item = typename IM::Key |
the items
| using ADS::lemon_interop::DaryHeap< PR, IM, CMP, D, Policy >::ItemIntMap = IM |
the cross-reference map
| using ADS::lemon_interop::DaryHeap< PR, IM, CMP, D, Policy >::Key = CmpKey< PR , CMP > |
the keys of the heap of ADS
| using ADS::lemon_interop::DaryHeap< PR, IM, CMP, D, Policy >::Pair = std::pair< Item , Prio > |
an item with its priority
| using ADS::lemon_interop::DaryHeap< PR, IM, CMP, D, Policy >::Prio = PR |
the priorities
| enum ADS::lemon_interop::DaryHeap::State |
|
inlineexplicit |
the empty heap on the map \( m \)
|
inline |
the empty heap on the map \( m \), the comparator not kept
|
inline |
all the items removed, the map left as it is (as in LEMON)
|
inline |
the priority of \( i \) lowered to \( p \)
|
inlinenodiscard |
whether there is no item
|
inline |
removes the item \( i \), if it is in the heap
|
inlinenodiscard |
the heap of ADS, whose subject tells the changes, the slots their handles
|
inlinenodiscard |
the heap of ADS
|
inline |
the priority of \( i \) raised to \( p \)
|
inlinenodiscard |
the item of the slot \( s \), the handle of the events
|
inlinenodiscard |
the priority of the item \( i \)
|
inline |
removes the item of least priority, POST_HEAP from now on
|
inlinenodiscard |
the least priority
| void ADS::lemon_interop::DaryHeap< PR, IM, CMP, D, Policy >::push | ( | const Item & | i, |
| const Prio & | p ) |
inserts the item \( i \) with the priority \( p \), in a free slot
|
inline |
inserts the pair \( x \)
|
inline |
the priority of \( i \) set to \( p \), inserting it if needed
|
inlinenodiscard |
the number of items
|
inlinenodiscard |
the state of the item \( i \), read from the map
|
inline |
the state of \( i \) set to \( st \), removing it from the heap if it was there; IN_HEAP changes nothing
|
inlinenodiscard |
the subject of the heap of ADS
|
inlinenodiscard |
the item of least priority