tlx
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

Loser/Tournament tree variants. More...

Classes

class  LoserTreeCopyBase< ValueType, Comparator >
 Guarded loser tree/tournament tree, either copying the whole element into the tree structure, or looking up the element via the index. More...
 
struct  LoserTreeCopyBase< ValueType, Comparator >::Loser
 Internal representation of a loser tree player/node. More...
 
class  LoserTreeCopy< Stable, ValueType, Comparator >
 Guarded loser tree/tournament tree, either copying the whole element into the tree structure, or looking up the element via the index. More...
 
class  LoserTreeCopy< true, ValueType, Comparator >
 Guarded loser tree/tournament tree, either copying the whole element into the tree structure, or looking up the element via the index. More...
 
class  LoserTreePointerBase< ValueType, Comparator >
 Guarded loser tree, using pointers to the elements instead of copying them into the tree nodes. More...
 
class  LoserTreePointer< Stable, ValueType, Comparator >
 Guarded loser tree, using pointers to the elements instead of copying them into the tree nodes. More...
 
class  LoserTreePointer< true, ValueType, Comparator >
 Guarded loser tree, using pointers to the elements instead of copying them into the tree nodes. More...
 
class  LoserTreeCopyUnguardedBase< ValueType, Comparator >
 Unguarded loser tree, copying the whole element into the tree structure. More...
 
class  LoserTreeCopyUnguarded< Stable, ValueType, Comparator >
 
class  LoserTreeCopyUnguarded< true, ValueType, Comparator >
 
class  LoserTreePointerUnguardedBase< ValueType, Comparator >
 Unguarded loser tree, keeping only pointers to the elements in the tree structure. More...
 
class  LoserTreePointerUnguarded< Stable, ValueType, Comparator >
 
class  LoserTreePointerUnguarded< true, ValueType, Comparator >
 
class  LoserTreeSwitch< Stable, ValueType, Comparator, Enable >
 

Typedefs

using Source = uint32_t
 size of counters and array indexes More...
 
using Super = LoserTreeCopyBase< ValueType, Comparator >
 
using Source = typename Super::Source
 
using Super = LoserTreeCopyBase< ValueType, Comparator >
 
using Source = typename Super::Source
 
using Source = uint32_t
 size of counters and array indexes More...
 
using Super = LoserTreePointerBase< ValueType, Comparator >
 
using Source = typename Super::Source
 
using Super = LoserTreePointerBase< ValueType, Comparator >
 
using Source = typename Super::Source
 
using Source = uint32_t
 size of counters and array indexes More...
 
using Super = LoserTreeCopyUnguardedBase< ValueType, Comparator >
 
using Source = typename Super::Source
 
using Super = LoserTreeCopyUnguardedBase< ValueType, Comparator >
 
using Source = typename Super::Source
 
using Source = uint32_t
 size of counters and array indexes More...
 
using Super = LoserTreePointerUnguardedBase< ValueType, Comparator >
 
using Source = typename Super::Source
 
using Super = LoserTreePointerUnguardedBase< ValueType, Comparator >
 
using Source = typename Super::Source
 
using Type = LoserTreePointer< Stable, ValueType, Comparator >
 

Functions

 LoserTreeCopyBase (const Source &k, const Comparator &cmp=Comparator())
 
Source min_source ()
 return the index of the player with the smallest element. More...
 
void insert_start (const ValueType *keyp, const Source &source, bool sup)
 Initializes the player source with the element key. More...
 
Source init_winner (const Source &root)
 Computes the winner of the competition at player root. More...
 
void init ()
 
 LoserTreeCopy (const Source &k, const Comparator &cmp=Comparator())
 
void delete_min_insert (const ValueType *keyp, bool sup)
 
 LoserTreeCopy (const Source &k, const Comparator &cmp=Comparator())
 
void delete_min_insert (const ValueType *keyp, bool sup)
 
 LoserTreePointerBase (Source k, const Comparator &cmp=Comparator())
 
 LoserTreePointerBase (const LoserTreePointerBase &)=delete
 
LoserTreePointerBase & operator= (const LoserTreePointerBase &)=delete
 
 LoserTreePointerBase (LoserTreePointerBase &&)=default
 
LoserTreePointerBase & operator= (LoserTreePointerBase &&)=default
 
Source min_source ()
 return the index of the player with the smallest element. More...
 
void insert_start (const ValueType *keyp, const Source &source, bool sup)
 Initializes the player source with the element key. More...
 
Source init_winner (const Source &root)
 Computes the winner of the competition at player root. More...
 
void init ()
 
 LoserTreePointer (Source k, const Comparator &cmp=Comparator())
 
void delete_min_insert (const ValueType *keyp, bool sup)
 
 LoserTreePointer (Source k, const Comparator &cmp=Comparator())
 
