Thrill  0.1

Classes

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  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  LoserTreeCopyUnguarded< Stable, ValueType, Comparator >
 
class  LoserTreeCopyUnguarded< true, ValueType, Comparator >
 
class  LoserTreeCopyUnguardedBase< ValueType, Comparator >
 Unguarded loser tree, copying the whole element into the tree structure. More...
 
struct  LoserTreeCopyUnguardedBase< ValueType, Comparator >::Loser
 Internal representation of a loser tree player/node. 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  LoserTreePointerBase< ValueType, Comparator >
 Guarded loser tree, using pointers to the elements instead of copying them into the tree nodes. More...
 
struct  LoserTreePointerBase< ValueType, Comparator >::Loser
 Internal representation of a loser tree player/node. More...
 
class  LoserTreePointerUnguarded< Stable, ValueType, Comparator >
 
class  LoserTreePointerUnguarded< true, ValueType, Comparator >
 
class  LoserTreePointerUnguardedBase< ValueType, Comparator >
 Unguarded loser tree, keeping only pointers to the elements in the tree structure. More...
 
struct  LoserTreePointerUnguardedBase< ValueType, Comparator >::Loser
 Internal representation of a loser tree player/node. More...
 
class  LoserTreeSwitch< Stable, ValueType, Comparator, Enable >
 

Typedefs

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

Functions

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

Variables

Comparator cmp_
 the comparator object More...
 
Comparator cmp_
 the comparator object More...
 
Comparator cmp_
 the comparator object More...
 
Comparator cmp_
 the comparator object More...
 
bool first_insert_
 still have to construct keys More...
 
const Source ik_
 number of nodes More...
 
const Source ik_
 number of nodes More...
 
Source ik_
 number of nodes More...
 
Source ik_
 number of nodes More...
 
static constexpr Source invalid_ = Source(-1)
 sentinel for invalid or finished Sources More...
 
static constexpr Source invalid_ = Source(-1)
 sentinel for invalid or finished Sources More...
 
static constexpr Source invalid_ = Source(-1)
 sentinel for invalid or finished Sources More...
 
static constexpr Source invalid_ = Source(-1)
 sentinel for invalid or finished Sources More...
 
const Source k_
 log_2(ik) next greater power of 2 More...
 
const Source k_
 log_2(ik) next greater power of 2 More...
 
Source k_
 log_2(ik) next greater power of 2 More...
 
Source k_
 log_2(ik) next greater power of 2 More...
 
ValueType key
 copy of key value of the element in this node More...
 
ValueType key
 copy of key value of the element in this node More...
 
const ValueType * keyp
 pointer to key value of the element in this node More...
 
const ValueType * keyp
 copy of key value of the element in this node More...
 
SimpleVector< Loserlosers_
 
SimpleVector< Loserlosers_
 array containing loser tree nodes More...
 
SimpleVector< Loserlosers_
 array containing loser tree nodes More...
 
SimpleVector< Loserlosers_
 array containing loser tree nodes More...
 
Source source
 index of source More...
 
Source source
 index of source More...
 
Source source
 index of source More...
 
Source source
 index of source More...
 
bool sup
 flag, true iff is a virtual maximum sentinel More...
 

Detailed Description

Loser/Tournament tree variants

Typedef Documentation

◆ Source [1/12]

using Source = uint32_t

size of counters and array indexes

Definition at line 58 of file loser_tree.hpp.

◆ Source [2/12]

using Source = typename Super::Source

Definition at line 185 of file loser_tree.hpp.

◆ Source [3/12]

using Source = typename Super::Source

Definition at line 252 of file loser_tree.hpp.

◆ Source [4/12]

using Source = uint32_t

size of counters and array indexes

Definition at line 310 of file loser_tree.hpp.

◆ Source [5/12]

using Source = typename Super::Source

Definition at line 422 of file loser_tree.hpp.

◆ Source [6/12]

using Source = typename Super::Source

Definition at line 482 of file loser_tree.hpp.

◆ Source [7/12]

using Source = uint32_t

size of counters and array indexes

Definition at line 532 of file loser_tree.hpp.

◆ Source [8/12]

using Source = typename Super::Source

Definition at line 616 of file loser_tree.hpp.

◆ Source [9/12]

using Source = typename Super::Source

Definition at line 657 of file loser_tree.hpp.

◆ Source [10/12]

using Source = uint32_t

size of counters and array indexes

Definition at line 708 of file loser_tree.hpp.

