4 Commits
Author SHA1 Message Date
Lucas Chollet f4bde6ab14 Everywhere: Fix -Wunused-template warnings emited by recent Clang
The latest version of Clang got better at detecting unused templates. It
detected one truly unused template in our codebase. The rest are either
from templated functions that are not always used (depending on the
compile-time configuration) or from templated functions that are
incorrectly annotated with static.
2026-08-22 21:48:49 +02:00
Nico Weber e897b9d744 Everywhere: Use more granular AK/Math/ includes in a few headers
...and in a few cpp files too, and clean up missing includes.

Reduces number of files recompiled after touching AK/Math/Hyperbolic.h
from a couple thousand to a handful.

No behavior change.
2026-06-21 15:26:06 -04:00
Staubfinger da1023fcc5 AK: Add thresholds to quickselect_inline and Statistics::Median
I did a bit of Profiling and made the quickselect and median algorithms
use the best of option for the respective input size.
2023-02-03 19:04:15 +01:00
Staubfinger 607441de56 AK: Implement the quick select algorithm as AK::quickselect_inplace
This adds the quick select algorithm that finds
the kth smallest element for any collection.
Whilst doing so it also partially sorts the collection.
I have also included the option to use different pivoting functions
including median of medians which makes the quick select have
a truely linear time complexity at the costs of enormous overhead,
so this that only really useful for really large datasets.
The same was chosen to reflect the fact that it modifies
the collection in place during the selection process.
2023-02-03 19:04:15 +01:00