14 #ifndef MLPACK_CORE_UTIL_CLI_HPP 15 #define MLPACK_CORE_UTIL_CLI_HPP 22 #include <boost/any.hpp> 182 static bool HasParam(
const std::string& identifier);
191 static T&
GetParam(
const std::string& identifier);
214 static T&
GetRawParam(
const std::string& identifier);
225 static void MakeInPlaceCopy(
const std::string& outputParamName,
226 const std::string& inputParamName);
239 static CLI& GetSingleton();
251 static std::map<std::string, util::ParamData>& Parameters();
253 static std::map<char, std::string>& Aliases();
256 static std::string ProgramName();
263 static void SetPassed(
const std::string& name);
273 static void StoreSettings(
const std::string& name);
284 static void RestoreSettings(
const std::string& name,
const bool fatal =
true);
289 static void ClearSettings();
293 std::map<char, std::string> aliases;
295 std::map<std::string, util::ParamData> parameters;
300 typedef std::map<std::string, std::map<std::string,
306 std::map<std::string, std::tuple<std::map<std::string, util::ParamData>,
335 CLI& operator=(
const CLI& other);
341 #include "cli_impl.hpp" bool didParse
True, if CLI was used to parse command line options.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
Timers timer
Holds the timer objects.
std::string programName
Holds the name of the program for –version.
This structure holds all of the information about a single parameter, including its value (which is s...
The timer class provides a way for mlpack methods to be timed.
util::ProgramDoc * doc
Pointer to the ProgramDoc object.
std::map< std::string, std::map< std::string, void(*)(const util::ParamData &, const void *, void *)> > FunctionMapType
Map for functions and types.
T & GetParam(util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
This overload is called when nothing special needs to happen to the name of the parameter.
std::string GetPrintableParam(const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
Print an option.
T & GetRawParam(util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
This overload is called when nothing special needs to happen to the name of the parameter.
A static object whose constructor registers program documentation with the CLI class.
Parses the command line for parameters and holds user-specified parameters.
FunctionMapType functionMap