\section{C\+LI Class Reference}
\label{classmlpack_1_1CLI}\index{C\+LI@{C\+LI}}


Parses the command line for parameters and holds user-\/specified parameters.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef std\+::map$<$ std\+::string, std\+::map$<$ std\+::string, void($\ast$)(const \textbf{ util\+::\+Param\+Data} \&, const void $\ast$, void $\ast$)$>$ $>$ \textbf{ Function\+Map\+Type}
\begin{DoxyCompactList}\small\item\em Map for functions and types. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \textbf{ Add} (\textbf{ util\+::\+Param\+Data} \&\&d)
\begin{DoxyCompactList}\small\item\em Adds a parameter to the hierarchy; use the P\+A\+R\+A\+M\+\_\+$\ast$() macros instead of this (i.\+e. \end{DoxyCompactList}\item 
static std\+::map$<$ char, std\+::string $>$ \& \textbf{ Aliases} ()
\begin{DoxyCompactList}\small\item\em Return a modifiable list of aliases that \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} knows about. \end{DoxyCompactList}\item 
static void \textbf{ Clear\+Settings} ()
\begin{DoxyCompactList}\small\item\em Clear all of the settings, removing all parameters and function mappings. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\static T \& \textbf{ Get\+Param} (const std\+::string \&identifier)
\begin{DoxyCompactList}\small\item\em Get the value of type T found while parsing. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\static std\+::string \textbf{ Get\+Printable\+Param} (const std\+::string \&identifier)
\begin{DoxyCompactList}\small\item\em Cast the given parameter of the given type to a short, printable std\+::string, for use in status messages. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename T $>$ }\\static T \& \textbf{ Get\+Raw\+Param} (const std\+::string \&identifier)
\begin{DoxyCompactList}\small\item\em Get the raw value of the parameter before any processing that \doxyref{Get\+Param()}{p.}{classmlpack_1_1CLI_a6c641e7bd5291c24b787f379f25cb9b8} might normally do. \end{DoxyCompactList}\item 
static \textbf{ C\+LI} \& \textbf{ Get\+Singleton} ()
\begin{DoxyCompactList}\small\item\em Retrieve the singleton. \end{DoxyCompactList}\item 
static bool \textbf{ Has\+Param} (const std\+::string \&identifier)
\begin{DoxyCompactList}\small\item\em See if the specified flag was found while parsing. \end{DoxyCompactList}\item 
static std\+::map$<$ std\+::string, \textbf{ util\+::\+Param\+Data} $>$ \& \textbf{ Parameters} ()
\begin{DoxyCompactList}\small\item\em Return a modifiable list of parameters that \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} knows about. \end{DoxyCompactList}\item 
static std\+::string \textbf{ Program\+Name} ()
\begin{DoxyCompactList}\small\item\em Get the program name as set by the \doxyref{P\+R\+O\+G\+R\+A\+M\+\_\+\+I\+N\+F\+O()}{p.}{param_8hpp_a855115a809785b9d23c6fad3d3d75a86} macro. \end{DoxyCompactList}\item 
static void \textbf{ Register\+Program\+Doc} (\textbf{ util\+::\+Program\+Doc} $\ast$\textbf{ doc})
\begin{DoxyCompactList}\small\item\em Registers a Program\+Doc object, which contains documentation about the program. \end{DoxyCompactList}\item 
static void \textbf{ Restore\+Settings} (const std\+::string \&name, const bool fatal=true)
\begin{DoxyCompactList}\small\item\em Restore all of the parameters and function mappings of the given name, if they exist. \end{DoxyCompactList}\item 
static void \textbf{ Set\+Passed} (const std\+::string \&name)
\begin{DoxyCompactList}\small\item\em Mark a particular parameter as passed. \end{DoxyCompactList}\item 
static void \textbf{ Store\+Settings} (const std\+::string \&name)
\begin{DoxyCompactList}\small\item\em Take all parameters and function mappings and store them, under the given name. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
bool \textbf{ did\+Parse}
\begin{DoxyCompactList}\small\item\em True, if \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} was used to parse command line options. \end{DoxyCompactList}\item 
\textbf{ util\+::\+Program\+Doc} $\ast$ \textbf{ doc}
\begin{DoxyCompactList}\small\item\em Pointer to the Program\+Doc object. \end{DoxyCompactList}\item 
\textbf{ Function\+Map\+Type} \textbf{ function\+Map}
\item 
std\+::string \textbf{ program\+Name}
\begin{DoxyCompactList}\small\item\em Holds the name of the program for --version. \end{DoxyCompactList}\item 
\textbf{ Timers} \textbf{ timer}
\begin{DoxyCompactList}\small\item\em Holds the timer objects. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Parses the command line for parameters and holds user-\/specified parameters. 

The \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} class is a subsystem by which parameters for machine learning methods can be specified and accessed. In conjunction with the macros P\+A\+R\+A\+M\+\_\+\+D\+O\+U\+B\+LE, P\+A\+R\+A\+M\+\_\+\+I\+NT, P\+A\+R\+A\+M\+\_\+\+S\+T\+R\+I\+NG, P\+A\+R\+A\+M\+\_\+\+F\+L\+AG, and others, this class aims to make user configurability of mlpack methods very easy. There are only three methods in \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} that a user should need\+: \doxyref{C\+L\+I\+::\+Parse\+Command\+Line()}{p.}{namespacemlpack_1_1bindings_1_1cli_a9f4d336f3d999569328497d0b8f37b35}, \doxyref{C\+L\+I\+::\+Get\+Param()}{p.}{classmlpack_1_1CLI_a6c641e7bd5291c24b787f379f25cb9b8}, and \doxyref{C\+L\+I\+::\+Has\+Param()}{p.}{classmlpack_1_1CLI_a39eda1093ba2453f2b66d37153ac542c} (in addition to the P\+A\+R\+A\+M\+\_\+$\ast$() macros).\subsection{Adding parameters to a program}\label{classmlpack_1_1CLI_addparam}

\begin{DoxyCode}
$ ./executable --bar=5
\end{DoxyCode}


\begin{DoxyNote}{Note}
The = is optional; a space can also be used.
\end{DoxyNote}
A parameter is specified by using one of the following macros (this is not a complete list; see core/io/cli.\+hpp)\+:


\begin{DoxyItemize}
\item \doxyref{P\+A\+R\+A\+M\+\_\+\+F\+L\+A\+G(\+I\+D, D\+E\+S\+C, A\+L\+I\+A\+S)}{p.}{param_8hpp_a59a38dfe16c56a278bd89817216a3739}
\item P\+A\+R\+A\+M\+\_\+\+D\+O\+U\+B\+L\+E(\+I\+D, D\+E\+S\+C, A\+L\+I\+A\+S, D\+E\+F)
\item P\+A\+R\+A\+M\+\_\+\+I\+N\+T(\+I\+D, D\+E\+S\+C, A\+L\+I\+A\+S, D\+E\+F)
\item P\+A\+R\+A\+M\+\_\+\+S\+T\+R\+I\+N\+G(\+I\+D, D\+E\+S\+C, A\+L\+I\+A\+S, D\+E\+F)
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em ID} & Name of the parameter. \\
\hline
{\em D\+E\+SC} & Short description of the parameter (one/two sentences). \\
\hline
{\em A\+L\+I\+AS} & An alias for the parameter. \\
\hline
{\em D\+EF} & Default value of the parameter.\\
\hline
\end{DoxyParams}
The flag (boolean) type automatically defaults to false; it is specified merely as a flag on the command line (no \textquotesingle{}=true\textquotesingle{} is required).

Here is an example of a few parameters being defined; this is for the K\+NN executable (methods/neighbor\+\_\+search/knn\+\_\+main.\+cpp)\+:


\begin{DoxyCode}
PARAM\_STRING\_REQ(\textcolor{stringliteral}{"reference\_file"}, \textcolor{stringliteral}{"File containing the reference dataset."},
    \textcolor{stringliteral}{"r"});
PARAM\_STRING\_REQ(\textcolor{stringliteral}{"distances\_file"}, \textcolor{stringliteral}{"File to output distances into."}, \textcolor{stringliteral}{"d"});
PARAM\_STRING\_REQ(\textcolor{stringliteral}{"neighbors\_file"}, \textcolor{stringliteral}{"File to output neighbors into."}, \textcolor{stringliteral}{"n"});
PARAM\_INT\_REQ(\textcolor{stringliteral}{"k"}, \textcolor{stringliteral}{"Number of furthest neighbors to find."}, \textcolor{stringliteral}{"k"});
PARAM\_STRING(\textcolor{stringliteral}{"query\_file"}, \textcolor{stringliteral}{"File containing query points (optional)."}, \textcolor{stringliteral}{"q"},
    \textcolor{stringliteral}{""});
PARAM\_INT(\textcolor{stringliteral}{"leaf\_size"}, \textcolor{stringliteral}{"Leaf size for tree building."}, \textcolor{stringliteral}{"l"}, 20);
PARAM_FLAG(\textcolor{stringliteral}{"naive"}, \textcolor{stringliteral}{"If true, O(n^2) naive mode is used for computation."},
    \textcolor{stringliteral}{"N"});
PARAM_FLAG(\textcolor{stringliteral}{"single\_mode"}, \textcolor{stringliteral}{"If true, single-tree search is used (as opposed "}
    \textcolor{stringliteral}{"to dual-tree search."}, \textcolor{stringliteral}{"s"});
\end{DoxyCode}


More documentation is available on the P\+A\+R\+A\+M\+\_\+$\ast$() macros in the documentation for core/io/cli.\+hpp.\subsection{Documenting the program itself}\label{classmlpack_1_1CLI_programinfo}
In addition to allowing documentation for each individual parameter and module, the \doxyref{P\+R\+O\+G\+R\+A\+M\+\_\+\+I\+N\+F\+O()}{p.}{param_8hpp_a855115a809785b9d23c6fad3d3d75a86} macro provides support for documenting the program itself. There should only be one instance of the \doxyref{P\+R\+O\+G\+R\+A\+M\+\_\+\+I\+N\+F\+O()}{p.}{param_8hpp_a855115a809785b9d23c6fad3d3d75a86} macro. Below is an example\+:


\begin{DoxyCode}
PROGRAM_INFO(\textcolor{stringliteral}{"Maximum Variance Unfolding"}, \textcolor{stringliteral}{"This program performs maximum "}
   \textcolor{stringliteral}{"variance unfolding on the given dataset, writing a lower-dimensional "}
   \textcolor{stringliteral}{"unfolded dataset to the given output file."});
\end{DoxyCode}


This description should be verbose, and explain to a non-\/expert user what the program does and how to use it. If relevant, paper citations should be included.\subsection{Parsing the command line with C\+LI}\label{classmlpack_1_1CLI_parsecli}
To have \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} parse the command line at the beginning of code execution, only a call to \doxyref{Parse\+Command\+Line()}{p.}{namespacemlpack_1_1bindings_1_1cli_a9f4d336f3d999569328497d0b8f37b35} is necessary\+:


\begin{DoxyCode}
\textcolor{keywordtype}{int} main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char}** argv)
\{
  CLI::ParseCommandLine(argc, argv);

  ...
\}
\end{DoxyCode}


\doxyref{C\+LI}{p.}{classmlpack_1_1CLI} provides --help and --info options which give nicely formatted documentation of each option; the documentation is generated from the D\+E\+SC arguments in the P\+A\+R\+A\+M\+\_\+$\ast$() macros.\subsection{Getting parameters with C\+LI}\label{classmlpack_1_1CLI_getparam}
When the parameters have been defined, the next important thing is how to access them. For this, the \doxyref{Has\+Param()}{p.}{classmlpack_1_1CLI_a39eda1093ba2453f2b66d37153ac542c} and \doxyref{Get\+Param()}{p.}{classmlpack_1_1CLI_a6c641e7bd5291c24b787f379f25cb9b8} methods are used. For instance, to see if the user passed the flag (boolean) \char`\"{}naive\char`\"{}\+:


\begin{DoxyCode}
\textcolor{keywordflow}{if} (CLI::HasParam(\textcolor{stringliteral}{"naive"}))
\{
  Log::Info << \textcolor{stringliteral}{"Naive has been passed!"} << std::endl;
\}
\end{DoxyCode}


To get the value of a parameter, such as a string, use Get\+Param\+:


\begin{DoxyCode}
\textcolor{keyword}{const} std::string filename = CLI::GetParam<std::string>(\textcolor{stringliteral}{"filename"});
\end{DoxyCode}


\begin{DoxyNote}{Note}
Options should only be defined in files which define {\ttfamily main()} (that is, main executables). If options are defined elsewhere, they may be spuriously included into other executables and confuse users. Similarly, if your executable has options which you did not define, it is probably because the option is defined somewhere else and included in your executable.
\end{DoxyNote}
\begin{DoxyRefDesc}{Bug}
\item[\textbf{ Bug}]The {\bfseries C\+O\+U\+N\+T\+ER} variable is used in most cases to guarantee a unique global identifier for options declared using the P\+A\+R\+A\+M\+\_\+$\ast$() macros. However, not all compilers have this support--most notably, gcc $<$ 4.\+3. In that case, the {\bfseries L\+I\+NE} macro is used as an attempt to get a unique global identifier, but collisions are still possible, and they produce bizarre error messages. See {\tt https\+://github.\+com/mlpack/mlpack/issues/100} for more information. \end{DoxyRefDesc}


Definition at line 166 of file cli.\+hpp.



\subsection{Member Typedef Documentation}
\mbox{\label{classmlpack_1_1CLI_ab99b98d8b4eb843c0700f9549aa783eb}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Function\+Map\+Type@{Function\+Map\+Type}}
\index{Function\+Map\+Type@{Function\+Map\+Type}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Function\+Map\+Type}
{\footnotesize\ttfamily typedef std\+::map$<$std\+::string, std\+::map$<$std\+::string, void ($\ast$)(const \textbf{ util\+::\+Param\+Data}\&, const void$\ast$, void$\ast$)$>$ $>$ \textbf{ Function\+Map\+Type}}



Map for functions and types. 

Use as function\+Map[\char`\"{}typename\char`\"{}][\char`\"{}function\+Name\char`\"{}]. 

Definition at line 289 of file cli.\+hpp.



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1CLI_adc908d81414046d89563fd0571d55cac}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Add@{Add}}
\index{Add@{Add}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Add()}
{\footnotesize\ttfamily static void Add (\begin{DoxyParamCaption}\item[{\textbf{ util\+::\+Param\+Data} \&\&}]{d }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Adds a parameter to the hierarchy; use the P\+A\+R\+A\+M\+\_\+$\ast$() macros instead of this (i.\+e. 

P\+A\+R\+A\+M\+\_\+\+I\+N\+T()).


\begin{DoxyParams}{Parameters}
{\em d} & Utility structure holding parameter data. \\
\hline
\end{DoxyParams}


Referenced by C\+L\+I\+Option$<$ N $>$\+::\+C\+L\+I\+Option(), Julia\+Option$<$ T $>$\+::\+Julia\+Option(), M\+D\+Option$<$ T $>$\+::\+M\+D\+Option(), Py\+Option$<$ T $>$\+::\+Py\+Option(), and Test\+Option$<$ N $>$\+::\+Test\+Option().

\mbox{\label{classmlpack_1_1CLI_a5be18c0eeb63369cb449da84dc3ea7ed}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Aliases@{Aliases}}
\index{Aliases@{Aliases}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Aliases()}
{\footnotesize\ttfamily static std\+::map$<$char, std\+::string$>$\& Aliases (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Return a modifiable list of aliases that \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} knows about. 

\mbox{\label{classmlpack_1_1CLI_a311c68c417bf994e4bf952dcce4a874d}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Clear\+Settings@{Clear\+Settings}}
\index{Clear\+Settings@{Clear\+Settings}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Clear\+Settings()}
{\footnotesize\ttfamily static void Clear\+Settings (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Clear all of the settings, removing all parameters and function mappings. 



Referenced by Julia\+Option$<$ T $>$\+::\+Julia\+Option(), M\+D\+Option$<$ T $>$\+::\+M\+D\+Option(), Py\+Option$<$ T $>$\+::\+Py\+Option(), and Test\+Option$<$ N $>$\+::\+Test\+Option().

\mbox{\label{classmlpack_1_1CLI_a6c641e7bd5291c24b787f379f25cb9b8}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Get\+Param@{Get\+Param}}
\index{Get\+Param@{Get\+Param}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Get\+Param()}
{\footnotesize\ttfamily static T\& Get\+Param (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{identifier }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Get the value of type T found while parsing. 

You can set the value using this reference safely.


\begin{DoxyParams}{Parameters}
{\em identifier} & The name of the parameter in question. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1CLI_a9273a321ef422a2aa57ee98f5b169632}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Get\+Printable\+Param@{Get\+Printable\+Param}}
\index{Get\+Printable\+Param@{Get\+Printable\+Param}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Get\+Printable\+Param()}
{\footnotesize\ttfamily static std\+::string Get\+Printable\+Param (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{identifier }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Cast the given parameter of the given type to a short, printable std\+::string, for use in status messages. 

Ideally the message returned here should be only a handful of characters, and certainly no longer than one line.


\begin{DoxyParams}{Parameters}
{\em identifier} & The name of the parameter in question. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1CLI_aa3080f329734511912ebe72f9ed30656}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Get\+Raw\+Param@{Get\+Raw\+Param}}
\index{Get\+Raw\+Param@{Get\+Raw\+Param}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Get\+Raw\+Param()}
{\footnotesize\ttfamily static T\& Get\+Raw\+Param (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{identifier }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Get the raw value of the parameter before any processing that \doxyref{Get\+Param()}{p.}{classmlpack_1_1CLI_a6c641e7bd5291c24b787f379f25cb9b8} might normally do. 

So, e.\+g., for command-\/line programs, this does not perform any data loading or manipulation like \doxyref{Get\+Param()}{p.}{classmlpack_1_1CLI_a6c641e7bd5291c24b787f379f25cb9b8} does. So if you want to access a matrix or model (or similar) parameter before it is loaded, this is the method to use.


\begin{DoxyParams}{Parameters}
{\em identifier} & The name of the parameter in question. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1CLI_a8f1fcf924718aa265d57b8ef9403d574}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Get\+Singleton@{Get\+Singleton}}
\index{Get\+Singleton@{Get\+Singleton}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Get\+Singleton()}
{\footnotesize\ttfamily static \textbf{ C\+LI}\& Get\+Singleton (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Retrieve the singleton. 

As an end user, if you are just using the \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} object, you should not need to use this function---the other static functions should be sufficient.

In this case, the singleton is used to store data for the static methods, as there is no point in defining static methods only to have users call private instance methods.

\begin{DoxyReturn}{Returns}
The singleton instance for use in the static methods. 
\end{DoxyReturn}


Referenced by C\+L\+I\+Option$<$ N $>$\+::\+C\+L\+I\+Option(), mlpack\+::bindings\+::cli\+::\+End\+Program(), Julia\+Option$<$ T $>$\+::\+Julia\+Option(), M\+D\+Option$<$ T $>$\+::\+M\+D\+Option(), mlpack\+::bindings\+::cli\+::\+Parse\+Command\+Line(), Py\+Option$<$ T $>$\+::\+Py\+Option(), mlpack\+::util\+::\+Reset\+Timers(), and Test\+Option$<$ N $>$\+::\+Test\+Option().

\mbox{\label{classmlpack_1_1CLI_a39eda1093ba2453f2b66d37153ac542c}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Has\+Param@{Has\+Param}}
\index{Has\+Param@{Has\+Param}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Has\+Param()}
{\footnotesize\ttfamily static bool Has\+Param (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{identifier }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



See if the specified flag was found while parsing. 


\begin{DoxyParams}{Parameters}
{\em identifier} & The name of the parameter in question. \\
\hline
\end{DoxyParams}


Referenced by mlpack\+::bindings\+::cli\+::\+End\+Program(), and mlpack\+::bindings\+::cli\+::\+Parse\+Command\+Line().

\mbox{\label{classmlpack_1_1CLI_a3eee2232cb321a8295fa908ba12868ad}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Parameters@{Parameters}}
\index{Parameters@{Parameters}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Parameters()}
{\footnotesize\ttfamily static std\+::map$<$std\+::string, \textbf{ util\+::\+Param\+Data}$>$\& Parameters (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Return a modifiable list of parameters that \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} knows about. 



Referenced by C\+L\+I\+Option$<$ N $>$\+::\+C\+L\+I\+Option(), mlpack\+::bindings\+::cli\+::\+End\+Program(), mlpack\+::bindings\+::cli\+::\+Parse\+Command\+Line(), and mlpack\+::bindings\+::python\+::\+Print\+Output\+Processing().

\mbox{\label{classmlpack_1_1CLI_a1025ff079f4aa3baecf036ab0bc32be5}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Program\+Name@{Program\+Name}}
\index{Program\+Name@{Program\+Name}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Program\+Name()}
{\footnotesize\ttfamily static std\+::string Program\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Get the program name as set by the \doxyref{P\+R\+O\+G\+R\+A\+M\+\_\+\+I\+N\+F\+O()}{p.}{param_8hpp_a855115a809785b9d23c6fad3d3d75a86} macro. 



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

\mbox{\label{classmlpack_1_1CLI_a05263684b20fc88c9695a4cc428f3aa4}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Register\+Program\+Doc@{Register\+Program\+Doc}}
\index{Register\+Program\+Doc@{Register\+Program\+Doc}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Register\+Program\+Doc()}
{\footnotesize\ttfamily static void Register\+Program\+Doc (\begin{DoxyParamCaption}\item[{\textbf{ util\+::\+Program\+Doc} $\ast$}]{doc }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Registers a Program\+Doc object, which contains documentation about the program. 

If this method has been called before (that is, if two Program\+Docs are instantiated in the program), a fatal error will occur.


\begin{DoxyParams}{Parameters}
{\em doc} & Pointer to the Program\+Doc object. \\
\hline
\end{DoxyParams}
\mbox{\label{classmlpack_1_1CLI_a6de90cea213fa99eaa5d5f354fabfaa0}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Restore\+Settings@{Restore\+Settings}}
\index{Restore\+Settings@{Restore\+Settings}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Restore\+Settings()}
{\footnotesize\ttfamily static void Restore\+Settings (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{name,  }\item[{const bool}]{fatal = {\ttfamily true} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Restore all of the parameters and function mappings of the given name, if they exist. 

A std\+::invalid\+\_\+argument exception will be thrown if fatal is true and no settings with the given name have been stored (with \doxyref{Store\+Settings()}{p.}{classmlpack_1_1CLI_ad30747ed34d1dcf57dad194ff8d09138}).


\begin{DoxyParams}{Parameters}
{\em name} & Name of settings to restore. \\
\hline
{\em fatal} & Whether to throw an exception on an unknown name. \\
\hline
\end{DoxyParams}


Referenced by Julia\+Option$<$ T $>$\+::\+Julia\+Option(), M\+D\+Option$<$ T $>$\+::\+M\+D\+Option(), Py\+Option$<$ T $>$\+::\+Py\+Option(), and Test\+Option$<$ N $>$\+::\+Test\+Option().

\mbox{\label{classmlpack_1_1CLI_a12aa08b1280e9b33864a9845706e0e59}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Set\+Passed@{Set\+Passed}}
\index{Set\+Passed@{Set\+Passed}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Set\+Passed()}
{\footnotesize\ttfamily static void Set\+Passed (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Mark a particular parameter as passed. 


\begin{DoxyParams}{Parameters}
{\em name} & Name of the parameter. \\
\hline
\end{DoxyParams}


Referenced by mlpack\+::util\+::\+Set\+Input\+Param(), and Test\+Option$<$ N $>$\+::\+Test\+Option().

\mbox{\label{classmlpack_1_1CLI_ad30747ed34d1dcf57dad194ff8d09138}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!Store\+Settings@{Store\+Settings}}
\index{Store\+Settings@{Store\+Settings}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{Store\+Settings()}
{\footnotesize\ttfamily static void Store\+Settings (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Take all parameters and function mappings and store them, under the given name. 

This can later be restored with \doxyref{Restore\+Settings()}{p.}{classmlpack_1_1CLI_a6de90cea213fa99eaa5d5f354fabfaa0}. If settings have already been saved under the given name, they will be overwritten. This also clears the current parameters and function map.


\begin{DoxyParams}{Parameters}
{\em name} & Name of settings to save. \\
\hline
\end{DoxyParams}


Referenced by Julia\+Option$<$ T $>$\+::\+Julia\+Option(), M\+D\+Option$<$ T $>$\+::\+M\+D\+Option(), Py\+Option$<$ T $>$\+::\+Py\+Option(), and Test\+Option$<$ N $>$\+::\+Test\+Option().



\subsection{Member Data Documentation}
\mbox{\label{classmlpack_1_1CLI_aba5a4e3036cfa1d1c55012097b0b50cc}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!did\+Parse@{did\+Parse}}
\index{did\+Parse@{did\+Parse}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{did\+Parse}
{\footnotesize\ttfamily bool did\+Parse}



True, if \doxyref{C\+LI}{p.}{classmlpack_1_1CLI} was used to parse command line options. 



Definition at line 299 of file cli.\+hpp.



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

\mbox{\label{classmlpack_1_1CLI_af5148312ab081dd2e0da45b2ce998aee}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!doc@{doc}}
\index{doc@{doc}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{doc}
{\footnotesize\ttfamily \textbf{ util\+::\+Program\+Doc}$\ast$ doc}



Pointer to the Program\+Doc object. 



Definition at line 312 of file cli.\+hpp.

\mbox{\label{classmlpack_1_1CLI_a1a6b843f1c06bc4c23630d76510b491e}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!function\+Map@{function\+Map}}
\index{function\+Map@{function\+Map}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{function\+Map}
{\footnotesize\ttfamily \textbf{ Function\+Map\+Type} function\+Map}



Definition at line 290 of file cli.\+hpp.



Referenced by C\+L\+I\+Option$<$ N $>$\+::\+C\+L\+I\+Option(), mlpack\+::bindings\+::cli\+::\+End\+Program(), Julia\+Option$<$ T $>$\+::\+Julia\+Option(), M\+D\+Option$<$ T $>$\+::\+M\+D\+Option(), mlpack\+::bindings\+::cli\+::\+Parse\+Command\+Line(), Py\+Option$<$ T $>$\+::\+Py\+Option(), and Test\+Option$<$ N $>$\+::\+Test\+Option().

\mbox{\label{classmlpack_1_1CLI_a24d855d329269931b59bdf1b36706a88}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!program\+Name@{program\+Name}}
\index{program\+Name@{program\+Name}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{program\+Name}
{\footnotesize\ttfamily std\+::string program\+Name}



Holds the name of the program for --version. 

This is the true program name (argv[0]) not what is given in Program\+Doc. 

Definition at line 303 of file cli.\+hpp.

\mbox{\label{classmlpack_1_1CLI_aca4a039cfb9a63fbe2d98febc7ae337b}} 
\index{mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}!timer@{timer}}
\index{timer@{timer}!mlpack\+::\+C\+LI@{mlpack\+::\+C\+LI}}
\subsubsection{timer}
{\footnotesize\ttfamily \textbf{ Timers} timer}



Holds the timer objects. 



Definition at line 306 of file cli.\+hpp.



Referenced by mlpack\+::bindings\+::cli\+::\+End\+Program(), and mlpack\+::util\+::\+Reset\+Timers().



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/3.\+3.\+0/src/mlpack/core/util/\textbf{ cli.\+hpp}\end{DoxyCompactItemize}