◆ Source [11/12]

using Source = typename Super::Source

Definition at line 794 of file loser_tree.hpp.

◆ Source [12/12]

using Source = typename Super::Source

Definition at line 832 of file loser_tree.hpp.

◆ Super [1/8]

using Super = LoserTreeCopyBase<ValueType, Comparator>

Definition at line 184 of file loser_tree.hpp.

◆ Super [2/8]

using Super = LoserTreeCopyBase<ValueType, Comparator>

Definition at line 251 of file loser_tree.hpp.

◆ Super [3/8]

using Super = LoserTreePointerBase<ValueType, Comparator>

Definition at line 421 of file loser_tree.hpp.

◆ Super [4/8]

using Super = LoserTreePointerBase<ValueType, Comparator>

Definition at line 481 of file loser_tree.hpp.

◆ Super [5/8]

using Super = LoserTreeCopyUnguardedBase<ValueType, Comparator>

Definition at line 615 of file loser_tree.hpp.

◆ Super [6/8]

using Super = LoserTreeCopyUnguardedBase<ValueType, Comparator>

Definition at line 656 of file loser_tree.hpp.

◆ Super [7/8]

using Super = LoserTreePointerUnguardedBase<ValueType, Comparator>

Definition at line 793 of file loser_tree.hpp.

◆ Super [8/8]

using Super = LoserTreePointerUnguardedBase<ValueType, Comparator>

Definition at line 831 of file loser_tree.hpp.

◆ Type

using Type = LoserTreePointer<Stable, ValueType, Comparator>

Definition at line 874 of file loser_tree.hpp.

Function Documentation

◆ LoserTreeCopy() [1/2]

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

Definition at line 193 of file loser_tree.hpp.

◆ LoserTreeCopy() [2/2]

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

Definition at line 260 of file loser_tree.hpp.

◆ LoserTreeCopyBase()

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

◆ LoserTreeCopyUnguarded() [1/2]

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

Definition at line 624 of file loser_tree.hpp.

◆ LoserTreeCopyUnguarded() [2/2]

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

Definition at line 665 of file loser_tree.hpp.

◆ LoserTreeCopyUnguardedBase()

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

◆ LoserTreePointer() [1/2]

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

Definition at line 430 of file loser_tree.hpp.

◆ LoserTreePointer() [2/2]

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

Definition at line 490 of file loser_tree.hpp.

◆ LoserTreePointerBase() [1/3]

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

◆ LoserTreePointerBase() [2/3]

LoserTreePointerBase ( const LoserTreePointerBase< ValueType, Comparator > &  )
delete

◆ LoserTreePointerBase() [3/3]

LoserTreePointerBase ( LoserTreePointerBase< ValueType, Comparator > &&  )
default

◆ LoserTreePointerUnguarded() [1/2]

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

Definition at line 802 of file loser_tree.hpp.

◆ LoserTreePointerUnguarded() [2/2]

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

Definition at line 840 of file loser_tree.hpp.

◆ LoserTreePointerUnguardedBase() [1/2]

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

◆ LoserTreePointerUnguardedBase() [2/2]

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

◆ delete_min_insert() [1/8]

◆ delete_min_insert() [2/8]

◆ delete_min_insert() [3/8]

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

◆ delete_min_insert() [4/8]

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

◆ delete_min_insert() [5/8]

◆ delete_min_insert() [6/8]

◆ delete_min_insert() [7/8]

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

◆ delete_min_insert() [8/8]

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

◆ init() [1/4]

void init ( )
inline

◆ init() [2/4]

void init ( )
inline

◆ init() [3/4]

void init ( )
inline

◆ init() [4/4]

void init ( )
inline

◆ init_winner() [1/4]

◆ init_winner() [2/4]

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.

References LoserTreeCopyBase< ValueType, Comparator >::cmp_, and LoserTreeCopyBase< ValueType, Comparator >::init_winner().

◆ init_winner() [3/4]

◆ init_winner() [4/4]

◆ insert_start() [1/4]

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.

References LoserTreeCopyBase< ValueType, Comparator >::k_, SimpleVector< ValueType, Mode >::size(), LoserTreeCopyBase< ValueType, Comparator >::Loser::source, LoserTreeCopyBase< ValueType, Comparator >::Loser::sup, and TLX_UNLIKELY.

◆ insert_start() [2/4]

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.

References SimpleVector< ValueType, Mode >::size(), LoserTreeCopyBase< ValueType, Comparator >::Loser::source, and tlx::unused().

