__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 _LoserTree element. 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 _Compare to use.
  • bool _M_first_insert β€” a state flag that determines whether the _LoserTree is empty.
  • unsigned int _M_ik
  • unsigned int _M_k
  • unsigned 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 to std::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 β€” __index of 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 πŸ’œ