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 183 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 250 of file loser_tree.hpp.

using Source = uint32_t

size of counters and array indexes

Definition at line 308 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 418 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 478 of file loser_tree.hpp.

using Source = uint32_t

size of counters and array indexes

Definition at line 528 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 611 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 652 of file loser_tree.hpp.

using Source = uint32_t

size of counters and array indexes

Definition at line 703 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 787 of file loser_tree.hpp.

using Source = typename Super::Source

Definition at line 825 of file loser_tree.hpp.

using Super = LoserTreeCopyBase<ValueType, Comparator>

Definition at line 182 of file loser_tree.hpp.

using Super = LoserTreeCopyBase<ValueType, Comparator>

Definition at line 249 of file loser_tree.hpp.

using Super = LoserTreePointerBase<ValueType, Comparator>

Definition at line 417 of file loser_tree.hpp.

using Super = LoserTreePointerBase<ValueType, Comparator>

Definition at line 477 of file loser_tree.hpp.

using Super = LoserTreeCopyUnguardedBase<ValueType, Comparator>

Definition at line 610 of file loser_tree.hpp.

using Super = LoserTreeCopyUnguardedBase<ValueType, Comparator>

Definition at line 651 of file loser_tree.hpp.

using Super = LoserTreePointerUnguardedBase<ValueType, Comparator>

Definition at line 786 of file loser_tree.hpp.

using Super = LoserTreePointerUnguardedBase<ValueType, Comparator>

Definition at line 824 of file loser_tree.hpp.

using Type = LoserTreePointer<Stable, ValueType, Comparator>

Definition at line 867 of file loser_tree.hpp.

Function Documentation

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

Definition at line 196 of file loser_tree.hpp.

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

Definition at line 263 of file loser_tree.hpp.

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

Definition at line 429 of file loser_tree.hpp.

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

Definition at line 489 of file loser_tree.hpp.

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

Definition at line 624 of file loser_tree.hpp.

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

Definition at line 665 of file loser_tree.hpp.

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

Definition at line 799 of file loser_tree.hpp.

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

Definition at line 837 of file loser_tree.hpp.

void init ( )
inline

Definition at line 157 of file loser_tree.hpp.

void init ( )
inline

Definition at line 395 of file loser_tree.hpp.

void init ( )
inline

Definition at line 597 of file loser_tree.hpp.

void init ( )
inline

Definition at line 773 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 137 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 375 of file loser_tree.hpp.

Source init_winner ( const Source root)
inline

Definition at line 579 of file loser_tree.hpp.

Source init_winner ( const Source root)
inline

Definition at line 755 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 360 of file loser_tree.hpp.

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

Definition at line 569 of file loser_tree.hpp.

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

Definition at line 746 of file loser_tree.hpp.

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

Definition at line 191 of file loser_tree.hpp.

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

Definition at line 258 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 619 of file loser_tree.hpp.

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

Definition at line 660 of file loser_tree.hpp.

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

Definition at line 552 of file loser_tree.hpp.

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

Definition at line 426 of file loser_tree.hpp.

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

Definition at line 486 of file loser_tree.hpp.

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

Definition at line 332 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 795 of file loser_tree.hpp.

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

Definition at line 833 of file loser_tree.hpp.

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

Definition at line 727 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 348 of file loser_tree.hpp.

Source min_source ( )
inline

return the index of the player with the smallest element.

Definition at line 563 of file loser_tree.hpp.

Source min_source ( )
inline

Definition at line 744 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 329 of file loser_tree.hpp.

Comparator cmp_
protected

the comparator object

Definition at line 549 of file loser_tree.hpp.

Comparator cmp_
protected

the comparator object

Definition at line 724 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 323 of file loser_tree.hpp.

Source ik_
protected

number of nodes

Definition at line 543 of file loser_tree.hpp.

Source ik_
protected

number of nodes

Definition at line 718 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 311 of file loser_tree.hpp.

constexpr Source invalid_
static

sentinel for invalid or finished Sources

Definition at line 531 of file loser_tree.hpp.

constexpr Source invalid_
static

sentinel for invalid or finished Sources

Definition at line 706 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 325 of file loser_tree.hpp.

Source k_
protected

log_2(ik) next greater power of 2

Definition at line 545 of file loser_tree.hpp.

Source k_
protected

log_2(ik) next greater power of 2

Definition at line 720 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 539 of file loser_tree.hpp.

const ValueType* keyp

pointer to key value of the element in this node

Definition at line 319 of file loser_tree.hpp.

const ValueType* keyp

copy of key value of the element in this node

Definition at line 714 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 327 of file loser_tree.hpp.

SimpleVector<Loser> losers_
protected

array containing loser tree nodes

Definition at line 547 of file loser_tree.hpp.

SimpleVector<Loser> losers_
protected

array containing loser tree nodes

Definition at line 722 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 317 of file loser_tree.hpp.

Source source

index of source

Definition at line 537 of file loser_tree.hpp.

Source source

index of source

Definition at line 712 of file loser_tree.hpp.

bool sup

flag, true iff is a virtual maximum sentinel

Definition at line 67 of file loser_tree.hpp.