void delete_min_insert (const ValueType *keyp, bool sup)
 
 LoserTreeCopyUnguardedBase (Source k, const ValueType &sentinel, const Comparator &cmp=Comparator())
 
Source min_source ()
 return the index of the player with the smallest element. More...
 
void insert_start (const ValueType *keyp, const Source &source, bool sup)
 
Source init_winner (const Source &root)
 
void init ()
 
 LoserTreeCopyUnguarded (Source k, const ValueType &sentinel, const Comparator &cmp=Comparator())
 
void delete_min_insert (const ValueType *keyp, bool sup)
 
 LoserTreeCopyUnguarded (Source k, const ValueType &sentinel, const Comparator &comp=Comparator())
 
void delete_min_insert (const ValueType *keyp, bool sup)
 
 LoserTreePointerUnguardedBase (const Source &k, const ValueType &sentinel, const Comparator &cmp=Comparator())
 
 LoserTreePointerUnguardedBase (const LoserTreePointerUnguardedBase &other)=delete
 
LoserTreePointerUnguardedBase & operator= (const LoserTreePointerUnguardedBase &)=delete
 
Source min_source ()
 
void insert_start (const ValueType *keyp, const Source &source, bool sup)
 
Source init_winner (const Source &root)
 
void init ()
 
 LoserTreePointerUnguarded (const Source &k, const ValueType &sentinel, const Comparator &cmp=Comparator())
 
void delete_min_insert (const ValueType *keyp, bool sup)
 
 LoserTreePointerUnguarded (const Source &k, const ValueType &sentinel, const Comparator &cmp=Comparator())
 
void delete_min_insert (const ValueType *keyp, bool sup)
 

Variables

static constexpr Source invalid_
 sentinel for invalid or finished Sources More...
 
bool sup
 flag, true iff is a virtual maximum sentinel More...
 
Source source
 index of source More...
 
ValueType key
 copy of key value of the element in this node 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 – avoid default-constructing losers[].key More...
 
Comparator cmp_
 the comparator object More...
 
bool first_insert_
 still have to construct keys More...
 
static constexpr Source invalid_
 sentinel for invalid or finished Sources More...
 
Source source
 index of source More...
 
const ValueType * keyp
 pointer to key value of the element in this node 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...
 
Comparator cmp_
 the comparator object More...
 
static constexpr Source invalid_
 sentinel for invalid or finished Sources More...
 
Source source
 index of source More...
 
ValueType key
 copy of key value of the element in this node More...
 
Source ik_
 number of nodes More...
 
Source k_
 log_2(ik) next greater power of 2 More...
 
SimpleVector< Loser > losers_
 array containing loser tree nodes More...
 
Comparator cmp_
 the comparator object More...
 
static constexpr Source invalid_
 sentinel for invalid or finished Sources More...
 
Source source
 index of source More...
 
const ValueType * keyp
 copy of key value of the element in this node More...
 
Source ik_
 number of nodes More...
 
Source k_
 log_2(ik) next greater power of 2 More...
 
SimpleVector< Loser > losers_
 array containing loser tree nodes More...
 
Comparator cmp_
 the comparator object More...
 

Detailed Description

Loser/Tournament tree variants.

Typedef Documentation

using Source = uint32_t

size of counters and array indexes

Definition at line 58 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 185 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 252 of file loser_tree.hpp.

using Source = uint32_t

size of counters and array indexes

Definition at line 310 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 422 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 482 of file loser_tree.hpp.

using Source = uint32_t

size of counters and array indexes

Definition at line 532 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 616 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 657 of file loser_tree.hpp.

using Source = uint32_t

size of counters and array indexes

Definition at line 708 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 794 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 832 of file loser_tree.hpp.

using Super = LoserTreeCopyBase<ValueType, Comparator>

Definition at line 184 of file loser_tree.hpp.

using Super = LoserTreeCopyBase<ValueType, Comparator>

Definition at line 251 of file loser_tree.hpp.

using Super = LoserTreePointerBase<ValueType, Comparator>

Definition at line 421 of file loser_tree.hpp.

using Super = LoserTreePointerBase<ValueType, Comparator>

Definition at line 481 of file loser_tree.hpp.

using Super = LoserTreeCopyUnguardedBase<ValueType, Comparator>

Definition at line 615 of file loser_tree.hpp.

using Super = LoserTreeCopyUnguardedBase<ValueType, Comparator>

Definition at line 656 of file loser_tree.hpp.

using Super = LoserTreePointerUnguardedBase<ValueType, Comparator>

Definition at line 793 of file loser_tree.hpp.

using Super = LoserTreePointerUnguardedBase<ValueType, Comparator>

Definition at line 831 of file loser_tree.hpp.

using Type = LoserTreePointer<Stable, ValueType, Comparator>

