\doxysubsection{Lookup\+Table\+Comparator\texorpdfstring{$<$}{<} TIN, TOUT \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classfunc_1_1LookupTableComparator}{}\label{classfunc_1_1LookupTableComparator}\index{LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}}


Compare the average time taken to call the {\ttfamily operator()} of any \doxylink{classfunc_1_1LookupTable}{Lookup\+Table} implementation.  




{\ttfamily \#include $<$Lookup\+Table\+Comparator.\+hpp$>$}

\doxysubsubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classfunc_1_1LookupTableComparator_aed60450c2653d72ecc17ed3b3cc79a87}{Lookup\+Table\+Comparator}} (Impl\+Container$<$ TIN, TOUT $>$ \&in\+Impl, TIN min\+Arg, TIN max\+Arg, unsigned int n\+Evals=100000, unsigned int seed=2017, std\+::unique\+\_\+ptr$<$ \mbox{\hyperlink{classfunc_1_1RngInterface}{Rng\+Interface}}$<$ TIN $>$ $>$ in\+Rng=nullptr)
\item 
void \mbox{\hyperlink{classfunc_1_1LookupTableComparator_a1cf984894de91e06811ebf079dd292c9}{run\+\_\+timings}} (int n\+Runs=1)
\item 
void \mbox{\hyperlink{classfunc_1_1LookupTableComparator_a004071b7d33eb4503a8475586d5692f5}{compute\+\_\+statistics}} ()
\item 
void \mbox{\hyperlink{classfunc_1_1LookupTableComparator_acd40b60e087c3501ad9a8385d70c85f7}{sort\+\_\+timings}} (Sorter type=Sorter\+::\+MEAN)
\item 
void \mbox{\hyperlink{classfunc_1_1LookupTableComparator_ae4fed734fa2927c2a4e3ca1cae5a2626}{print\+\_\+summary}} (std\+::ostream \&)
\item 
void \mbox{\hyperlink{classfunc_1_1LookupTableComparator_a181f9bb4a6ef8a9972084da26d33fd80}{print\+\_\+json}} (std\+::ostream \&)
\item 
\Hypertarget{classfunc_1_1LookupTableComparator_af71f5eb8e7cd613e7d6e8cac6f4ddd2f}\label{classfunc_1_1LookupTableComparator_af71f5eb8e7cd613e7d6e8cac6f4ddd2f} 
void {\bfseries print\+\_\+csv\+\_\+header} (std\+::ostream \&)
\item 
void \mbox{\hyperlink{classfunc_1_1LookupTableComparator_a63bb935a28e8b772e5bf13b39c942ac5}{print\+\_\+csv}} (std\+::ostream \&, Sorter type=Sorter\+::\+NONE)
\item 
\Hypertarget{classfunc_1_1LookupTableComparator_a3593479ca47a6f311be5243eb0d5cf84}\label{classfunc_1_1LookupTableComparator_a3593479ca47a6f311be5243eb0d5cf84} 
std\+::vector$<$ double $>$ {\bfseries fastest\+\_\+times} ()
\item 
\Hypertarget{classfunc_1_1LookupTableComparator_ae50f9f2e92f556126d88a444ff231ccc}\label{classfunc_1_1LookupTableComparator_ae50f9f2e92f556126d88a444ff231ccc} 
std\+::vector$<$ double $>$ {\bfseries slowest\+\_\+times} ()
\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}
\subsubsection*{template$<$typename TIN, typename TOUT = TIN$>$\newline
class func\+::\+Lookup\+Table\+Comparator$<$ TIN, TOUT $>$}
Compare the average time taken to call the {\ttfamily operator()} of any \doxylink{classfunc_1_1LookupTable}{Lookup\+Table} implementation. 

For example usage, see any file in the examples directory.

\begin{DoxyNote}{Note}
This class takes ownership of the vector of LUT implementations it is constructed with 

Points are randomly sampled, and by default uses a {\ttfamily std\+::uniform\+\_\+real\+\_\+distribution\texorpdfstring{$<$}{<}TIN\texorpdfstring{$>$}{>}} with the {\ttfamily std\+::mt19937} variant of the {\ttfamily std\+::mersenne\+\_\+twister\+\_\+engine}. This can be changed by passing in a different {\ttfamily \doxylink{classfunc_1_1StdRng}{Std\+Rng}}
\end{DoxyNote}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000011}{Todo}}]{\ttfamily \doxylink{classfunc_1_1LookupTableComparator}{Lookup\+Table\+Comparator}}\textquotesingle{}s constructor should accept any callable type \end{DoxyRefDesc}


