Thrill
0.1
|
Guarded loser tree, using pointers to the elements instead of copying them into the tree nodes.
This is a base class for the LoserTreePointer<true> and <false> classes.
Guarding is done explicitly through one flag sup per element, inf is not needed due to a better initialization routine. This is a well-performing variant.
Definition at line 306 of file loser_tree.hpp.
#include <loser_tree.hpp>
Classes | |
struct | Loser |
Internal representation of a loser tree player/node. More... | |
Public Types | |
using | Source = uint32_t |
size of counters and array indexes More... | |
Public Member Functions | |
LoserTreePointerBase (Source k, const Comparator &cmp=Comparator()) | |
LoserTreePointerBase (const LoserTreePointerBase &)=delete | |
LoserTreePointerBase (LoserTreePointerBase &&)=default | |
void | init () |
Source | init_winner (const Source &root) |
Computes the winner of the competition at player root. More... | |
void | insert_start (const ValueType *keyp, const Source &source, bool sup) |
Initializes the player source with the element key. More... | |
Source | min_source () |
return the index of the player with the smallest element. More... | |
LoserTreePointerBase & | operator= (const LoserTreePointerBase &)=delete |
LoserTreePointerBase & | operator= (LoserTreePointerBase &&)=default |
Static Public Attributes | |
static constexpr Source | invalid_ = Source(-1) |
sentinel for invalid or finished Sources More... | |
Protected Attributes | |
Comparator | cmp_ |
the comparator object More... | |
const Source | ik_ |
number of nodes More... | |
const Source | k_ |
log_2(ik) next greater power of 2 More... | |
SimpleVector< Loser > | losers_ |
array containing loser tree nodes More... | |