__GNU_PARALLEL::_LOSERTREEBASE(3)
π¦ NAME π¦
okay bestie, say hi to __gnu_parallel::_LoserTreeBase< _Tp, _Compare > β it's a Guarded loser/tournament tree, and yes it's literally as iconic as it sounds π
(this whole thing lives in the Library Functions Manual, iykyk)
β¨ SYNOPSIS β¨
#include <losertree.h>
so the way that this works: it's inherited by __gnu_parallel::_LoserTree< false, _Tp, _Compare >, __gnu_parallel::_LoserTree< __stable, _Tp, _Compare >, and __gnu_parallel::_LoserTree< false, _Tp, _Compare >. yes bestie, that last one is listed twice β I don't make the rules, I just report them π
π Classes π
struct _Loserβ Internal representation of a_LoserTreeelement. it's the little internal baddie doing the actual work.
π«Ά Public Member Functions π«Ά
_LoserTreeBase (unsigned int __k, _Compare __comp)β The constructor. the glow-up moment β¨~_LoserTreeBase ()β The destructor. it's giving closure, literally.int __get_min_source ()void __insert_start (const _Tp &__key, int __source, bool __sup)β Initializes the sequence_M_source"withtheelement__key.
π Protected Attributes π
_Compare _M_compβ_Compareto use.bool _M_first_insertβ State flag that determines whether the_LoserTreeis empty.unsigned int _M_ikunsigned int _M_kunsigned int _M_log_k_Loser * _M_losersβ_LoserTree __elements.unsigned int _M_offset
πΈ Detailed Description πΈ
template<typename _Tp, typename _Compare>
class __gnu_parallel::_LoserTreeBase< _Tp, _Compare >"Guarded loser/tournament tree.
The smallest element is at the top. like, the main character is always at the top of the feed, no cap π
Guarding is done explicitly through one flag _M_sup per element, inf is not needed due to a better initialization routine. This is a well-performing variant. fr fr, it ate.
π Parameters π
_Tpthe element type_Comparethe comparator to use, defaults tostd::less<_Tp>
π Constructor & Destructor Documentation π
__gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_LoserTreeBase (unsigned int __k, _Compare __comp) [inline]
The constructor.
Parameters:
__kThe number of sequences to merge.__compThe comparator to use.
References __gnu_parallel::__rd_log2(), _M_comp, _M_first_insert, _M_log_k, and _M_losers.
__gnu_parallel::_LoserTreeBase< _Tp, _Compare >::~_LoserTreeBase () [inline]
The destructor.
References _M_losers.
π₯ Member Function Documentation π₯
int __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::__get_min_source () [inline]
Returns: the index of the sequence with the smallest element.
References _M_losers.
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:
__keythe element to insert__source__indexof the__source__sequence__supflag that determines whether the value to insert is an explicit__supremum.
References _M_first_insert, and _M_losers.
π§ Member Data Documentation π§
_Compare __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_comp [protected]
_Compare to use.
Referenced by _LoserTreeBase().
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 _LoserTreeBase(), and __insert_start().
unsigned int __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_log_k [protected]
log_2{_M_k}
Referenced by _LoserTreeBase().
_Loser* __gnu_parallel::_LoserTreeBase< _Tp, _Compare >::_M_losers [protected]
_LoserTree __elements.
Referenced by _LoserTreeBase(), ~_LoserTreeBase(), __get_min_source(), and __insert_start().
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
okay that's the whole thing bestie, every flag and field accounted for, we left nothing on read π
and that's a wrap on this libstdc++ __gnu_para... _Compare >(3) page β go forth and merge your sequences, you absolute icon ππ«Ά
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- centos-stream 10: gcc-toolset-15-libstdc++-docs 15.2.1-8.1.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- centos-stream 10: libstdc++-docs 14.4.1-4.el10 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 43: libstdc++-docs 15.2.1-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 43: libstdc++-docs 15.3.1-1.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms