__GNU_PARALLEL::_LOSERTREEBASE(3)

πŸ“¦
version 16.2.1+r23+gd564253eb6c8 Β· 5 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44

πŸ¦‹ 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 _LoserTree element. 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 β€” _Compare to use.
  • bool _M_first_insert β€” 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 β€” _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 🌈

  • _Tp the element type
  • _Compare the comparator to use, defaults to std::less<_Tp>

πŸ’– Constructor & Destructor Documentation πŸ’–

__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(), _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:

  • __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 _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