\doxysubsection{Argument\+Record\texorpdfstring{$<$}{<} TIN \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classfunc_1_1ArgumentRecord}{}\label{classfunc_1_1ArgumentRecord}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}


A class used internally by FunC. Wraps a vector of unsigned int that act as a histogram for recording the usage of a function\textquotesingle{}s domain.  




{\ttfamily \#include $<$Argument\+Record.\+hpp$>$}

\doxysubsubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classfunc_1_1ArgumentRecord_af2e1cac5d1438304d3357a431b8fd660}{Argument\+Record}} (TIN min, TIN max, unsigned int hist\+Size, std\+::ostream \texorpdfstring{$\ast$}{*}streamer)
\item 
\mbox{\hyperlink{classfunc_1_1ArgumentRecord_a9da2e7502a8cfc852e8dfe2107282399}{\texorpdfstring{$\sim$}{\string~}\+Argument\+Record}} ()
\item 
\mbox{\hyperlink{classfunc_1_1ArgumentRecord_a9c7f243579c213a1325c291c676432e9}{Argument\+Record}} (nlohmann\+::json json\+Stats)
\item 
void \mbox{\hyperlink{classfunc_1_1ArgumentRecord_a69096690eaee4709ba1bd49ceb3c080d}{record\+\_\+arg}} (TIN x)
\item 
{\footnotesize template$<$typename T$>$ }\\std\+::string \mbox{\hyperlink{classfunc_1_1ArgumentRecord_a5897b6b92e9688e5a8984ba0b02f0c67}{to\+\_\+string\+\_\+with\+\_\+precision}} (const T val, const int n=std\+::numeric\+\_\+limits$<$ T $>$\+::max\+\_\+digits10) const
\item 
\Hypertarget{classfunc_1_1ArgumentRecord_aa2b8db98bc99a2f1826d1eff111dd904}\label{classfunc_1_1ArgumentRecord_aa2b8db98bc99a2f1826d1eff111dd904} 
std\+::string {\bfseries ith\+\_\+interval} (unsigned int i, const int n=3) const
\item 
std\+::string \mbox{\hyperlink{classfunc_1_1ArgumentRecord_aac993ecccd3d88aafefb6b8e3caa1dee}{to\+\_\+string}} () const
\item 
void \mbox{\hyperlink{classfunc_1_1ArgumentRecord_a4fe9a6c97f911a2762a594bc8e386b0e}{print\+\_\+json}} (nlohmann\+::json \&json\+Stats) const
\item 
\Hypertarget{classfunc_1_1ArgumentRecord_a6a79eec136c95d9acc7bf421e361479f}\label{classfunc_1_1ArgumentRecord_a6a79eec136c95d9acc7bf421e361479f} 
TIN {\bfseries min\+\_\+arg} () const
\item 
\Hypertarget{classfunc_1_1ArgumentRecord_aa0de0dec96359f6e6d35aa69607b387a}\label{classfunc_1_1ArgumentRecord_aa0de0dec96359f6e6d35aa69607b387a} 
TIN {\bfseries max\+\_\+arg} () const
\item 
\Hypertarget{classfunc_1_1ArgumentRecord_a13309bf7e21833d4f6fd6e39b328e5d4}\label{classfunc_1_1ArgumentRecord_a13309bf7e21833d4f6fd6e39b328e5d4} 
unsigned int {\bfseries total\+\_\+recorded} () const
\item 
unsigned int \mbox{\hyperlink{classfunc_1_1ArgumentRecord_a5b508c779f7820737fc5ead6a6bb1258}{index\+\_\+of\+\_\+peak}} () const
\item 
unsigned int \mbox{\hyperlink{classfunc_1_1ArgumentRecord_ae6304c0a29b41abe2b09381b9e1821bf}{peak}} () const
\item 
unsigned int \mbox{\hyperlink{classfunc_1_1ArgumentRecord_aef781ba3b4c69a86519bddcef2a366dc}{num\+\_\+out\+\_\+of\+\_\+bounds}} () const
\item 
TIN \mbox{\hyperlink{classfunc_1_1ArgumentRecord_af043b74da36864d260edafe53f102f0e}{max\+\_\+recorded}} () const
\item 
\Hypertarget{classfunc_1_1ArgumentRecord_a18cfc28188133201ce00f8d0bc8bcd69}\label{classfunc_1_1ArgumentRecord_a18cfc28188133201ce00f8d0bc8bcd69} 
TIN {\bfseries min\+\_\+recorded} () const
\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
\subsubsection*{template$<$typename TIN$>$\newline
class func\+::\+Argument\+Record$<$ TIN $>$}
A class used internally by FunC. Wraps a vector of unsigned int that act as a histogram for recording the usage of a function\textquotesingle{}s domain. 