Definition at line 874 of file loser_tree.hpp.

Function Documentation

void delete_min_insert ( const ValueType *  keyp,
bool  sup 
)
inline

Definition at line 198 of file loser_tree.hpp.

void delete_min_insert ( const ValueType *  keyp,
bool  sup 
)
inline

Definition at line 265 of file loser_tree.hpp.

void delete_min_insert ( const ValueType *  keyp,
bool  sup 
)
inline

Definition at line 433 of file loser_tree.hpp.

void delete_min_insert ( const ValueType *  keyp,
bool  sup 
)
inline

Definition at line 493 of file loser_tree.hpp.

void delete_min_insert ( const ValueType *  keyp,
bool  sup 
)
inline

Definition at line 629 of file loser_tree.hpp.

void delete_min_insert ( const ValueType *  keyp,
bool  sup 
)
inline

Definition at line 670 of file loser_tree.hpp.

void delete_min_insert ( const ValueType *  keyp,
bool  sup 
)
inline

Definition at line 806 of file loser_tree.hpp.

void delete_min_insert ( const ValueType *  keyp,
bool  sup 
)
inline

Definition at line 844 of file loser_tree.hpp.

void init ( )
inline

Definition at line 159 of file loser_tree.hpp.

void init ( )
inline

Definition at line 399 of file loser_tree.hpp.

void init ( )
inline

Definition at line 602 of file loser_tree.hpp.

void init ( )
inline

Definition at line 780 of file loser_tree.hpp.

Source init_winner ( const Source root)
inline

Computes the winner of the competition at player root.

Called recursively (starting at 0) to build the initial tree.

Parameters
rootindex of the game to start.

Definition at line 139 of file loser_tree.hpp.

Source init_winner ( const Source root)
inline

Computes the winner of the competition at player root.

Called recursively (starting at 0) to build the initial tree.

Parameters
rootindex of the game to start.

Definition at line 379 of file loser_tree.hpp.

Source init_winner ( const Source root)
inline

Definition at line 584 of file loser_tree.hpp.

Source init_winner ( const Source root)
inline

Definition at line 762 of file loser_tree.hpp.

void insert_start ( const ValueType *  keyp,
const Source source,
bool  sup 
)
inline

Initializes the player source with the element key.

Parameters
keypthe element to insert
sourceindex of the player
supflag that determines whether the value to insert is an explicit supremum sentinel.

Definition at line 109 of file loser_tree.hpp.

void insert_start ( const ValueType *  keyp,
const Source source,
bool  sup 
)
inline

Initializes the player source with the element key.

Parameters
keypthe element to insert
sourceindex of the player
supflag that determines whether the value to insert is an explicit supremum sentinel.

Definition at line 362 of file loser_tree.hpp.

void insert_start ( const ValueType *  keyp,
const Source source,
bool  sup 
)
inline

Definition at line 573 of file loser_tree.hpp.

void insert_start ( const ValueType *  keyp,
const Source source,
bool  sup 
)
inline

Definition at line 751 of file loser_tree.hpp.

LoserTreeCopy ( const Source k,
const Comparator &  cmp = Comparator() 
)
inlineexplicit

Definition at line 193 of file loser_tree.hpp.

LoserTreeCopy ( const Source k,
const Comparator &  cmp = Comparator() 
)
inlineexplicit

Definition at line 260 of file loser_tree.hpp.

LoserTreeCopyBase ( const Source k,
const Comparator &  cmp = Comparator() 
)
inlineexplicit

Definition at line 87 of file loser_tree.hpp.

LoserTreeCopyUnguarded ( Source  k,
const ValueType &  sentinel,
const Comparator &  cmp = Comparator() 
)
inline

Definition at line 624 of file loser_tree.hpp.

LoserTreeCopyUnguarded ( Source  k,
const ValueType &  sentinel,
const Comparator &  comp = Comparator() 
)
inline

Definition at line 665 of file loser_tree.hpp.

LoserTreeCopyUnguardedBase ( Source  k,
const ValueType &  sentinel,
const Comparator &  cmp = Comparator() 
)
inline

Definition at line 556 of file loser_tree.hpp.

LoserTreePointer ( Source  k,
const Comparator &  cmp = Comparator() 
)
inlineexplicit

Definition at line 430 of file loser_tree.hpp.

LoserTreePointer ( Source  k,
const Comparator &  cmp = Comparator() 
)
inlineexplicit

Definition at line 490 of file loser_tree.hpp.

LoserTreePointerBase ( Source  k,
const Comparator &  cmp = Comparator() 
)
inlineexplicit

Definition at line 334 of file loser_tree.hpp.

