\section{mlpack\+:\+:util Namespace Reference}
\label{namespacemlpack_1_1util}\index{mlpack\+::util@{mlpack\+::util}}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ Is\+Std\+Vector}
\begin{DoxyCompactList}\small\item\em Metaprogramming structure for vector detection. \end{DoxyCompactList}\item 
struct \textbf{ Is\+Std\+Vector$<$ std\+::vector$<$ T, A $>$ $>$}
\begin{DoxyCompactList}\small\item\em Metaprogramming structure for vector detection. \end{DoxyCompactList}\item 
class \textbf{ Null\+Out\+Stream}
\begin{DoxyCompactList}\small\item\em Used for \doxyref{Log\+::\+Debug}{p.}{classmlpack_1_1Log_afd147ffc8dcfdceaccad2fa1dde00e30} when not compiled with debugging symbols. \end{DoxyCompactList}\item 
struct \textbf{ Param\+Data}
\begin{DoxyCompactList}\small\item\em This structure holds all of the information about a single parameter, including its value (which is set when \doxyref{Parse\+Command\+Line()}{p.}{namespacemlpack_1_1bindings_1_1cli_a9f4d336f3d999569328497d0b8f37b35} is called). \end{DoxyCompactList}\item 
class \textbf{ Prefixed\+Out\+Stream}
\begin{DoxyCompactList}\small\item\em Allows us to output to an ostream with a prefix at the beginning of each line, in the same way we would output to cout or cerr. \end{DoxyCompactList}\item 
class \textbf{ Program\+Doc}
\begin{DoxyCompactList}\small\item\em A static object whose constructor registers program documentation with the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} class. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \textbf{ Disable\+Backtrace} ()
\begin{DoxyCompactList}\small\item\em Disable backtraces. \end{DoxyCompactList}\item 
void \textbf{ Disable\+Verbose} ()
\begin{DoxyCompactList}\small\item\em Turn verbose output off. \end{DoxyCompactList}\item 
void \textbf{ Enable\+Timers} ()
\begin{DoxyCompactList}\small\item\em Enable timing. \end{DoxyCompactList}\item 
void \textbf{ Enable\+Verbose} ()
\begin{DoxyCompactList}\small\item\em Turn verbose output on. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\T $\ast$ \textbf{ Get\+Param\+Ptr} (const std\+::string \&param\+Name)
\begin{DoxyCompactList}\small\item\em Return a pointer. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\T \& \textbf{ Get\+Param\+With\+Info} (const std\+::string \&param\+Name)
\begin{DoxyCompactList}\small\item\em Return the matrix part of a matrix + dataset info parameter. \end{DoxyCompactList}\item 
std\+::string \textbf{ Get\+Version} ()
\begin{DoxyCompactList}\small\item\em This will return either \char`\"{}mlpack x.\+y.\+z\char`\"{} or \char`\"{}mlpack master-\/\+X\+X\+X\+X\+X\+X\+X\char`\"{} depending on whether or not this is a stable version of mlpack or a git repository. \end{DoxyCompactList}\item 
std\+::string \textbf{ Hyphenate\+String} (const std\+::string \&str, int padding)
\begin{DoxyCompactList}\small\item\em  $\ast$ Hyphenate a string or split it onto multiple 80-\/character lines, with some  $\ast$ amount of padding on each line. \end{DoxyCompactList}\item 
void \textbf{ Report\+Ignored\+Param} (const std\+::vector$<$ std\+::pair$<$ std\+::string, bool $>$$>$ \&constraints, const std\+::string \&param\+Name)
\begin{DoxyCompactList}\small\item\em Report that a parameter is ignored, if each of the constraints given are satisfied. \end{DoxyCompactList}\item 
void \textbf{ Report\+Ignored\+Param} (const std\+::string \&param\+Name, const std\+::string \&reason)
\begin{DoxyCompactList}\small\item\em If the given parameter is passed, report that it is ignored, supplying a custom reason. \end{DoxyCompactList}\item 
void \textbf{ Require\+At\+Least\+One\+Passed} (const std\+::vector$<$ std\+::string $>$ \&constraints, const bool fatal=true, const std\+::string \&custom\+Error\+Message=\char`\"{}\char`\"{})
\begin{DoxyCompactList}\small\item\em Require that at least one of the given parameters in the constraints set was passed to the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} object; otherwise, issue a warning or fatal error, optionally with the given custom error message. \end{DoxyCompactList}\item 
void \textbf{ Require\+None\+Or\+All\+Passed} (const std\+::vector$<$ std\+::string $>$ \&constraints, const bool fatal=true, const std\+::string \&custom\+Error\+Message=\char`\"{}\char`\"{})
\begin{DoxyCompactList}\small\item\em Require that either none or all of the given parameters in the constraints set were passed to the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} object; otherwise, issue a warning or fatal error, optionally with the given custom error message. \end{DoxyCompactList}\item 
void \textbf{ Require\+Only\+One\+Passed} (const std\+::vector$<$ std\+::string $>$ \&constraints, const bool fatal=true, const std\+::string \&custom\+Error\+Message=\char`\"{}\char`\"{})
\begin{DoxyCompactList}\small\item\em Require that only one of the given parameters in the constraints set was passed to the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} object; otherwise, issue a warning or fatal error, optionally with the given custom error message. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\void \textbf{ Require\+Param\+In\+Set} (const std\+::string \&param\+Name, const std\+::vector$<$ T $>$ \&\textbf{ set}, const bool fatal, const std\+::string \&error\+Message)
\begin{DoxyCompactList}\small\item\em Require that a given parameter is in a set of allowable parameters. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\void \textbf{ Require\+Param\+Value} (const std\+::string \&param\+Name, const std\+::function$<$ bool(T)$>$ \&conditional, const bool fatal, const std\+::string \&error\+Message)
\begin{DoxyCompactList}\small\item\em Require that a given parameter satisfies the given conditional function. \end{DoxyCompactList}\item 
void \textbf{ Reset\+Timers} ()
\begin{DoxyCompactList}\small\item\em Reset the status of all timers. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\void \textbf{ Set\+Input\+Param} (const std\+::string \&name, T \&\&value)
\begin{DoxyCompactList}\small\item\em Utility function that is used in binding tests for setting a parameter and marking it as passed; it uses copy semantics for lvalues and move semantics for rvalues. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\void \textbf{ Set\+Param} (const std\+::string \&identifier, T \&value)
\begin{DoxyCompactList}\small\item\em Set the parameter to the given value. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\void \textbf{ Set\+Param\+Ptr} (const std\+::string \&identifier, T $\ast$value, const bool copy)
\begin{DoxyCompactList}\small\item\em Set the parameter to the given value, given that the type is a pointer. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\void \textbf{ Set\+Param\+With\+Info} (const std\+::string \&identifier, T \&matrix, const bool $\ast$dims)
\begin{DoxyCompactList}\small\item\em Set the parameter (which is a matrix/\+Dataset\+Info tuple) to the given value. \end{DoxyCompactList}\item 
void \textbf{ To\+Lower} (const std\+::string \&input, std\+::string \&output)
\begin{DoxyCompactList}\small\item\em  $\ast$ Convert a string to lowercase letters. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function Documentation}
\mbox{\label{namespacemlpack_1_1util_a52070f1b12b2aa30efb2ccb6cac9f458}} 
\index{mlpack\+::util@{mlpack\+::util}!Disable\+Backtrace@{Disable\+Backtrace}}
\index{Disable\+Backtrace@{Disable\+Backtrace}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Disable\+Backtrace()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Disable\+Backtrace (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Disable backtraces. 



Definition at line 144 of file cli\+\_\+util.\+hpp.



References Prefixed\+Out\+Stream\+::backtrace, and Log\+::\+Fatal.

\mbox{\label{namespacemlpack_1_1util_a8bbdbba329b801ac575c1808cc25c435}} 
\index{mlpack\+::util@{mlpack\+::util}!Disable\+Verbose@{Disable\+Verbose}}
\index{Disable\+Verbose@{Disable\+Verbose}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Disable\+Verbose()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Disable\+Verbose (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Turn verbose output off. 



Definition at line 136 of file cli\+\_\+util.\+hpp.



References Prefixed\+Out\+Stream\+::ignore\+Input, and Log\+::\+Info.

\mbox{\label{namespacemlpack_1_1util_ae2f6ca6ca9a54c24fd2203adfdc814c9}} 
\index{mlpack\+::util@{mlpack\+::util}!Enable\+Timers@{Enable\+Timers}}
\index{Enable\+Timers@{Enable\+Timers}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Enable\+Timers()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Enable\+Timers (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Enable timing. 



Definition at line 161 of file cli\+\_\+util.\+hpp.



References Timer\+::\+Enable\+Timing().

\mbox{\label{namespacemlpack_1_1util_a33d5bd42732e70873825875927c94aa1}} 
\index{mlpack\+::util@{mlpack\+::util}!Enable\+Verbose@{Enable\+Verbose}}
\index{Enable\+Verbose@{Enable\+Verbose}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Enable\+Verbose()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Enable\+Verbose (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Turn verbose output on. 



Definition at line 128 of file cli\+\_\+util.\+hpp.



References Prefixed\+Out\+Stream\+::ignore\+Input, and Log\+::\+Info.

\mbox{\label{namespacemlpack_1_1util_af9398225b0987296d297eb6ec5352f26}} 
\index{mlpack\+::util@{mlpack\+::util}!Get\+Param\+Ptr@{Get\+Param\+Ptr}}
\index{Get\+Param\+Ptr@{Get\+Param\+Ptr}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Get\+Param\+Ptr()}
{\footnotesize\ttfamily T$\ast$ mlpack\+::util\+::\+Get\+Param\+Ptr (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{param\+Name }\end{DoxyParamCaption})}



Return a pointer. 

This function exists to work around Cython\textquotesingle{}s seeming lack of support for template pointer types. 

Definition at line 109 of file cli\+\_\+util.\+hpp.

\mbox{\label{namespacemlpack_1_1util_a02467c0d501c83596e52a066ba498a85}} 
\index{mlpack\+::util@{mlpack\+::util}!Get\+Param\+With\+Info@{Get\+Param\+With\+Info}}
\index{Get\+Param\+With\+Info@{Get\+Param\+With\+Info}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Get\+Param\+With\+Info()}
{\footnotesize\ttfamily T\& mlpack\+::util\+::\+Get\+Param\+With\+Info (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{param\+Name }\end{DoxyParamCaption})}



Return the matrix part of a matrix + dataset info parameter. 



Definition at line 118 of file cli\+\_\+util.\+hpp.

\mbox{\label{namespacemlpack_1_1util_a5463728499ca94746d779a6863df5c20}} 
\index{mlpack\+::util@{mlpack\+::util}!Get\+Version@{Get\+Version}}
\index{Get\+Version@{Get\+Version}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Get\+Version()}
{\footnotesize\ttfamily std\+::string mlpack\+::util\+::\+Get\+Version (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



This will return either \char`\"{}mlpack x.\+y.\+z\char`\"{} or \char`\"{}mlpack master-\/\+X\+X\+X\+X\+X\+X\+X\char`\"{} depending on whether or not this is a stable version of mlpack or a git repository. 



Referenced by mlpack\+::bindings\+::cli\+::\+Parse\+Command\+Line().

\mbox{\label{namespacemlpack_1_1util_a0617e4b19f760fef6d14bbacd7545049}} 
\index{mlpack\+::util@{mlpack\+::util}!Hyphenate\+String@{Hyphenate\+String}}
\index{Hyphenate\+String@{Hyphenate\+String}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Hyphenate\+String()}
{\footnotesize\ttfamily std\+::string mlpack\+::util\+::\+Hyphenate\+String (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{str,  }\item[{int}]{padding }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



 $\ast$ Hyphenate a string or split it onto multiple 80-\/character lines, with some  $\ast$ amount of padding on each line. 

  This is used for option output.  $\ast$  $\ast$ 
\begin{DoxyParams}{Parameters}
{\em str} & String to hyphenate (splits are on \textquotesingle{} \textquotesingle{}).  $\ast$ \\
\hline
{\em padding} & Amount of padding on the left for each new line.   \\
\hline
\end{DoxyParams}


Definition at line 25 of file hyphenate\+\_\+string.\+hpp.



Referenced by mlpack\+::bindings\+::python\+::\+Print\+Doc().

\mbox{\label{namespacemlpack_1_1util_ab244b3b942d525edebe5d0e08b056bf1}} 
\index{mlpack\+::util@{mlpack\+::util}!Report\+Ignored\+Param@{Report\+Ignored\+Param}}
\index{Report\+Ignored\+Param@{Report\+Ignored\+Param}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Report\+Ignored\+Param()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Report\+Ignored\+Param (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::pair$<$ std\+::string, bool $>$$>$ \&}]{constraints,  }\item[{const std\+::string \&}]{param\+Name }\end{DoxyParamCaption})}



Report that a parameter is ignored, if each of the constraints given are satisfied. 

The constraints should be a set of string/bool pairs. If all of the constraints are true, and the given parameter in \textquotesingle{}param\+Name\textquotesingle{} is passed, then a warning will be issued noting that the parameter is ignored. The warning will go to \doxyref{Log\+::\+Warn}{p.}{classmlpack_1_1Log_af8dd463e0db2840410fe6b1165429d5b}.


\begin{DoxyParams}{Parameters}
{\em constraints} & Set of constraints. \\
\hline
{\em param\+Name} & Name of parameter to check. \\
\hline
\end{DoxyParams}
\mbox{\label{namespacemlpack_1_1util_a267aad01fc4c11f1a97cdb0710b89af4}} 
\index{mlpack\+::util@{mlpack\+::util}!Report\+Ignored\+Param@{Report\+Ignored\+Param}}
\index{Report\+Ignored\+Param@{Report\+Ignored\+Param}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Report\+Ignored\+Param()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Report\+Ignored\+Param (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{param\+Name,  }\item[{const std\+::string \&}]{reason }\end{DoxyParamCaption})}



If the given parameter is passed, report that it is ignored, supplying a custom reason. 

The reason should specify, in short and clear terms, why the parameter is ignored. So, for example, the output may be similar to\+:


\begin{DoxyCode}
--iterations (-i) ignored because <reason>.
\end{DoxyCode}


and in this case a good reason might be \char`\"{}\+S\+G\+D is not being used as an
optimizer\char`\"{}. Be sure that when you write the reason, the full message makes sense.


\begin{DoxyParams}{Parameters}
{\em param\+Name} & Name of parameter to check. \\
\hline
{\em reason} & Reason that parameter is ignored, if it is passed. \\
\hline
\end{DoxyParams}
\mbox{\label{namespacemlpack_1_1util_ae19bc258d5d2bc0f4c5ac52da8d2992e}} 
\index{mlpack\+::util@{mlpack\+::util}!Require\+At\+Least\+One\+Passed@{Require\+At\+Least\+One\+Passed}}
\index{Require\+At\+Least\+One\+Passed@{Require\+At\+Least\+One\+Passed}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Require\+At\+Least\+One\+Passed()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Require\+At\+Least\+One\+Passed (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{constraints,  }\item[{const bool}]{fatal = {\ttfamily true},  }\item[{const std\+::string \&}]{custom\+Error\+Message = {\ttfamily \char`\"{}\char`\"{}} }\end{DoxyParamCaption})}



Require that at least one of the given parameters in the constraints set was passed to the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} object; otherwise, issue a warning or fatal error, optionally with the given custom error message. 

This uses the correct binding type name for each parameter (i.\+e. \textquotesingle{}--parameter\textquotesingle{} for \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} bindings, \textquotesingle{}parameter\textquotesingle{} for Python bindings).

This can be used with a set of only one constraint and the output is still sensible.

If you use a custom error message, be aware that the given output will be similar to, for example\+:


\begin{DoxyCode}
Should pass one of \textcolor{stringliteral}{'--codes\_file (-c)'}, \textcolor{stringliteral}{'--dictionary\_file (-d)'}, or
\textcolor{stringliteral}{'--output\_model\_file (-M)'}; <custom error message>!
\end{DoxyCode}


so when you write your custom error message, be sure that the sentence makes sense. The custom error message should not have a capitalized first character and no ending punctuation (a \textquotesingle{}!\textquotesingle{} will be added by this function).


\begin{DoxyParams}{Parameters}
{\em constraints} & Set of parameters from which only one should be passed. \\
\hline
{\em fatal} & If true, output goes to \doxyref{Log\+::\+Fatal}{p.}{classmlpack_1_1Log_a5b72fcdfa48547883454fbc59be9caf1} instead of \doxyref{Log\+::\+Warn}{p.}{classmlpack_1_1Log_af8dd463e0db2840410fe6b1165429d5b} and an exception is thrown. \\
\hline
{\em custom\+Error\+Message} & Error message to append. \\
\hline
\end{DoxyParams}
\mbox{\label{namespacemlpack_1_1util_a37ad0ecd07b5b006bf8135c2880779dd}} 
\index{mlpack\+::util@{mlpack\+::util}!Require\+None\+Or\+All\+Passed@{Require\+None\+Or\+All\+Passed}}
\index{Require\+None\+Or\+All\+Passed@{Require\+None\+Or\+All\+Passed}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Require\+None\+Or\+All\+Passed()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Require\+None\+Or\+All\+Passed (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{constraints,  }\item[{const bool}]{fatal = {\ttfamily true},  }\item[{const std\+::string \&}]{custom\+Error\+Message = {\ttfamily \char`\"{}\char`\"{}} }\end{DoxyParamCaption})}



Require that either none or all of the given parameters in the constraints set were passed to the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} object; otherwise, issue a warning or fatal error, optionally with the given custom error message. 

This uses the correct binding type name for each parameter (i.\+e. \textquotesingle{}--parameter\textquotesingle{} for \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} bindings, \textquotesingle{}parameter\textquotesingle{} for Python bindings).

If you use a custom error message, be aware that the given output will be similar to, for example\+:


\begin{DoxyCode}
Must pass none or all of \textcolor{stringliteral}{'--codes\_file (-c)'}, \textcolor{stringliteral}{'--dictionary\_file (-d)'}, and
\textcolor{stringliteral}{'--output\_model\_file (-M)'}; <custom error message>!
\end{DoxyCode}


so when you write your custom error message, be sure that the sentence makes sense. The custom error message should not have a capitalized first character and no ending punctuation (a \textquotesingle{}!\textquotesingle{} will be added by this function).


\begin{DoxyParams}{Parameters}
{\em constraints} & Set of parameters of which none or all should be passed. \\
\hline
{\em fatal} & If true, output goes to \doxyref{Log\+::\+Fatal}{p.}{classmlpack_1_1Log_a5b72fcdfa48547883454fbc59be9caf1} instead of \doxyref{Log\+::\+Warn}{p.}{classmlpack_1_1Log_af8dd463e0db2840410fe6b1165429d5b} and an exception is thrown. \\
\hline
{\em custom\+Error\+Message} & Error message to append. \\
\hline
\end{DoxyParams}
\mbox{\label{namespacemlpack_1_1util_a048901a943435a95ced8c405730acf04}} 
\index{mlpack\+::util@{mlpack\+::util}!Require\+Only\+One\+Passed@{Require\+Only\+One\+Passed}}
\index{Require\+Only\+One\+Passed@{Require\+Only\+One\+Passed}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Require\+Only\+One\+Passed()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Require\+Only\+One\+Passed (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{constraints,  }\item[{const bool}]{fatal = {\ttfamily true},  }\item[{const std\+::string \&}]{custom\+Error\+Message = {\ttfamily \char`\"{}\char`\"{}} }\end{DoxyParamCaption})}



Require that only one of the given parameters in the constraints set was passed to the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} object; otherwise, issue a warning or fatal error, optionally with the given custom error message. 

This uses the correct binding type name for each parameter (i.\+e. \textquotesingle{}--parameter\textquotesingle{} for \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} bindings, \textquotesingle{}parameter\textquotesingle{} for Python bindings).

If you use a custom error message, be aware that the given output will be similar to, for example\+:


\begin{DoxyCode}
Must specify one of \textcolor{stringliteral}{'--reference\_file (-r)'} or \textcolor{stringliteral}{'--input\_model\_file (-m)'};
<custom error message here>!
\end{DoxyCode}


so when you write your custom error message, be sure that the sentence makes sense. The custom error message should not have a capitalized first character and no ending punctuation (a \textquotesingle{}!\textquotesingle{} will be added by this function).


\begin{DoxyParams}{Parameters}
{\em constraints} & Set of parameters from which only one should be passed. \\
\hline
{\em fatal} & If true, output goes to \doxyref{Log\+::\+Fatal}{p.}{classmlpack_1_1Log_a5b72fcdfa48547883454fbc59be9caf1} instead of \doxyref{Log\+::\+Warn}{p.}{classmlpack_1_1Log_af8dd463e0db2840410fe6b1165429d5b} and an exception is thrown. \\
\hline
{\em custom\+Error\+Message} & Error message to append. \\
\hline
\end{DoxyParams}
\mbox{\label{namespacemlpack_1_1util_a103bcfe2b3a7641fe3f3c59b2436bb63}} 
\index{mlpack\+::util@{mlpack\+::util}!Require\+Param\+In\+Set@{Require\+Param\+In\+Set}}
\index{Require\+Param\+In\+Set@{Require\+Param\+In\+Set}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Require\+Param\+In\+Set()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Require\+Param\+In\+Set (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{param\+Name,  }\item[{const std\+::vector$<$ T $>$ \&}]{set,  }\item[{const bool}]{fatal,  }\item[{const std\+::string \&}]{error\+Message }\end{DoxyParamCaption})}



Require that a given parameter is in a set of allowable parameters. 

This is probably most useful with T = std\+::string. If fatal is true, then an exception is thrown. An error message is not optional and must be specified. The error message does {\itshape not} need to specify the values in the set; this function will already output them. So, for example, the output may be similar to\+:


\begin{DoxyCode}
Invalid value of \textcolor{stringliteral}{'--weak\_learner (-w)'} specified (\textcolor{stringliteral}{'something'}); <error
message>; must be one of \textcolor{stringliteral}{'decision\_stump'}, or \textcolor{stringliteral}{'perceptron'}!
\end{DoxyCode}


so when you write the error message, make sure that the message makes sense. For example, in the message above, a good error message might be \char`\"{}unknown
weak learner type\char`\"{}.


\begin{DoxyTemplParams}{Template Parameters}
{\em T} & Type of parameter. \\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em param\+Name} & Name of parameter to check. \\
\hline
{\em set} & Set of valid values for parameter. \\
\hline
{\em fatal} & If true, an exception is thrown and output goes to \doxyref{Log\+::\+Fatal}{p.}{classmlpack_1_1Log_a5b72fcdfa48547883454fbc59be9caf1}. \\
\hline
{\em error\+Message} & Error message to output. \\
\hline
\end{DoxyParams}
\mbox{\label{namespacemlpack_1_1util_ae93b13d8041246b4d1d697d7f00155ca}} 
\index{mlpack\+::util@{mlpack\+::util}!Require\+Param\+Value@{Require\+Param\+Value}}
\index{Require\+Param\+Value@{Require\+Param\+Value}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Require\+Param\+Value()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Require\+Param\+Value (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{param\+Name,  }\item[{const std\+::function$<$ bool(T)$>$ \&}]{conditional,  }\item[{const bool}]{fatal,  }\item[{const std\+::string \&}]{error\+Message }\end{DoxyParamCaption})}



Require that a given parameter satisfies the given conditional function. 

This is useful for, e.\+g., checking that a given parameter is greater than 0. If fatal is true, then an exception is thrown. An error message is not optional and must be specified. The error message should specify, in clear terms, what the value of the parameter {\itshape should} be. So, for example, the output may be similar to\+:


\begin{DoxyCode}
Invalid value of \textcolor{stringliteral}{'--iterations (-i)'} specified (-1); <error message>!
\end{DoxyCode}


and in this case a good error message might be \char`\"{}number of iterations must be
positive\char`\"{}. Be sure that when you write the error message, the message makes sense.


\begin{DoxyTemplParams}{Template Parameters}
{\em T} & Type of parameter to check. \\
\hline
\end{DoxyTemplParams}

\begin{DoxyParams}{Parameters}
{\em param\+Name} & Name of parameter to check. \\
\hline
{\em conditional} & Function to use to check parameter value; should return \textquotesingle{}true\textquotesingle{} if the parameter value is okay. \\
\hline
{\em fatal} & If true, an exception is thrown and output goes to \doxyref{Log\+::\+Fatal}{p.}{classmlpack_1_1Log_a5b72fcdfa48547883454fbc59be9caf1}. \\
\hline
{\em error\+Message} & Error message to output. \\
\hline
\end{DoxyParams}
\mbox{\label{namespacemlpack_1_1util_ac0854a811503316b6820b80db389634e}} 
\index{mlpack\+::util@{mlpack\+::util}!Reset\+Timers@{Reset\+Timers}}
\index{Reset\+Timers@{Reset\+Timers}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Reset\+Timers()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Reset\+Timers (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Reset the status of all timers. 



Definition at line 152 of file cli\+\_\+util.\+hpp.



References C\+L\+I\+::\+Get\+Singleton(), Timers\+::\+Reset(), and C\+L\+I\+::timer.

\mbox{\label{namespacemlpack_1_1util_a997283ede9320ae143e5cf3314efe0a4}} 
\index{mlpack\+::util@{mlpack\+::util}!Set\+Input\+Param@{Set\+Input\+Param}}
\index{Set\+Input\+Param@{Set\+Input\+Param}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Set\+Input\+Param()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Set\+Input\+Param (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{name,  }\item[{T \&\&}]{value }\end{DoxyParamCaption})}



Utility function that is used in binding tests for setting a parameter and marking it as passed; it uses copy semantics for lvalues and move semantics for rvalues. 


\begin{DoxyParams}{Parameters}
{\em name} & Name of parameter to set. \\
\hline
{\em value} & Value to set parameter to. \\
\hline
\end{DoxyParams}


Definition at line 29 of file test\+\_\+helper.\+hpp.



References C\+L\+I\+::\+Set\+Passed().

\mbox{\label{namespacemlpack_1_1util_aa4b1fae43d9c3ad5ba3673134ee37923}} 
\index{mlpack\+::util@{mlpack\+::util}!Set\+Param@{Set\+Param}}
\index{Set\+Param@{Set\+Param}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Set\+Param()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Set\+Param (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{identifier,  }\item[{T \&}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Set the parameter to the given value. 

This function exists to work around Cython\textquotesingle{}s lack of support for lvalue references.


\begin{DoxyParams}{Parameters}
{\em identifier} & Name of parameter. \\
\hline
{\em value} & Value to set parameter to. \\
\hline
\end{DoxyParams}


Definition at line 32 of file cli\+\_\+util.\+hpp.

\mbox{\label{namespacemlpack_1_1util_a8049b2ec848ae98373bfdcb4c5a05554}} 
\index{mlpack\+::util@{mlpack\+::util}!Set\+Param\+Ptr@{Set\+Param\+Ptr}}
\index{Set\+Param\+Ptr@{Set\+Param\+Ptr}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Set\+Param\+Ptr()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Set\+Param\+Ptr (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{identifier,  }\item[{T $\ast$}]{value,  }\item[{const bool}]{copy }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Set the parameter to the given value, given that the type is a pointer. 

This function exists to work around both Cython\textquotesingle{}s lack of support for lvalue references and also its seeming lack of support for template pointer types.


\begin{DoxyParams}{Parameters}
{\em identifier} & Name of parameter. \\
\hline
{\em value} & Value to set parameter to. \\
\hline
{\em copy} & Whether or not the object should be copied. \\
\hline
\end{DoxyParams}


Definition at line 48 of file cli\+\_\+util.\+hpp.

\mbox{\label{namespacemlpack_1_1util_a9e27a239e91e2b00add573b22aa6c966}} 
\index{mlpack\+::util@{mlpack\+::util}!Set\+Param\+With\+Info@{Set\+Param\+With\+Info}}
\index{Set\+Param\+With\+Info@{Set\+Param\+With\+Info}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Set\+Param\+With\+Info()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Set\+Param\+With\+Info (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{identifier,  }\item[{T \&}]{matrix,  }\item[{const bool $\ast$}]{dims }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Set the parameter (which is a matrix/\+Dataset\+Info tuple) to the given value. 



Definition at line 59 of file cli\+\_\+util.\+hpp.



References mlpack\+::data\+::categorical, Dataset\+Mapper$<$ Policy\+Type, Input\+Type $>$\+::\+Map\+String(), and Dataset\+Mapper$<$ Policy\+Type, Input\+Type $>$\+::\+Type().

\mbox{\label{namespacemlpack_1_1util_a2ab5f4a1f50b7136d08d5343f2551551}} 
\index{mlpack\+::util@{mlpack\+::util}!To\+Lower@{To\+Lower}}
\index{To\+Lower@{To\+Lower}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{To\+Lower()}
{\footnotesize\ttfamily void mlpack\+::util\+::\+To\+Lower (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{input,  }\item[{std\+::string \&}]{output }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



 $\ast$ Convert a string to lowercase letters. 

 $\ast$  $\ast$ 
\begin{DoxyParams}{Parameters}
{\em input} & The string to convert. \\
\hline
{\em output} & The string to be converted.   \\
\hline
\end{DoxyParams}


Definition at line 24 of file to\+\_\+lower.\+hpp.

