|
ADS
Algorithms and Data Structures
|
The heaps of ADS as heaps of LEMON, beyond the book: models of the concept lemon::concepts::Heap< PR , IM , CMP > (the file lemon/concepts/heap.h of LEMON 1.3 and of abLEMON), so that an algorithm of LEMON that takes its heap by its traits (Dijkstra, Prim, AStar, the bidirectional Dijkstra, CapacityScaling and the others) runs on a heap of ADS by one named template parameter, e.g.,. More...
#include "ADS/Contract.h"#include "ADS/Modification.h"#include "ADS/priority/IndexedDaryHeap.h"#include <cstddef>#include <functional>#include <type_traits>#include <utility>#include <vector>Go to the source code of this file.
Classes | |
| struct | ADS::lemon_interop::CmpKey< PR, CMP > |
| a priority of LEMON as a key of ADS, ordered by the comparator CMP More... | |
| class | ADS::lemon_interop::DaryHeap< PR, IM, CMP, D, Policy > |
| an IndexedDaryHeap of ADS as a heap of LEMON, on the cross-reference map IM of the caller More... | |
| class | ADS::lemon_interop::MonotoneHeap< Q, PR, IM > |
| a monotone queue of ADS without decrease-key, Q either DialQueue< int , K > or RadixHeap< int , K >, as a heap of LEMON by the lazy deletion More... | |
Namespaces | |
| namespace | ADS |
| namespace | ADS::lemon_interop |
The heaps of ADS as heaps of LEMON, beyond the book: models of the concept lemon::concepts::Heap< PR , IM , CMP > (the file lemon/concepts/heap.h of LEMON 1.3 and of abLEMON), so that an algorithm of LEMON that takes its heap by its traits (Dijkstra, Prim, AStar, the bidirectional Dijkstra, CapacityScaling and the others) runs on a heap of ADS by one named template parameter, e.g.,.
using H = ADS::lemon_interop::DaryHeap< int , GR::NodeMap< int > >; lemon::Dijkstra< GR , LM >::SetStandardHeap< H >::Create d( g , l );
(see Interoperation with LEMON). LEMON's protocol has two parts that are not in the signatures: the cross-reference map, from the items to int, is owned by the caller, and the algorithm writes it directly (Dijkstra::init() sets PRE_HEAP for every node without calling the heap), so that a heap derives the state of an item from the value in the map alone.
The concurrent queues of ADS (MultiQueue, LockFreePriorityQueue) are relaxed, and cannot be given to an algorithm of LEMON that takes a popped item as final.
The contracts [see Contract.h]: those of the concept of LEMON (top(), prio() and pop() on a heap that is not empty, decrease() and increase() on an item in the heap with a priority not greater, or not less, than its own), checked by those of the heap of ADS below, and, for MonotoneHeap, the monotone use. The heaps are defined in this file.