◆ insert_start() [3/4]

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

◆ insert_start() [4/4]

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

◆ min_source() [1/4]

Source min_source ( )
inline

return the index of the player with the smallest element.

Definition at line 99 of file loser_tree.hpp.

◆ min_source() [2/4]

Source min_source ( )
inline

return the index of the player with the smallest element.

Definition at line 350 of file loser_tree.hpp.

References LoserTreeCopyBase< ValueType, Comparator >::invalid_.

◆ min_source() [3/4]

Source min_source ( )
inline

return the index of the player with the smallest element.

Definition at line 567 of file loser_tree.hpp.

References LoserTreeCopyBase< ValueType, Comparator >::Loser::source.

◆ min_source() [4/4]

Source min_source ( )
inline

Definition at line 749 of file loser_tree.hpp.

◆ operator=() [1/3]

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

◆ operator=() [2/3]

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

◆ operator=() [3/3]

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

Variable Documentation

◆ cmp_ [1/4]

◆ cmp_ [2/4]

Comparator cmp_
protected

the comparator object

Definition at line 331 of file loser_tree.hpp.

◆ cmp_ [3/4]

Comparator cmp_
protected

the comparator object

Definition at line 553 of file loser_tree.hpp.

◆ cmp_ [4/4]

Comparator cmp_
protected

the comparator object

Definition at line 729 of file loser_tree.hpp.

◆ first_insert_

bool first_insert_
protected

still have to construct keys

Definition at line 84 of file loser_tree.hpp.

◆ ik_ [1/4]

const Source ik_
protected

number of nodes

Definition at line 75 of file loser_tree.hpp.

◆ ik_ [2/4]

const Source ik_
protected

number of nodes

Definition at line 325 of file loser_tree.hpp.

◆ ik_ [3/4]

Source ik_
protected

number of nodes

Definition at line 547 of file loser_tree.hpp.

◆ ik_ [4/4]

Source ik_
protected

number of nodes

Definition at line 723 of file loser_tree.hpp.

◆ invalid_ [1/4]

◆ invalid_ [2/4]

constexpr Source invalid_ = Source(-1)
static

sentinel for invalid or finished Sources

Definition at line 313 of file loser_tree.hpp.

◆ invalid_ [3/4]

constexpr Source invalid_ = Source(-1)
static

sentinel for invalid or finished Sources

Definition at line 535 of file loser_tree.hpp.

◆ invalid_ [4/4]

constexpr Source invalid_ = Source(-1)
static

sentinel for invalid or finished Sources

Definition at line 711 of file loser_tree.hpp.

◆ k_ [1/4]

◆ k_ [2/4]

const Source k_
protected

log_2(ik) next greater power of 2

Definition at line 327 of file loser_tree.hpp.

◆ k_ [3/4]

Source k_
protected

log_2(ik) next greater power of 2

Definition at line 549 of file loser_tree.hpp.

◆ k_ [4/4]

Source k_
protected

log_2(ik) next greater power of 2

Definition at line 725 of file loser_tree.hpp.

◆ key [1/2]

◆ key [2/2]

ValueType key

copy of key value of the element in this node

Definition at line 543 of file loser_tree.hpp.

◆ keyp [1/2]

const ValueType* keyp

pointer to key value of the element in this node

Definition at line 321 of file loser_tree.hpp.

◆ keyp [2/2]

const ValueType* keyp

copy of key value of the element in this node

Definition at line 719 of file loser_tree.hpp.

◆ losers_ [1/4]

SimpleVector<Loser> losers_
protected

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

Definition at line 80 of file loser_tree.hpp.

◆ losers_ [2/4]

SimpleVector<Loser> losers_
protected

array containing loser tree nodes

Definition at line 329 of file loser_tree.hpp.

◆ losers_ [3/4]

SimpleVector<Loser> losers_
protected

array containing loser tree nodes

Definition at line 551 of file loser_tree.hpp.

◆ losers_ [4/4]

SimpleVector<Loser> losers_
protected

array containing loser tree nodes

Definition at line 727 of file loser_tree.hpp.

◆ source [1/4]

◆ source [2/4]

Source source

index of source

Definition at line 319 of file loser_tree.hpp.

◆ source [3/4]

Source source

index of source

Definition at line 541 of file loser_tree.hpp.

◆ source [4/4]

Source source

index of source

Definition at line 717 of file loser_tree.hpp.

◆ sup