When constructed with a std\+::ostream, this will print to that ostream when the destructor is called. It is okay for provided arguments to be out of bounds. In this case, the max or min arg recorded will be updated, but the histogram\textquotesingle{}s bounds will not grow dynamically.

\begin{DoxyNote}{Note}
Code from this class is only included in FunC if the -\/DFUNC\+\_\+\+DEBUG flag is specified at compile time and \doxylink{classfunc_1_1DirectEvaluation}{Direct\+Evaluation} and \doxylink{classfunc_1_1FailureProofTable}{Failure\+Proof\+Table} are the only classes that might use an \doxylink{classfunc_1_1ArgumentRecord}{Argument\+Record}. 

An \doxylink{classfunc_1_1ArgumentRecord}{Argument\+Record} is designed to be a private member variable. 

Recording arguments is threadsafe.
\end{DoxyNote}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000006}{Todo}}]Implement functions to\+\_\+json \& from\+\_\+json 

The histogram will never have that many buckets so we could likely get away with simply making every one of this class\textquotesingle{}s member variables threadprivate. 

Perhaps we should use boost histogram instead but that would add an additional dependency \end{DoxyRefDesc}


\label{doc-constructors}
\Hypertarget{classfunc_1_1ArgumentRecord_doc-constructors}
\doxysubsubsection{Constructor \& Destructor Documentation}
\Hypertarget{classfunc_1_1ArgumentRecord_af2e1cac5d1438304d3357a431b8fd660}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!ArgumentRecord@{ArgumentRecord}}
\index{ArgumentRecord@{ArgumentRecord}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{ArgumentRecord()}{ArgumentRecord()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_af2e1cac5d1438304d3357a431b8fd660} 
template$<$typename TIN$>$ \\
\mbox{\hyperlink{classfunc_1_1ArgumentRecord}{Argument\+Record}} (\begin{DoxyParamCaption}\item[{TIN}]{min}{, }\item[{TIN}]{max}{, }\item[{unsigned int}]{hist\+Size}{, }\item[{std\+::ostream \texorpdfstring{$\ast$}{*}}]{streamer}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Arguments min and max determine histogram bounds, affecting the output in the printed histogram. hist\+Size is the number of buckets. When provided an ostream != nullptr, this class will output \texorpdfstring{$\ast$}{*}this to ostream when destructed \Hypertarget{classfunc_1_1ArgumentRecord_a9da2e7502a8cfc852e8dfe2107282399}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!````~ArgumentRecord@{\texorpdfstring{$\sim$}{\string~}ArgumentRecord}}
\index{````~ArgumentRecord@{\texorpdfstring{$\sim$}{\string~}ArgumentRecord}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{\texorpdfstring{$\sim$}{\string~}ArgumentRecord()}{\string~ArgumentRecord()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_a9da2e7502a8cfc852e8dfe2107282399} 
template$<$typename TIN$>$ \\
\texorpdfstring{$\sim$}{\string~}\mbox{\hyperlink{classfunc_1_1ArgumentRecord}{Argument\+Record}} (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Print to the optional argument mp\+\_\+streamer if one was provided at the time of construction \Hypertarget{classfunc_1_1ArgumentRecord_a9c7f243579c213a1325c291c676432e9}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!ArgumentRecord@{ArgumentRecord}}
\index{ArgumentRecord@{ArgumentRecord}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{ArgumentRecord()}{ArgumentRecord()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_a9c7f243579c213a1325c291c676432e9} 
template$<$typename TIN$>$ \\
\mbox{\hyperlink{classfunc_1_1ArgumentRecord}{Argument\+Record}} (\begin{DoxyParamCaption}\item[{nlohmann\+::json}]{json\+Stats}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Rebuild our argument record \begin{DoxyNote}{Note}
This assumes the encapsulating \doxylink{classfunc_1_1LookupTable}{Lookup\+Table} provided a valid json object 
\end{DoxyNote}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000007}{Todo}}]Maybe optionally provide an ostream? \end{DoxyRefDesc}


\label{doc-func-members}
\Hypertarget{classfunc_1_1ArgumentRecord_doc-func-members}
\doxysubsubsection{Member Function Documentation}
\Hypertarget{classfunc_1_1ArgumentRecord_a5b508c779f7820737fc5ead6a6bb1258}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!index\_of\_peak@{index\_of\_peak}}
\index{index\_of\_peak@{index\_of\_peak}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{index\_of\_peak()}{index\_of\_peak()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_a5b508c779f7820737fc5ead6a6bb1258} 
template$<$typename TIN$>$ \\
unsigned int index\+\_\+of\+\_\+peak (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the index of the bucket with the largest count. \Hypertarget{classfunc_1_1ArgumentRecord_af043b74da36864d260edafe53f102f0e}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!max\_recorded@{max\_recorded}}
\index{max\_recorded@{max\_recorded}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{max\_recorded()}{max\_recorded()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_af043b74da36864d260edafe53f102f0e} 
template$<$typename TIN$>$ \\
TIN max\+\_\+recorded (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the extreme args to help the user decide what bounds to use for their LUTs. \Hypertarget{classfunc_1_1ArgumentRecord_aef781ba3b4c69a86519bddcef2a366dc}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!num\_out\_of\_bounds@{num\_out\_of\_bounds}}
\index{num\_out\_of\_bounds@{num\_out\_of\_bounds}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{num\_out\_of\_bounds()}{num\_out\_of\_bounds()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_aef781ba3b4c69a86519bddcef2a366dc} 
template$<$typename TIN$>$ \\
unsigned int num\+\_\+out\+\_\+of\+\_\+bounds (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the number of elements outside the histogram\textquotesingle{}s range. \Hypertarget{classfunc_1_1ArgumentRecord_ae6304c0a29b41abe2b09381b9e1821bf}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!peak@{peak}}
\index{peak@{peak}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{peak()}{peak()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_ae6304c0a29b41abe2b09381b9e1821bf} 
template$<$typename TIN$>$ \\
unsigned int peak (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Return the count from the bucket with the largest count. \Hypertarget{classfunc_1_1ArgumentRecord_a4fe9a6c97f911a2762a594bc8e386b0e}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!print\_json@{print\_json}}
\index{print\_json@{print\_json}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{print\_json()}{print\_json()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_a4fe9a6c97f911a2762a594bc8e386b0e} 
template$<$typename TIN$>$ \\
void print\+\_\+json (\begin{DoxyParamCaption}\item[{nlohmann\+::json \&}]{json\+Stats}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Print each field in this class to the given ostream. \Hypertarget{classfunc_1_1ArgumentRecord_a69096690eaee4709ba1bd49ceb3c080d}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!record\_arg@{record\_arg}}
\index{record\_arg@{record\_arg}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{record\_arg()}{record\_arg()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_a69096690eaee4709ba1bd49ceb3c080d} 
template$<$typename TIN$>$ \\
void record\+\_\+arg (\begin{DoxyParamCaption}\item[{TIN}]{x}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Place x in the histogram. Mimic pipeline parallelism for any statistics with only one instance \Hypertarget{classfunc_1_1ArgumentRecord_aac993ecccd3d88aafefb6b8e3caa1dee}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!to\_string@{to\_string}}
\index{to\_string@{to\_string}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{to\_string()}{to\_string()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_aac993ecccd3d88aafefb6b8e3caa1dee} 
template$<$typename TIN$>$ \\
std\+::string to\+\_\+string (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Make a string representation of the histogram. \Hypertarget{classfunc_1_1ArgumentRecord_a5897b6b92e9688e5a8984ba0b02f0c67}\index{ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}!to\_string\_with\_precision@{to\_string\_with\_precision}}
\index{to\_string\_with\_precision@{to\_string\_with\_precision}!ArgumentRecord$<$ TIN $>$@{ArgumentRecord$<$ TIN $>$}}
\doxyparagraph{\texorpdfstring{to\_string\_with\_precision()}{to\_string\_with\_precision()}}
{\footnotesize\ttfamily \label{classfunc_1_1ArgumentRecord_a5897b6b92e9688e5a8984ba0b02f0c67} 
template$<$typename TIN$>$ \\
template$<$typename T$>$ \\
std\+::string to\+\_\+string\+\_\+with\+\_\+precision (\begin{DoxyParamCaption}\item[{const T}]{val}{, }\item[{const int}]{n}{ = {\ttfamily std\+:\+:numeric\+\_\+limits$<$T$>$\+:\+:max\+\_\+digits10}}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

std\+::to\+\_\+string(1e-\/7) == "{}0"{} which is unacceptable so we\textquotesingle{}ll use this code from this SO post \href{https://stackoverflow.com/questions/16605967/set-precision-of-stdto-string-when-converting-floating-point-values}{\texttt{https\+://stackoverflow.\+com/questions/16605967/set-\/precision-\/of-\/stdto-\/string-\/when-\/converting-\/floating-\/point-\/values}} Default is the max possible precision by so users can choose how they\textquotesingle{}ll round the answer on their own 

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Argument\+Record.\+hpp\end{DoxyCompactItemize}