LoserTreePointerBase ( const LoserTreePointerBase< ValueType, Comparator > &  )
delete
LoserTreePointerBase ( LoserTreePointerBase< ValueType, Comparator > &&  )
default
LoserTreePointerUnguarded ( const Source k,
const ValueType &  sentinel,
const Comparator &  cmp = Comparator() 
)
inline

Definition at line 802 of file loser_tree.hpp.

LoserTreePointerUnguarded ( const Source k,
const ValueType &  sentinel,
const Comparator &  cmp = Comparator() 
)
inline

Definition at line 840 of file loser_tree.hpp.

LoserTreePointerUnguardedBase ( const Source k,
const ValueType &  sentinel,
const Comparator &  cmp = Comparator() 
)
inline

Definition at line 732 of file loser_tree.hpp.

LoserTreePointerUnguardedBase ( const LoserTreePointerUnguardedBase< ValueType, Comparator > &  other)
delete
Source min_source ( )
inline

return the index of the player with the smallest element.

Definition at line 99 of file loser_tree.hpp.

Source min_source ( )
inline

return the index of the player with the smallest element.

Definition at line 350 of file loser_tree.hpp.

Source min_source ( )
inline

return the index of the player with the smallest element.

Definition at line 567 of file loser_tree.hpp.

Source min_source ( )
inline

Definition at line 749 of file loser_tree.hpp.

LoserTreePointerBase& operator= ( const LoserTreePointerBase< ValueType, Comparator > &  )
delete
LoserTreePointerBase& operator= ( LoserTreePointerBase< ValueType, Comparator > &&  )
default
LoserTreePointerUnguardedBase& operator= ( const LoserTreePointerUnguardedBase< ValueType, Comparator > &  )
delete

Variable Documentation

Comparator cmp_
protected

the comparator object

Definition at line 82 of file loser_tree.hpp.

Comparator cmp_
protected

the comparator object

Definition at line 331 of file loser_tree.hpp.

Comparator cmp_
protected

the comparator object

Definition at line 553 of file loser_tree.hpp.

Comparator cmp_
protected

the comparator object

Definition at line 729 of file loser_tree.hpp.

bool first_insert_
protected

still have to construct keys

Definition at line 84 of file loser_tree.hpp.

const Source ik_
protected

number of nodes

Definition at line 75 of file loser_tree.hpp.

const Source ik_
protected

number of nodes

Definition at line 325 of file loser_tree.hpp.

Source ik_
protected

number of nodes

Definition at line 547 of file loser_tree.hpp.

Source ik_
protected

number of nodes

Definition at line 723 of file loser_tree.hpp.

constexpr Source invalid_
static

sentinel for invalid or finished Sources

Definition at line 61 of file loser_tree.hpp.

constexpr Source invalid_
static

sentinel for invalid or finished Sources

Definition at line 313 of file loser_tree.hpp.

constexpr Source invalid_
static

sentinel for invalid or finished Sources

Definition at line 535 of file loser_tree.hpp.

constexpr Source invalid_
static

sentinel for invalid or finished Sources

Definition at line 711 of file loser_tree.hpp.

const Source k_
protected

log_2(ik) next greater power of 2

Definition at line 77 of file loser_tree.hpp.

const Source k_
protected

log_2(ik) next greater power of 2

Definition at line 327 of file loser_tree.hpp.

Source k_
protected

log_2(ik) next greater power of 2

Definition at line 549 of file loser_tree.hpp.

Source k_
protected

log_2(ik) next greater power of 2

Definition at line 725 of file loser_tree.hpp.

ValueType key

copy of key value of the element in this node

Definition at line 71 of file loser_tree.hpp.

ValueType key

copy of key value of the element in this node

Definition at line 543 of file loser_tree.hpp.

const ValueType* keyp

pointer to key value of the element in this node

Definition at line 321 of file loser_tree.hpp.

const ValueType* keyp

copy of key value of the element in this node

Definition at line 719 of file loser_tree.hpp.

SimpleVector<Loser> losers_
protected

array containing loser tree nodes – avoid default-constructing losers[].key

Definition at line 80 of file loser_tree.hpp.

SimpleVector<Loser> losers_
protected

array containing loser tree nodes

Definition at line 329 of file loser_tree.hpp.

SimpleVector<Loser> losers_
protected

array containing loser tree nodes

Definition at line 551 of file loser_tree.hpp.

SimpleVector<Loser> losers_
protected

array containing loser tree nodes

Definition at line 727 of file loser_tree.hpp.

Source source

index of source

Definition at line 69 of file loser_tree.hpp.

Source source

index of source

Definition at line 319 of file loser_tree.hpp.

Source source

index of source

Definition at line 541 of file loser_tree.hpp.

Source source

index of source

Definition at line 717 of file loser_tree.hpp.

bool sup

flag, true iff is a virtual maximum sentinel

Definition at line 67 of file loser_tree.hpp.