\hypertarget{stats_8h}{}\doxysection{kblib/stats.h File Reference} \label{stats_8h}\index{kblib/stats.h@{kblib/stats.h}} Provides numerical and mathematical utilities. {\ttfamily \#include $<$array$>$}\newline {\ttfamily \#include $<$cassert$>$}\newline {\ttfamily \#include $<$cinttypes$>$}\newline {\ttfamily \#include $<$cstdlib$>$}\newline {\ttfamily \#include $<$limits$>$}\newline {\ttfamily \#include $<$numeric$>$}\newline {\ttfamily \#include \char`\"{}fakestd.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}logic.\+h\char`\"{}}\newline {\ttfamily \#include \char`\"{}tdecl.\+h\char`\"{}}\newline Include dependency graph for stats.\+h\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{stats_8h__incl} \end{center} \end{figure} This graph shows which files directly or indirectly include this file\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{stats_8h__dep__incl} \end{center} \end{figure} \doxysubsection*{Classes} \begin{DoxyCompactItemize} \item struct \mbox{\hyperlink{structkblib_1_1trivial__pair}{kblib\+::trivial\+\_\+pair$<$ T $>$}} \begin{DoxyCompactList}\small\item\em std\+::pair isn\textquotesingle{}t constexpr enough, so I\textquotesingle{}m stuck with this. All I use it for is removing a temporary variable from \mbox{\hyperlink{namespacekblib_a90baddc76df99c83665b9fa3d45609e2}{calc\+\_\+fib\+\_\+size()}}. \end{DoxyCompactList}\item struct \mbox{\hyperlink{structkblib_1_1trivial__array}{kblib\+::trivial\+\_\+array$<$ T, N $>$}} \begin{DoxyCompactList}\small\item\em std\+::array isn\textquotesingle{}t constexpr enough in C++14, so a dedicated array class is needed for constexpr functions. \end{DoxyCompactList}\item struct \mbox{\hyperlink{structkblib_1_1nums_1_1max__t}{kblib\+::nums\+::max\+\_\+t}} \begin{DoxyCompactList}\small\item\em Shorthand for \mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{std\+::numeric\+\_\+limits\+::max()}}. \end{DoxyCompactList}\item struct \mbox{\hyperlink{structkblib_1_1nums_1_1min__t}{kblib\+::nums\+::min\+\_\+t}} \begin{DoxyCompactList}\small\item\em Shorthand for \mbox{\hyperlink{namespacekblib_1_1nums_a24555c4b07301e176bf192adf4e80499}{std\+::numeric\+\_\+limits\+::min()}} \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Namespaces} \begin{DoxyCompactItemize} \item namespace \mbox{\hyperlink{namespacekblib}{kblib}} \begin{DoxyCompactList}\small\item\em The main namespace in which all entities from kblib are defined. \end{DoxyCompactList}\item namespace \mbox{\hyperlink{namespacekblib_1_1nums}{kblib\+::nums}} \end{DoxyCompactItemize} \doxysubsection*{Functions} \begin{DoxyCompactItemize} \item {\footnotesize template$<$typename T , typename U $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_abe1c06264c5e7d5b720416ff9d399fa6}{kblib\+::div}} (T num, U den) noexcept -\/$>$ decltype(std\+::div(num, den)) \item {\footnotesize template$<$typename U $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a90baddc76df99c83665b9fa3d45609e2}{kblib\+::calc\+\_\+fib\+\_\+size}} () noexcept -\/$>$ std\+::size\+\_\+t \begin{DoxyCompactList}\small\item\em Calculate the index of the largest fibonacci number that can be represented by a given unsigned integral type. \end{DoxyCompactList}\item {\footnotesize template$<$typename U , std\+::size\+\_\+t N = calc\+\_\+fib\+\_\+size$<$\+U$>$() + 1$>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a96a777604ed38213d8fd0c1d53c3db70}{kblib\+::make\+\_\+fib\+\_\+arr}} () noexcept -\/$>$ trivial\+\_\+array$<$ U, N $>$ \begin{DoxyCompactList}\small\item\em Generates the first N values of the fibonacci sequence. \end{DoxyCompactList}\item {\footnotesize template$<$typename U = std\+::uintmax\+\_\+t$>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a23d97429c2ea683b83b8223699b30c68}{kblib\+::fibonacci}} (int n) noexcept -\/$>$ U \begin{DoxyCompactList}\small\item\em Compile-\/time table fibonacci function. \end{DoxyCompactList}\item {\footnotesize template$<$typename T = double$>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a6a405377fe79d25ae9ef7a306ee0a32c}{kblib\+::pi}} () -\/$>$ T \item {\footnotesize template$<$typename T = double$>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_aa2267a7d93c70cf8e895349e67c33134}{kblib\+::tau}} () -\/$>$ T \item {\footnotesize template$<$typename T = double$>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a536badb265b62a85034f48e0eac76a1b}{kblib\+::e}} () -\/$>$ T \item {\footnotesize template$<$typename T = double$>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a34b4ea421aff0111137a362312e102b3}{kblib\+::root\+\_\+2}} () -\/$>$ T \item {\footnotesize template$<$typename T = double$>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a92ed80d087175fc1c71cb1894b55671a}{kblib\+::phi}} () -\/$>$ T \item {\footnotesize template$<$typename A , typename F $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_ab43fe07bcd0ea78681fada07d8b9016b}{kblib\+::saturating\+\_\+cast}} (F x) noexcept -\/$>$ enable\+\_\+if\+\_\+t$<$ std\+::is\+\_\+integral$<$ A $>$\+::value and std\+::is\+\_\+integral$<$ F $>$\+::value and std\+::is\+\_\+unsigned$<$ A $>$\+::value, A $>$ \item {\footnotesize template$<$typename T , typename F $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_a21af775319a41ef201e83f51c227f66a}{kblib\+::quantize\+\_\+step}} (F low, F delta, F val) noexcept -\/$>$ T \begin{DoxyCompactList}\small\item\em Quantize a real-\/valued value into a discrete integer. \end{DoxyCompactList}\item {\footnotesize template$<$typename T , typename F $>$ }\\constexpr auto \mbox{\hyperlink{namespacekblib_aa279b601e1bea7b5ae3f50954d398bb2}{kblib\+::quantize\+\_\+range}} (F low, F high, F val) noexcept -\/$>$ T \begin{DoxyCompactList}\small\item\em Quantize a real-\/valued value into a discrete integer. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection*{Variables} \begin{DoxyCompactItemize} \item constexpr struct \mbox{\hyperlink{structkblib_1_1nums_1_1max__t}{kblib\+::nums\+::max\+\_\+t}} \mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{kblib\+::nums\+::max}} \item constexpr struct \mbox{\hyperlink{structkblib_1_1nums_1_1min__t}{kblib\+::nums\+::min\+\_\+t}} \mbox{\hyperlink{namespacekblib_1_1nums_a24555c4b07301e176bf192adf4e80499}{kblib\+::nums\+::min}} \end{DoxyCompactItemize} \doxysubsection{Detailed Description} Provides numerical and mathematical utilities. \begin{DoxyAuthor}{Author} killerbee \end{DoxyAuthor} \begin{DoxyDate}{Date} 2019-\/2021 \end{DoxyDate} \begin{DoxyCopyright}{Copyright} GNU General Public Licence v3.\+0 \end{DoxyCopyright} Definition in file \mbox{\hyperlink{stats_8h_source}{stats.\+h}}.