__GNU_PARALLEL::LOSERTREEBASE(3)
π
bestie, welcome to the __gnu_para...serTreeBase(3) page π
okay so this is the __gnu_para...serTreeBase(3) page from the Library Functions Manual, and we're talking about __gnu_parallel::LoserTreeBase β the guarded loser/tournament tree. yes, the name is a lot, but it's literally giving βsmallest element at the topβ main character energy. π
π NAME π
__gnu_parallel::LoserTreeBase β Guarded loser/tournament tree. that's the official name line, and we're keeping it exactly. periodt.
β¨ SYNOPSIS β¨
πΈ Classes πΈ
struct Loserβ Internal representation of a LoserTree element. yes, that's the whole description, and it's doing its job. π«Ά
π«Ά Public Member Functions π«Ά
int get_min_source ()void insert_start (const T &key, int source, bool sup)LoserTreeBase (unsigned int _k, Comparator _comp)~LoserTreeBase ()
these are the public member function signatures, no cap. π
π Protected Attributes π
unsigned int _M_log_kComparator compbool first_insertunsigned int ikunsigned int kLoser * losersunsigned int offset
all seven of these are protected, so bestie, respect the boundary. π
π Detailed Description π
template<typename T, typename Comparator> class
__gnu_parallel::LoserTreeBase< T, Comparator >
Guarded loser/tournament tree. The smallest element is at the top β yes, that's the whole point. π
Guarding is done explicitly through one flag sup per element, and inf is not needed due to a better initialization routine. This is a well-performing variant. no cap. β¨
Parameters:
Tβ the element typeComparatorβ the comparator to use, defaults tostd::less<T>
Definition at line 57 of file losertree.h. yes, line 57, not line 5, not line 7. π
π Constructor & Destructor Documentation π
π£ LoserTreeBase constructor
template<typename T, typename Comparator> __gnu_parallel::LoserTreeBase< T,
Comparator >::LoserTreeBase (unsigned int _k, Comparator _comp) [inline]
The constructor.
Parameters:
_kβ The number of sequences to merge._compβ The comparator to use.
Definition at line 96 of file losertree.h.
π«§ ~LoserTreeBase destructor
template<typename T, typename Comparator> __gnu_parallel::LoserTreeBase< T,
Comparator >::~LoserTreeBase () [inline]
The destructor.
Definition at line 119 of file losertree.h.
π₯ Member Function Documentation π₯
π get_min_source
template<typename T, typename Comparator> int __gnu_parallel::LoserTreeBase<
T, Comparator >::get_min_source () [inline]
Returns:
- the index of the sequence with the smallest element.
Definition at line 152 of file losertree.h.
π insert_start
template<typename T, typename Comparator> void
__gnu_parallel::LoserTreeBase< T, Comparator >::insert_start (const T &
key, int source, bool sup) [inline]
Initializes the sequence 'source' with the element 'key'. yes, those quotes are doing the lord's work. π
Parameters:
keyβ the element to insertsourceβ index of the source sequencesupβ flag that determines whether the value to insert is an explicit supremum.
Definition at line 131 of file losertree.h.
π Member Data Documentation π
unsigned int _M_log_k[protected]βlog_2{k}. Definition at line 74 of filelosertree.h. Referenced by__gnu_parallel::LoserTreeBase< T, Comparator >::LoserTreeBase().Comparator comp[protected]β Comparator to use. Definition at line 80 of filelosertree.h.bool first_insert[protected]β State flag that determines whether the LoserTree is empty. Only used for building the LoserTree. Definition at line 87 of filelosertree.h. Referenced by__gnu_parallel::LoserTreeBase< T, Comparator >::insert_start(), and__gnu_parallel::LoserTreeBase< T, Comparator >::LoserTreeBase().Loser* losers[protected]β LoserTree elements. Definition at line 77 of filelosertree.h. Referenced by__gnu_parallel::LoserTreeBase< T, Comparator >::get_min_source(),__gnu_parallel::LoserTreeBase< T, Comparator >::insert_start(),__gnu_parallel::LoserTreeBase< T, Comparator >::LoserTreeBase(), and__gnu_parallel::LoserTreeBase< T, Comparator >::~LoserTreeBase().
also chilling in the protected attributes list from the synopsis: unsigned int ik, unsigned int k, and unsigned int offset. the original page doesn't give these three their own member-data blurbs, so we're not inventing any. π«Ά
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. yes, bestie, the author is Doxygen. a bot wrote it and still ate. π
okay bestie, that's the whole page. source/version: libstdc++; date: 21 Apr 2009; footer title: __gnu_para...serTreeBase(3). go merge those sequences and slay. πβ¨
π¦ where this page comes from
- nixpkgs unstable: std-man-pages 4.4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms