\section{mlpack\+:\+:util Namespace Reference}
\label{namespacemlpack_1_1util}\index{mlpack\+::util@{mlpack\+::util}}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ Binding\+Details}
\begin{DoxyCompactList}\small\item\em This structure holds all of the information about bindings documentation. \end{DoxyCompactList}\item 
class \textbf{ Example}
\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{ Long\+Description}
\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\+Name}
\item 
class \textbf{ See\+Also}
\item 
class \textbf{ Short\+Description}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
std\+::string \textbf{ Camel\+Case} (std\+::string s, bool lower)
\begin{DoxyCompactList}\small\item\em Given an snake\+\_\+case like, e.\+g., \char`\"{}logistic\+\_\+regression\char`\"{}, return Camel\+Case(e.\+g. \end{DoxyCompactList}\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, const std\+::string \&prefix, const bool force=false)
\begin{DoxyCompactList}\small\item\em Hyphenate a string or split it onto multiple 80-\/character lines, with some amount of padding on each line. \end{DoxyCompactList}\item 
std\+::string \textbf{ Hyphenate\+String} (const std\+::string \&str, int padding)
\begin{DoxyCompactList}\small\item\em Hyphenate a string or split it onto multiple 80-\/character lines, with some 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{IO}{p.}{classmlpack_1_1IO} 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{IO}{p.}{classmlpack_1_1IO} 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{IO}{p.}{classmlpack_1_1IO} 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)
\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\+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 
std\+::string \textbf{ Strip\+Type} (std\+::string cpp\+Type)
\begin{DoxyCompactList}\small\item\em Given a C++ type name, turn it into something that has no special characters that can simply be printed. \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_a4b979c0f88a8672aa71202b6e237daa9}} 
\index{mlpack\+::util@{mlpack\+::util}!Camel\+Case@{Camel\+Case}}
\index{Camel\+Case@{Camel\+Case}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Camel\+Case()}
{\footnotesize\ttfamily std\+::string mlpack\+::util\+::\+Camel\+Case (\begin{DoxyParamCaption}\item[{std\+::string}]{s,  }\item[{bool}]{lower }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Given an snake\+\_\+case like, e.\+g., \char`\"{}logistic\+\_\+regression\char`\"{}, return Camel\+Case(e.\+g. 

\char`\"{}\+Logistic\+Regression\char`\"{}) that can be used in bindings.


\begin{DoxyParams}{Parameters}
{\em s} & input string. \\
\hline
{\em lower} & is of bool type. If lower is true then output must be lower\+Camel\+Case else Upper\+Camel\+Case. \\
\hline
\end{DoxyParams}


Definition at line 26 of file camel\+\_\+case.\+hpp.



Referenced by mlpack\+::bindings\+::go\+::\+Print\+Defn\+Input(), mlpack\+::bindings\+::go\+::\+Print\+Doc(), mlpack\+::bindings\+::go\+::\+Print\+Input\+Processing(), mlpack\+::bindings\+::go\+::\+Print\+Method\+Config(), mlpack\+::bindings\+::go\+::\+Print\+Method\+Init(), and mlpack\+::bindings\+::go\+::\+Print\+Output\+Processing().

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



Disable backtraces. 



Definition at line 76 of file io\+\_\+util.\+hpp.



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



Referenced by Get\+Param\+With\+Info().

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



Turn verbose output off. 



Definition at line 68 of file io\+\_\+util.\+hpp.



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



Referenced by Get\+Param\+With\+Info().

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



Enable timing. 



Definition at line 93 of file io\+\_\+util.\+hpp.



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



Referenced by Get\+Param\+With\+Info().

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



Turn verbose output on. 



Definition at line 60 of file io\+\_\+util.\+hpp.



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



Referenced by Get\+Param\+With\+Info().

\mbox{\label{namespacemlpack_1_1util_acd9a3115e22684d3b768a78920c57adb}} 
\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$ 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 52 of file io\+\_\+util.\+hpp.



Referenced by Set\+Param\+With\+Info().

\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 io\+\_\+util.\+hpp.



References Prefixed\+Out\+Stream\+::backtrace, Disable\+Backtrace(), Disable\+Verbose(), Enable\+Timers(), Timer\+::\+Enable\+Timing(), Enable\+Verbose(), Log\+::\+Fatal, I\+O\+::\+Get\+Singleton(), Prefixed\+Out\+Stream\+::ignore\+Input, Log\+::\+Info, Timers\+::\+Reset(), Reset\+Timers(), and I\+O\+::timer.

\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_a7b8929840f4891a96df1108873e1a1f9}} 
\index{mlpack\+::util@{mlpack\+::util}!Hyphenate\+String@{Hyphenate\+String}}
\index{Hyphenate\+String@{Hyphenate\+String}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Hyphenate\+String()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily std\+::string mlpack\+::util\+::\+Hyphenate\+String (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{str,  }\item[{const std\+::string \&}]{prefix,  }\item[{const bool}]{force = {\ttfamily false} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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

This is used for option output.


\begin{DoxyParams}{Parameters}
{\em str} & String to hyphenate (splits are on \textquotesingle{} \textquotesingle{}). \\
\hline
{\em prefix} & Prefix to hyphenate a string with. \\
\hline
{\em force} & Hyphenate the string even if the length is less then 80. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em std\+::invalid\+\_\+argument} & if prefix.\+size() $>$= 80. \\
\hline
\end{DoxyExceptions}


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



Referenced by Hyphenate\+String(), mlpack\+::bindings\+::python\+::\+Print\+Doc(), mlpack\+::bindings\+::r\+::\+Print\+Doc(), and mlpack\+::bindings\+::go\+::\+Print\+Doc().

\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()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\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]}}



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

This is used for option output.


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


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



References Hyphenate\+String().

\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{IO}{p.}{classmlpack_1_1IO} 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 C\+LI 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{IO}{p.}{classmlpack_1_1IO} 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 C\+LI 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{IO}{p.}{classmlpack_1_1IO} 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 C\+LI 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_aa51cc50fad843f33d826c5bd80711ccf}} 
\index{mlpack\+::util@{mlpack\+::util}!Reset\+Timers@{Reset\+Timers}}
\index{Reset\+Timers@{Reset\+Timers}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Reset\+Timers()}
{\footnotesize\ttfamily void Reset\+Timers (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Reset the status of all timers. 



Definition at line 84 of file io\+\_\+util.\+hpp.



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



Referenced by Get\+Param\+With\+Info().

\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 I\+O\+::\+Set\+Passed().

\mbox{\label{namespacemlpack_1_1util_a1cbcba9e3ae417f6482ff0dd78094289}} 
\index{mlpack\+::util@{mlpack\+::util}!Set\+Param@{Set\+Param}}
\index{Set\+Param@{Set\+Param}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Set\+Param()}
{\footnotesize\ttfamily void 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. 


\begin{DoxyParams}{Parameters}
{\em identifier} & Name of parameter. \\
\hline
{\em value} & Value to set parameter to.\\
\hline
\end{DoxyParams}
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 29 of file io\+\_\+util.\+hpp.

\mbox{\label{namespacemlpack_1_1util_aedb2977a40b16aca2abcef35412b235f}} 
\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()\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void mlpack\+::util\+::\+Set\+Param\+Ptr (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{identifier,  }\item[{T $\ast$}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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


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


Definition at line 41 of file io\+\_\+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()\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\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 io\+\_\+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 io\+\_\+util.\+hpp.



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

\mbox{\label{namespacemlpack_1_1util_a7eb84b8e75a14594bd8b89733112378d}} 
\index{mlpack\+::util@{mlpack\+::util}!Strip\+Type@{Strip\+Type}}
\index{Strip\+Type@{Strip\+Type}!mlpack\+::util@{mlpack\+::util}}
\subsubsection{Strip\+Type()}
{\footnotesize\ttfamily std\+::string mlpack\+::util\+::\+Strip\+Type (\begin{DoxyParamCaption}\item[{std\+::string}]{cpp\+Type }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Given a C++ type name, turn it into something that has no special characters that can simply be printed. 

This is similar to but not identical to \doxyref{mlpack\+::util\+::\+Strip\+Type()}{p.}{namespacemlpack_1_1util_a7eb84b8e75a14594bd8b89733112378d}.


\begin{DoxyParams}{Parameters}
{\em cpp\+Type} & C++ type as a string. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Stripped type with no special characters. 
\end{DoxyReturn}


Definition at line 27 of file strip\+\_\+type.\+hpp.



Referenced by mlpack\+::bindings\+::julia\+::\+Get\+Julia\+Type(), mlpack\+::bindings\+::r\+::\+Get\+R\+Type(), mlpack\+::bindings\+::r\+::\+Print\+Input\+Processing(), mlpack\+::bindings\+::julia\+::\+Print\+Model\+Type\+Import(), mlpack\+::bindings\+::julia\+::\+Print\+Param\+Defn(), and mlpack\+::bindings\+::r\+::\+Print\+Serialize\+Util().

\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.