\label{doc-constructors}
\Hypertarget{classfunc_1_1LookupTableComparator_doc-constructors}
\doxysubsubsection{Constructor \& Destructor Documentation}
\Hypertarget{classfunc_1_1LookupTableComparator_aed60450c2653d72ecc17ed3b3cc79a87}\index{LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}!LookupTableComparator@{LookupTableComparator}}
\index{LookupTableComparator@{LookupTableComparator}!LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}}
\doxyparagraph{\texorpdfstring{LookupTableComparator()}{LookupTableComparator()}}
{\footnotesize\ttfamily \label{classfunc_1_1LookupTableComparator_aed60450c2653d72ecc17ed3b3cc79a87} 
template$<$typename TIN, typename TOUT$>$ \\
\mbox{\hyperlink{classfunc_1_1LookupTableComparator}{Lookup\+Table\+Comparator}} (\begin{DoxyParamCaption}\item[{Impl\+Container$<$ TIN, TOUT $>$ \&}]{in\+Impl}{, }\item[{TIN}]{min\+Arg}{, }\item[{TIN}]{max\+Arg}{, }\item[{unsigned int}]{n\+Evals}{ = {\ttfamily 100000}, }\item[{unsigned int}]{seed}{ = {\ttfamily 2017}, }\item[{std\+::unique\+\_\+ptr$<$ \mbox{\hyperlink{classfunc_1_1RngInterface}{Rng\+Interface}}$<$ TIN $>$ $>$}]{in\+Rng}{ = {\ttfamily nullptr}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Prepare to run several timings for each LUT in the vector in\+Impl 

\label{doc-func-members}
\Hypertarget{classfunc_1_1LookupTableComparator_doc-func-members}
\doxysubsubsection{Member Function Documentation}
\Hypertarget{classfunc_1_1LookupTableComparator_a004071b7d33eb4503a8475586d5692f5}\index{LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}!compute\_statistics@{compute\_statistics}}
\index{compute\_statistics@{compute\_statistics}!LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}}
\doxyparagraph{\texorpdfstring{compute\_statistics()}{compute\_statistics()}}
{\footnotesize\ttfamily \label{classfunc_1_1LookupTableComparator_a004071b7d33eb4503a8475586d5692f5} 
template$<$typename TIN, typename TOUT = TIN$>$ \\
void compute\+\_\+statistics (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Compute fastest and slowest times \Hypertarget{classfunc_1_1LookupTableComparator_a63bb935a28e8b772e5bf13b39c942ac5}\index{LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}!print\_csv@{print\_csv}}
\index{print\_csv@{print\_csv}!LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}}
\doxyparagraph{\texorpdfstring{print\_csv()}{print\_csv()}}
{\footnotesize\ttfamily \label{classfunc_1_1LookupTableComparator_a63bb935a28e8b772e5bf13b39c942ac5} 
template$<$typename TIN, typename TOUT$>$ \\
void print\+\_\+csv (\begin{DoxyParamCaption}\item[{std\+::ostream \&}]{out}{, }\item[{Sorter}]{type}{ = {\ttfamily Sorter\+:\+:NONE}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Output a space separated listing of timing results. Does not print a final newline if type != Sorter\+::\+NONE which is helpful for plotting timing results with external programs (e.\+g. Python) \Hypertarget{classfunc_1_1LookupTableComparator_a181f9bb4a6ef8a9972084da26d33fd80}\index{LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}!print\_json@{print\_json}}
\index{print\_json@{print\_json}!LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}}
\doxyparagraph{\texorpdfstring{print\_json()}{print\_json()}}
{\footnotesize\ttfamily \label{classfunc_1_1LookupTableComparator_a181f9bb4a6ef8a9972084da26d33fd80} 
template$<$typename TIN, typename TOUT$>$ \\
void print\+\_\+json (\begin{DoxyParamCaption}\item[{std\+::ostream \&}]{out}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Print out the raw timings for each \doxylink{classfunc_1_1LookupTable}{Lookup\+Table} \Hypertarget{classfunc_1_1LookupTableComparator_ae4fed734fa2927c2a4e3ca1cae5a2626}\index{LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}!print\_summary@{print\_summary}}
\index{print\_summary@{print\_summary}!LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}}
\doxyparagraph{\texorpdfstring{print\_summary()}{print\_summary()}}
{\footnotesize\ttfamily \label{classfunc_1_1LookupTableComparator_ae4fed734fa2927c2a4e3ca1cae5a2626} 
template$<$typename TIN, typename TOUT$>$ \\
void print\+\_\+summary (\begin{DoxyParamCaption}\item[{std\+::ostream \&}]{out}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Print out the computed statistics for each \doxylink{classfunc_1_1LookupTable}{Lookup\+Table} (no raw timings are displayed) \Hypertarget{classfunc_1_1LookupTableComparator_a1cf984894de91e06811ebf079dd292c9}\index{LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}!run\_timings@{run\_timings}}
\index{run\_timings@{run\_timings}!LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}}
\doxyparagraph{\texorpdfstring{run\_timings()}{run\_timings()}}
{\footnotesize\ttfamily \label{classfunc_1_1LookupTableComparator_a1cf984894de91e06811ebf079dd292c9} 
template$<$typename TIN, typename TOUT = TIN$>$ \\
void run\+\_\+timings (\begin{DoxyParamCaption}\item[{int}]{n\+Runs}{ = {\ttfamily 1}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Run timings with different set of random arguments \Hypertarget{classfunc_1_1LookupTableComparator_acd40b60e087c3501ad9a8385d70c85f7}\index{LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}!sort\_timings@{sort\_timings}}
\index{sort\_timings@{sort\_timings}!LookupTableComparator$<$ TIN, TOUT $>$@{LookupTableComparator$<$ TIN, TOUT $>$}}
\doxyparagraph{\texorpdfstring{sort\_timings()}{sort\_timings()}}
{\footnotesize\ttfamily \label{classfunc_1_1LookupTableComparator_acd40b60e087c3501ad9a8385d70c85f7} 
template$<$typename TIN, typename TOUT$>$ \\
void sort\+\_\+timings (\begin{DoxyParamCaption}\item[{Sorter}]{type}{ = {\ttfamily Sorter\+:\+:MEAN}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Sort the vector of implementations (m\+\_\+impl\+Timers) based on their max Sorter\+::\+WORST, mean Sorter\+::\+MEAN, or min Sorter\+::\+BEST times 

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