__GNU_PARALLEL::_LOSERTREEBASE(3cxx)
π
__gnu_parallel::_LoserTreeBase< _Tp, _Compare > β the guarded loser/tournament tree β¨
okay so bestie, welcome to the manual page __gnu_parallel..._Tp, _Compare >(3cxx) β yes the name is a whole mouthful, we don't talk about it π. This is the <losertree.h> situation and it's genuinely iconic, let me walk you through it.
#include <losertree.h>
πΈ NAME πΈ
__gnu_parallel::_LoserTreeBase< _Tp, _Compare > β the guarded loser/tournament tree. no cap, that's its whole thing π
π SYNOPSIS π
So this class is inherited by __gnu_parallel::_LoserTree< __stable, _Tp, _Compare >, and __gnu_parallel::_LoserTree< false, _Tp, _Compare >. it's giving proud parent energy π
π¦ Classes
struct _Loserβ the internal representation of a_LoserTreeelement. lowkey the main character of the internals.
β Public Member Functions
_LoserTreeBase (unsigned int __k, _Compare __comp)β the constructor π«Ά~_LoserTreeBase ()β the destructor, it's giving closure β¨int __get_min_source ()β grabs you the index of the sequence with the smallest element.void __insert_start (const _Tp &__key, int __source, bool __sup)β initializes the sequence'_M_source'with the element'__key'.
π Protected Attributes
_Compare _M_compβ the_Compareto use.bool _M_first_insertβ a state flag that determines whether the_LoserTreeis empty.unsigned int _M_ikunsigned int _M_kunsigned int _M_log_k_Loser * _M_losersβ the_LoserTree__elements.unsigned int _M_offset
π₯ Detailed Description π₯
template<typename _Tp, typename _Compare>
class __gnu_parallel::_LoserTreeBase< _Tp, _Compare >
it's a guarded loser/tournament tree, periodt π
the smallest element is at the top. literally the whole vibe.
the guarding is done explicitly through one flag _M_sup per element β inf is not needed because there's a better initialization routine. this is a well-performing variant, ngl it ate π₯
π Parameters
_Tpβ the element type_Compareβ the comparator to use, defaults tostd::less<_Tp>
π§ Constructor & Destructor Documentation π§
π template<typename _Tp , typename _Compare > __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_LoserTreeBase (unsigned int __k, _Compare __comp) [inline]
the constructor π
Parameters
__kβ the number of sequences to merge.__compβ the comparator to use.
References: __gnu_parallel::__rd_log2(), __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_first_insert, __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_log_k, and __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_losers.
π template<typename _Tp , typename _Compare > __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::~_LoserTreeBase () [inline]
the destructor π«Ά
References: __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_losers.
β¨ Member Function Documentation β¨
π template<typename _Tp , typename _Compare > int __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::__get_min_source () [inline]
Returns
the index of the sequence with the smallest element π
References: __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_losers, and __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_Loser::_M_source.
πΈ template<typename _Tp , typename _Compare > void __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::__insert_start (const _Tp & __key, int __source, bool __sup) [inline]
initializes the sequence '_M_source' with the element '__key' π¦
Parameters
__keyβ the element to insert__sourceβ__indexof the__source__sequence__supβ flag that determines whether the value to insert is an explicit__supremum.
References: __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_first_insert, __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_Loser::_M_key, __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_losers, __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_Loser::_M_source, and __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_Loser::_M_sup.
π Member Data Documentation π
π template<typename _Tp , typename _Compare > _Compare __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_comp [protected]
_Compare to use. that's it, that's the field β¨
π template<typename _Tp , typename _Compare > bool __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_first_insert [protected]
state flag that determines whether the _LoserTree is empty. only used for building the _LoserTree π«Ά
Referenced by __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_LoserTreeBase(), and __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::__insert_start().
β template<typename _Tp , typename _Compare > unsigned int __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_log_k [protected]
log_2{_M_k} β that's the entire description bestie, it's giving minimalism π
Referenced by __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_LoserTreeBase().
π¦ template<typename _Tp , typename _Compare > _Loser* __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_losers [protected]
the _LoserTree __elements. the actual tree, the whole point π₯
Referenced by __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_LoserTreeBase(), __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::~_LoserTreeBase(), __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::__get_min_source(), and __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::__insert_start().
π Author π
generated automatically by Doxygen for libstdc++ from the source code. no human hand-wrote this, the robots did it π
ok that's the whole page bestie, go merge some sequences πβ¨
sign-off: this was libstd__gnu_parallel..._Tp, _Compare >(3cxx), brought to you by libstdc++ and its Doxygen robot overlords π iykyk π
π¦ where this page comes from
- debian trixie: libstdc++-12-doc 12.4.0-5
- debian trixie: libstdc++-13-doc 13.3.0-16
- debian trixie: libstdc++-14-doc 14.2.0-19
- ubuntu noble: libstdc++-10-doc 10.5.0-4ubuntu2
- ubuntu noble: libstdc++-10-doc 10.5.0-4ubuntu2.1
- ubuntu noble: libstdc++-11-doc 11.4.0-9ubuntu1
- ubuntu noble: libstdc++-11-doc 11.5.0-1ubuntu1~24.04.1
- ubuntu noble: libstdc++-12-doc 12.3.0-17ubuntu1
- ubuntu noble: libstdc++-12-doc 12.4.0-2ubuntu1~24.04.1
- ubuntu noble: libstdc++-13-doc 13.2.0-23ubuntu4
- ubuntu noble: libstdc++-13-doc 13.3.0-6ubuntu2~24.04.1
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- ubuntu noble: libstdc++-14-doc 14.2.0-4ubuntu2~24.04.1
- ubuntu questing: libstdc++-11-doc 11.5.0-7ubuntu1
- ubuntu questing: libstdc++-11-doc 11.5.0-7ubuntu1.1
- ubuntu questing: libstdc++-12-doc 12.5.0-6ubuntu1
- ubuntu questing: libstdc++-13-doc 13.4.0-4ubuntu1
- ubuntu questing: libstdc++-14-doc 14.3.0-8ubuntu1
- ubuntu questing: libstdc++-15-doc 15.2.0-4ubuntu4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms