mlpack::bindings::cli Namespace Reference

Classes

class  CLIOption
 A static object whose constructor registers a parameter with the IO class. More...

 
struct  ParameterType
 Utility struct to return the type that CLI11 should accept for a given input type. More...

 
struct  ParameterType< arma::Col< eT > >
 For vector types, CLI11 will accept a std::string, not an arma::Col<eT> (since it is not clear how to specify a vector on the command-line). More...

 
struct  ParameterType< arma::Mat< eT > >
 For matrix types, CLI11 will accept a std::string, not an arma::mat (since it is not clear how to specify a matrix on the command-line). More...

 
struct  ParameterType< arma::Row< eT > >
 For row vector types, CLI11 will accept a std::string, not an arma::Row<eT> (since it is not clear how to specify a vector on the command-line). More...

 
struct  ParameterType< std::tuple< mlpack::data::DatasetMapper< PolicyType, std::string >, arma::Mat< eT > > >
 For matrix+dataset info types, we should accept a std::string. More...

 
struct  ParameterTypeDeducer
 
struct  ParameterTypeDeducer< true, T >
 

Functions

template
<
typename
T
>
void AddToCLI11 (const std::string &cliName, util::ParamData &param, CLI::App &app, const typename boost::disable_if< std::is_same< T, bool >>::type *=0, 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::enable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
 Add a tuple option to CLI11. More...

 
template
<
typename
T
>
void AddToCLI11 (const std::string &cliName, util::ParamData &param, CLI::App &app, const typename boost::disable_if< std::is_same< T, bool >>::type *=0, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
 Add a serializable option to CLI11. More...

 
template
<
typename
T
>
void AddToCLI11 (const std::string &cliName, util::ParamData &param, CLI::App &app, const typename boost::disable_if< std::is_same< T, bool >>::type *=0, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
 Add an arma matrix to CLI11. More...

 
template
<
typename
T
>
void AddToCLI11 (const std::string &cliName, util::ParamData &param, CLI::App &app, const typename boost::disable_if< std::is_same< T, bool >>::type *=0, 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)
 Add an option to CLI11. More...

 
template
<
typename
T
>
void AddToCLI11 (const std::string &cliName, util::ParamData &param, CLI::App &app, const typename boost::enable_if< std::is_same< T, bool >>::type *=0, 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)
 Add a boolean option to CLI11. More...

 
template
<
typename
T
>
void AddToCLI11 (util::ParamData &param, const void *, void *output)
 Add an option to CLI11. More...

 
template
<
typename
T
>
void DefaultParam (util::ParamData &data, const void *, void *output)
 Return the default value of an option. More...

 
template
<
typename
T
>
std::string DefaultParamImpl (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::string >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
 Return the default value of an option. More...

 
template
<
typename
T
>
std::string DefaultParamImpl (util::ParamData &data, const typename boost::enable_if< util::IsStdVector< T >>::type *=0)
 Return the default value of a vector option. More...

 
template
<
typename
T
>
std::string DefaultParamImpl (util::ParamData &data, const typename boost::enable_if< std::is_same< T, std::string >>::type *=0)
 Return the default value of a string option. More...

 
template
<
typename
T
>
std::string DefaultParamImpl (util::ParamData &data, const typename boost::enable_if_c< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value >::type *=0)
 Return the default value of a matrix option, a tuple option, a serializable option, or a string option (this returns the default filename, or '' if the default is no file). More...

 
template
<
typename
T
>
std::string DefaultParamImpl (util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Return the default value of a model option (this returns the default filename, or '' if the default is no file). More...

 
template
<
typename
T
>
void DeleteAllocatedMemory (util::ParamData &d, const void *, void *)
 
template
<
typename
T
>
void DeleteAllocatedMemoryImpl (util::ParamData &, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0)
 
template
<
typename
T
>
void DeleteAllocatedMemoryImpl (util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 
template
<
typename
T
>
void DeleteAllocatedMemoryImpl (util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 
void EndProgram ()
 Handle command-line program termination. More...

 
template
<
typename
T
>
void * GetAllocatedMemory (util::ParamData &, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0)
 
template
<
typename
T
>
void * GetAllocatedMemory (util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 
template
<
typename
T
>
void * GetAllocatedMemory (util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 
template
<
typename
T
>
void GetAllocatedMemory (util::ParamData &d, const void *, void *output)
 
std::string GetBindingName (const std::string &bindingName)
 Given the name of a binding, print its command-line name (this returns "mlpack_<bindingName>". More...

 
template
<
typename
T
>
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. More...

 
template
<
typename
T
>
T & GetParam (util::ParamData &d, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Return a matrix parameter. More...

 
template
<
typename
T
>
T & GetParam (util::ParamData &d, const typename boost::enable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *=0)
 Return a matrix/dataset info parameter. More...

 
template
<
typename
T
>
T *& GetParam (util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Return a serializable object. More...

 
template
<
typename
T
>
void GetParam (util::ParamData &d, const void *, void *output)
 Return a parameter casted to the given type. More...

 
template
<
typename
T
>
std::string GetPrintableParam (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. More...

 
template
<
typename
T
>
std::string GetPrintableParam (util::ParamData &data, const typename std::enable_if< util::IsStdVector< T >::value >::type *=0)
 Print a vector option, with spaces between it. More...

 
template
<
typename
T
>
std::string GetPrintableParam (util::ParamData &data, const typename std::enable_if< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Print a matrix/tuple option (this just prints the filename). More...

 
template
<
typename
T
>
std::string GetPrintableParam (util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Print a model option (this just prints the filename). More...

 
template
<
typename
T
>
void GetPrintableParam (util::ParamData &data, const void *, void *output)
 Print an option into a std::string. More...

 
template
<
typename
T
>
std::string GetPrintableParamName (util::ParamData &data, 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< data::DatasetInfo, arma::mat >>>::type *=0)
 Get the parameter name for a type that has no special handling. More...

 
template
<
typename
T
>
std::string GetPrintableParamName (util::ParamData &data, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Get the parameter name for a matrix type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
std::string GetPrintableParamName (util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Get the parameter name for a serializable model type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
std::string GetPrintableParamName (util::ParamData &data, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Get the parameter name for a mapped matrix type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
void GetPrintableParamName (util::ParamData &d, const void *, void *output)
 Get the parameter's name as seen by the user. More...

 
template
<
typename
T
>
std::string GetPrintableParamValue (util::ParamData &data, const std::string &value, 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< data::DatasetInfo, arma::mat >>>::type *=0)
 Get the parameter name for a type that has no special handling. More...

 
template
<
typename
T
>
std::string GetPrintableParamValue (util::ParamData &data, const std::string &value, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Get the parameter name for a matrix type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
std::string GetPrintableParamValue (util::ParamData &data, const std::string &value, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Get the parameter name for a serializable model type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
std::string GetPrintableParamValue (util::ParamData &data, const std::string &value, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Get the parameter name for a mapped matrix type (where the user has to pass the file that holds the matrix). More...

 
template
<
typename
T
>
void GetPrintableParamValue (util::ParamData &d, const void *input, void *output)
 Get the parameter's name as seen by the user. More...

 
template
<
typename
T
>
std::string GetPrintableType (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)
 Return a string representing the command-line type of an option. More...

 
template
<
typename
T
>
std::string GetPrintableType (util::ParamData &data, const typename std::enable_if< util::IsStdVector< T >::value >::type *=0)
 Return a string representing the command-line type of a vector. More...

 
template
<
typename
T
>
std::string GetPrintableType (util::ParamData &data, const typename std::enable_if< arma::is_arma_type< T >::value >::type *=0)
 Return a string representing the command-line type of a matrix option. More...

 
template
<
typename
T
>
std::string GetPrintableType (util::ParamData &data, const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Return a string representing the command-line type of a matrix tuple option. More...

 
template
<
typename
T
>
std::string GetPrintableType (util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Return a string representing the command-line type of a model. More...

 
template
<
typename
T
>
void GetPrintableType (util::ParamData &data, const void *, void *output)
 Print the command-line type of an option into a string. More...

 
template
<
typename
T
>
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. More...

 
template
<
typename
T
>
T & GetRawParam (util::ParamData &d, const typename boost::enable_if_c< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value >::type *=0)
 Return a matrix parameter. More...

 
template
<
typename
T
>
T *& GetRawParam (util::ParamData &d, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Return the name of a model parameter. More...

 
template
<
typename
T
>
void GetRawParam (util::ParamData &d, const void *, void *output)
 Return a parameter casted to the given type. More...

 
template
<
typename
T
>
bool IgnoreCheck (const T &)
 Return whether or not a runtime check on parameters should be ignored. More...

 
template
<
typename
T
>
void InPlaceCopy (util::ParamData &d, const void *input, void *)
 Make the given ParamData be an in-place copy of the input. More...

 
template
<
typename
T
>
void InPlaceCopyInternal (util::ParamData &, util::ParamData &, 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 make something an in-place copy. More...

 
template
<
typename
T
>
void InPlaceCopyInternal (util::ParamData &d, util::ParamData &input, const typename std::enable_if< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value||data::HasSerialize< T >::value >::type *=0)
 Modify the filename for any type that needs to be loaded from disk to match the filename of the input parameter. More...

 
template
<
typename
T
>
std::string MapParameterName (const std::string &identifier, 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)
 If needed, map the parameter name to the name that is used by CLI11. More...

 
template
<
typename
T
>
std::string MapParameterName (const std::string &identifier, const typename boost::enable_if_c< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value||data::HasSerialize< T >::value >::type *=0)
 Map the parameter name to the name that is used by CLI11. More...

 
template
<
typename
T
>
void MapParameterName (util::ParamData &d, const void *, void *output)
 Map the parameter name to the name seen by CLI. More...

 
template
<
typename
T
>
void OutputParam (util::ParamData &data, const void *, void *)
 Output an option. More...

 
template
<
typename
T
>
void OutputParamImpl (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)
 Output an option (print to stdout). More...

 
template
<
typename
T
>
void OutputParamImpl (util::ParamData &data, const typename boost::enable_if< util::IsStdVector< T >>::type *=0)
 Output a vector option (print to stdout). More...

 
template
<
typename
T
>
void OutputParamImpl (util::ParamData &data, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0)
 Output a matrix option (this saves it to the given file). More...

 
template
<
typename
T
>
void OutputParamImpl (util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Output a serializable class option (this saves it to the given file). More...

 
template
<
typename
T
>
void OutputParamImpl (util::ParamData &data, const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0)
 Output a mapped dataset. More...

 
 PARAM_FLAG ("help", "Default help info.", "h")
 
 PARAM_FLAG ("verbose", "Display informational messages and the full list of " "parameters and timers at the end of execution.", "v")
 
 PARAM_FLAG ("version", "Display the version of mlpack.", "V")
 
 PARAM_STRING_IN ("info", "Print help on a specific option.", "", "")
 
std::string ParamString (const std::string &paramName)
 Print what a user would type to invoke the given option name. More...

 
void ParseCommandLine (int argc, char **argv)
 Parse the command line, setting all of the options inside of the CLI object to their appropriate given values. More...

 
std::string PrintDataset (const std::string &dataset)
 Print a dataset type parameter (add .csv and return). More...

 
std::string PrintDefault (const std::string &paramName)
 Given a parameter name, print its corresponding default value. More...

 
void PrintHelp (const std::string &param="")
 Print the help for the given parameter. More...

 
std::string PrintImport (const std::string &bindingName)
 Print any imports for CLI (there are none, so this returns an empty string). More...

 
std::string PrintInputOptionInfo ()
 Print any special information about input options. More...

 
std::string PrintModel (const std::string &model)
 Print a model type parameter (add .bin and return). More...

 
std::string PrintOutputOptionInfo ()
 Print any special information about output options. More...

 
std::string PrintType (util::ParamData &param)
 Print the type of a parameter that a user would specify from the command-line. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (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)
 Return a string representing the command-line type of an option. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (util::ParamData &data, const typename std::enable_if< util::IsStdVector< T >::value >::type *=0)
 Return a string representing the command-line type of a vector. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (util::ParamData &data, const typename std::enable_if< arma::is_arma_type< T >::value >::type *=0)
 Return a string representing the command-line type of a matrix option. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (util::ParamData &data, const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Return a string representing the command-line type of a matrix tuple option. More...

 
template
<
typename
T
>
std::string PrintTypeDoc (util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Return a string representing the command-line type of a model. More...

 
template
<
typename
T
>
void PrintTypeDoc (util::ParamData &data, const void *, void *output)
 Print the command-line type of an option into a string. More...

 
std::string PrintTypeDocs ()
 Print documentation for each of the types. More...

 
template
<
typename
T
>
std::string PrintValue (const T &value, bool quotes)
 Given a parameter type, print the corresponding value. More...

 
std::string ProcessOptions ()
 Base case for recursion. More...

 
template<typename T , typename... Args>
std::string ProcessOptions (const std::string &paramName, const T &value, Args... args)
 Print an option for a command-line argument. More...

 
template<typename... Args>
std::string ProgramCall (const std::string &programName, Args... args)
 Given a program name and arguments for it, print what its invocation would be. More...

 
std::string ProgramCall (const std::string &programName)
 Given a program name, print a program call invocation assuming that all options are specified. More...

 
template
<
typename
T
>
void SetParam (util::ParamData &d, const boost::any &value, 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, const typename boost::disable_if< std::is_same< T, bool >>::type *=0)
 This overload is called when nothing special needs to happen to the name of the parameter. More...

 
template
<
typename
T
>
void SetParam (util::ParamData &d, const boost::any &, const typename boost::enable_if< std::is_same< T, bool >>::type *=0)
 This overload is called to set a boolean. More...

 
template
<
typename
T
>
void SetParam (util::ParamData &d, const boost::any &value, const typename std::enable_if< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
 Set a matrix parameter, a matrix/dataset info parameter, or a serializable object. More...

 
template
<
typename
T
>
void SetParam (util::ParamData &d, const boost::any &value, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Set a serializable object. More...

 
template
<
typename
T
>
void SetParam (util::ParamData &d, const void *input, void *)
 Return a parameter casted to the given type. More...

 
template
<
typename
T
>
void StringTypeParam (util::ParamData &, const void *, void *output)
 Return a string containing the type of a parameter. More...

 
template
<
>
void StringTypeParam< bool > (util::ParamData &, const void *, void *output)
 Return "bool". More...

 
template
<
>
void StringTypeParam< double > (util::ParamData &, const void *, void *output)
 Return "double". More...

 
template
<
>
void StringTypeParam< int > (util::ParamData &, const void *, void *output)
 Return "int". More...

 
template
<
>
void StringTypeParam< std::string > (util::ParamData &, const void *, void *output)
 Return "string". More...

 
template
<
>
void StringTypeParam< std::tuple< mlpack::data::DatasetInfo, arma::mat > > (util::ParamData &, const void *, void *output)
 Return "string";. More...

 
template
<
typename
T
>
std::string StringTypeParamImpl (const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0)
 Return a string containing the type of the parameter. More...

 
template
<
typename
T
>
std::string StringTypeParamImpl (const typename boost::enable_if< util::IsStdVector< T >>::type *=0)
 Return a string containing the type of the parameter, for vector options. More...

 
template
<
typename
T
>
std::string StringTypeParamImpl (const typename boost::enable_if< data::HasSerialize< T >>::type *=0)
 Return a string containing the type of the parameter,. More...

 

Function Documentation

◆ AddToCLI11() [1/6]

void mlpack::bindings::cli::AddToCLI11 ( const std::string &  cliName,
util::ParamData param,
CLI::App &  app,
const typename boost::disable_if< std::is_same< T, bool >>::type *  = 0,
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::enable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Add a tuple option to CLI11.

Parameters
cliNameThe name of the option to add to CLI11.
paraman object of util::ParamData.
appA CLI11 object to add parameter to.

Definition at line 33 of file add_to_cli11.hpp.

References ParamData::desc, ParamData::value, and ParamData::wasPassed.

◆ AddToCLI11() [2/6]

void mlpack::bindings::cli::AddToCLI11 ( const std::string &  cliName,
util::ParamData param,
CLI::App &  app,
const typename boost::disable_if< std::is_same< T, bool >>::type *  = 0,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Add a serializable option to CLI11.

Parameters
cliNameThe name of the option to add to CLI11.
paraman object of util::ParamData.
appa CLI11 object to add parameter to.

Definition at line 65 of file add_to_cli11.hpp.

References ParamData::desc, ParamData::value, and ParamData::wasPassed.

◆ AddToCLI11() [3/6]

void mlpack::bindings::cli::AddToCLI11 ( const std::string &  cliName,
util::ParamData param,
CLI::App &  app,
const typename boost::disable_if< std::is_same< T, bool >>::type *  = 0,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Add an arma matrix to CLI11.

Parameters
cliNameThe name of the option to add to CLI11.
paraman object of util::ParamData.
appa CLI11 object to add parameter to.

Definition at line 97 of file add_to_cli11.hpp.

References ParamData::desc, ParamData::value, and ParamData::wasPassed.

◆ AddToCLI11() [4/6]

void mlpack::bindings::cli::AddToCLI11 ( const std::string &  cliName,
util::ParamData param,
CLI::App &  app,
const typename boost::disable_if< std::is_same< T, bool >>::type *  = 0,
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 
)

Add an option to CLI11.

Parameters
cliNameThe name of the option to add to CLI11.
paraman object of util::ParamData.
appa CLI11 object to add parameter to.

Definition at line 127 of file add_to_cli11.hpp.

References ParamData::desc, ParamData::value, and ParamData::wasPassed.

◆ AddToCLI11() [5/6]

void mlpack::bindings::cli::AddToCLI11 ( const std::string &  cliName,
util::ParamData param,
CLI::App &  app,
const typename boost::enable_if< std::is_same< T, bool >>::type *  = 0,
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 
)

Add a boolean option to CLI11.

Parameters
cliNameThe name of the option to add to CLI11.
paraman object of util::ParamData.
appa CLI11 object to add parameter to.

Definition at line 157 of file add_to_cli11.hpp.

References ParamData::desc, ParamData::value, and ParamData::wasPassed.

◆ AddToCLI11() [6/6]

void mlpack::bindings::cli::AddToCLI11 ( util::ParamData param,
const void *  ,
void *  output 
)

Add an option to CLI11.

This is the function meant to be used in the CLI function map.

Parameters
paramParameter data.
*(input) Unused void pointer.
outputVoid pointer to options_description object.

Definition at line 188 of file add_to_cli11.hpp.

References ParamData::alias, and ParamData::name.

◆ DefaultParam()

void mlpack::bindings::cli::DefaultParam ( util::ParamData data,
const void *  ,
void *  output 
)

Return the default value of an option.

This is the function that will be placed into the CLI functionMap.

Definition at line 80 of file default_param.hpp.

◆ DefaultParamImpl() [1/5]

std::string mlpack::bindings::cli::DefaultParamImpl ( 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::string >>::type *  = 0,
const typename boost::disable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Return the default value of an option.

This is for regular types.

◆ DefaultParamImpl() [2/5]

std::string mlpack::bindings::cli::DefaultParamImpl ( util::ParamData data,
const typename boost::enable_if< util::IsStdVector< T >>::type *  = 0 
)

Return the default value of a vector option.

◆ DefaultParamImpl() [3/5]

std::string mlpack::bindings::cli::DefaultParamImpl ( util::ParamData data,
const typename boost::enable_if< std::is_same< T, std::string >>::type *  = 0 
)

Return the default value of a string option.

◆ DefaultParamImpl() [4/5]

std::string mlpack::bindings::cli::DefaultParamImpl ( util::ParamData data,
const typename boost::enable_if_c< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Return the default value of a matrix option, a tuple option, a serializable option, or a string option (this returns the default filename, or '' if the default is no file).

◆ DefaultParamImpl() [5/5]

std::string mlpack::bindings::cli::DefaultParamImpl ( util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Return the default value of a model option (this returns the default filename, or '' if the default is no file).

◆ DeleteAllocatedMemory()

void mlpack::bindings::cli::DeleteAllocatedMemory ( util::ParamData d,
const void *  ,
void *   
)

Definition at line 50 of file delete_allocated_memory.hpp.

◆ DeleteAllocatedMemoryImpl() [1/3]

void mlpack::bindings::cli::DeleteAllocatedMemoryImpl ( util::ParamData ,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0 
)

Definition at line 22 of file delete_allocated_memory.hpp.

◆ DeleteAllocatedMemoryImpl() [2/3]

void mlpack::bindings::cli::DeleteAllocatedMemoryImpl ( util::ParamData ,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Definition at line 31 of file delete_allocated_memory.hpp.

◆ DeleteAllocatedMemoryImpl() [3/3]

void mlpack::bindings::cli::DeleteAllocatedMemoryImpl ( util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Definition at line 39 of file delete_allocated_memory.hpp.

References ParamData::value.

◆ EndProgram()

void mlpack::bindings::cli::EndProgram ( )
inline

Handle command-line program termination.

If –help or –info was passed, we won't make it here, so we don't have to write any contingencies for that.

Definition at line 26 of file end_program.hpp.

References IO::functionMap, Timers::GetAllTimers(), IO::GetSingleton(), IO::HasParam(), Log::Info, ParamData::input, IO::Parameters(), Timers::PrintTimer(), Timers::StopAllTimers(), IO::timer, and ParamData::tname.

◆ GetAllocatedMemory() [1/4]

void* mlpack::bindings::cli::GetAllocatedMemory ( util::ParamData ,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0 
)

Definition at line 23 of file get_allocated_memory.hpp.

◆ GetAllocatedMemory() [2/4]

void* mlpack::bindings::cli::GetAllocatedMemory ( util::ParamData ,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Definition at line 32 of file get_allocated_memory.hpp.

◆ GetAllocatedMemory() [3/4]

void* mlpack::bindings::cli::GetAllocatedMemory ( util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Definition at line 40 of file get_allocated_memory.hpp.

References ParamData::value.

◆ GetAllocatedMemory() [4/4]

void mlpack::bindings::cli::GetAllocatedMemory ( util::ParamData d,
const void *  ,
void *  output 
)

Definition at line 52 of file get_allocated_memory.hpp.

◆ GetBindingName()

std::string mlpack::bindings::cli::GetBindingName ( const std::string &  bindingName)
inline

Given the name of a binding, print its command-line name (this returns "mlpack_<bindingName>".

◆ GetParam() [1/5]

T& mlpack::bindings::cli::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.

Parameters
dParamData object to get parameter value from.

Definition at line 29 of file get_param.hpp.

References ParamData::value.

◆ GetParam() [2/5]

T& mlpack::bindings::cli::GetParam ( util::ParamData d,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Return a matrix parameter.

Parameters
dParamData object to get parameter value from.

Definition at line 46 of file get_param.hpp.

References ParamData::input, mlpack::data::Load(), ParamData::loaded, ParamData::noTranspose, and ParamData::value.

◆ GetParam() [3/5]

T& mlpack::bindings::cli::GetParam ( util::ParamData d,
const typename boost::enable_if< std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Return a matrix/dataset info parameter.

Parameters
dParamData object to get parameter value from.

Definition at line 77 of file get_param.hpp.

References ParamData::input, mlpack::data::Load(), ParamData::loaded, ParamData::noTranspose, and ParamData::value.

◆ GetParam() [4/5]

T*& mlpack::bindings::cli::GetParam ( util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Return a serializable object.

Parameters
dParamData object to get parameter value from.

Definition at line 103 of file get_param.hpp.

References ParamData::input, mlpack::data::Load(), ParamData::loaded, and ParamData::value.

◆ GetParam() [5/5]

void mlpack::bindings::cli::GetParam ( util::ParamData d,
const void *  ,
void *  output 
)

Return a parameter casted to the given type.

Type checking does not happen here!

Parameters
dParameter information.
*(input) Unused parameter.
outputPlace to store pointer to value.

Definition at line 132 of file get_param.hpp.

◆ GetPrintableParam() [1/5]

std::string mlpack::bindings::cli::GetPrintableParam ( 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.

Print an option.

Definition at line 26 of file get_printable_param.hpp.

◆ GetPrintableParam() [2/5]

std::string mlpack::bindings::cli::GetPrintableParam ( util::ParamData data,
const typename std::enable_if< util::IsStdVector< T >::value >::type *  = 0 
)

Print a vector option, with spaces between it.

◆ GetPrintableParam() [3/5]

std::string mlpack::bindings::cli::GetPrintableParam ( util::ParamData data,
const typename std::enable_if< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Print a matrix/tuple option (this just prints the filename).

◆ GetPrintableParam() [4/5]

std::string mlpack::bindings::cli::GetPrintableParam ( util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Print a model option (this just prints the filename).

Print a model option (this just prints the filename).

Definition at line 75 of file get_printable_param.hpp.

◆ GetPrintableParam() [5/5]

void mlpack::bindings::cli::GetPrintableParam ( util::ParamData data,
const void *  ,
void *  output 
)

Print an option into a std::string.

This should print a short, one-line representation of the object. The string will be stored in the output pointer.

Definition at line 69 of file get_printable_param.hpp.

◆ GetPrintableParamName() [1/5]

std::string mlpack::bindings::cli::GetPrintableParamName ( util::ParamData data,
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< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Get the parameter name for a type that has no special handling.

◆ GetPrintableParamName() [2/5]

std::string mlpack::bindings::cli::GetPrintableParamName ( util::ParamData data,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Get the parameter name for a matrix type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamName() [3/5]

std::string mlpack::bindings::cli::GetPrintableParamName ( util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Get the parameter name for a serializable model type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamName() [4/5]

std::string mlpack::bindings::cli::GetPrintableParamName ( util::ParamData data,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Get the parameter name for a mapped matrix type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamName() [5/5]

void mlpack::bindings::cli::GetPrintableParamName ( util::ParamData d,
const void *  ,
void *  output 
)

Get the parameter's name as seen by the user.

Definition at line 67 of file get_printable_param_name.hpp.

◆ GetPrintableParamValue() [1/5]

std::string mlpack::bindings::cli::GetPrintableParamValue ( util::ParamData data,
const std::string &  value,
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< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Get the parameter name for a type that has no special handling.

◆ GetPrintableParamValue() [2/5]

std::string mlpack::bindings::cli::GetPrintableParamValue ( util::ParamData data,
const std::string &  value,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Get the parameter name for a matrix type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamValue() [3/5]

std::string mlpack::bindings::cli::GetPrintableParamValue ( util::ParamData data,
const std::string &  value,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Get the parameter name for a serializable model type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamValue() [4/5]

std::string mlpack::bindings::cli::GetPrintableParamValue ( util::ParamData data,
const std::string &  value,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Get the parameter name for a mapped matrix type (where the user has to pass the file that holds the matrix).

◆ GetPrintableParamValue() [5/5]

void mlpack::bindings::cli::GetPrintableParamValue ( util::ParamData d,
const void *  input,
void *  output 
)

Get the parameter's name as seen by the user.

Definition at line 71 of file get_printable_param_value.hpp.

◆ GetPrintableType() [1/6]

std::string mlpack::bindings::cli::GetPrintableType ( 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 
)

Return a string representing the command-line type of an option.

◆ GetPrintableType() [2/6]

std::string mlpack::bindings::cli::GetPrintableType ( util::ParamData data,
const typename std::enable_if< util::IsStdVector< T >::value >::type *  = 0 
)

Return a string representing the command-line type of a vector.

◆ GetPrintableType() [3/6]

std::string mlpack::bindings::cli::GetPrintableType ( util::ParamData data,
const typename std::enable_if< arma::is_arma_type< T >::value >::type *  = 0 
)

Return a string representing the command-line type of a matrix option.

◆ GetPrintableType() [4/6]

std::string mlpack::bindings::cli::GetPrintableType ( util::ParamData data,
const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Return a string representing the command-line type of a matrix tuple option.

◆ GetPrintableType() [5/6]

std::string mlpack::bindings::cli::GetPrintableType ( util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Return a string representing the command-line type of a model.

◆ GetPrintableType() [6/6]

void mlpack::bindings::cli::GetPrintableType ( util::ParamData data,
const void *  ,
void *  output 
)

Print the command-line type of an option into a string.

Definition at line 70 of file get_printable_type.hpp.

◆ GetRawParam() [1/4]

T& mlpack::bindings::cli::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.

Definition at line 28 of file get_raw_param.hpp.

References ParamData::value.

◆ GetRawParam() [2/4]

T& mlpack::bindings::cli::GetRawParam ( util::ParamData d,
const typename boost::enable_if_c< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Return a matrix parameter.

Definition at line 43 of file get_raw_param.hpp.

References ParamData::value.

◆ GetRawParam() [3/4]

T*& mlpack::bindings::cli::GetRawParam ( util::ParamData d,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Return the name of a model parameter.

Definition at line 60 of file get_raw_param.hpp.

References ParamData::value.

◆ GetRawParam() [4/4]

void mlpack::bindings::cli::GetRawParam ( util::ParamData d,
const void *  ,
void *  output 
)

Return a parameter casted to the given type.

Type checking does not happen here!

Parameters
dParameter information.
*(input) Unused parameter.
outputPlace to store pointer to value.

Definition at line 80 of file get_raw_param.hpp.

◆ IgnoreCheck()

bool mlpack::bindings::cli::IgnoreCheck ( const T &  )
inline

Return whether or not a runtime check on parameters should be ignored.

We don't ignore any runtime checks for CLI bindings, so this always returns false.

Definition at line 117 of file print_doc_functions.hpp.

◆ InPlaceCopy()

void mlpack::bindings::cli::InPlaceCopy ( util::ParamData d,
const void *  input,
void *   
)

Make the given ParamData be an in-place copy of the input.

Parameters
dParameter information.
inputInput ParamData we would like be the source of the in-place copy.
*(output) Unused parameter.

Definition at line 77 of file in_place_copy.hpp.

◆ InPlaceCopyInternal() [1/2]

void mlpack::bindings::cli::InPlaceCopyInternal ( util::ParamData ,
util::ParamData ,
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 make something an in-place copy.

Parameters
*(d) ParamData object to get parameter value from. (Unused.)
*(input) ParamData object that represents the option we are making a copy of. (Unused.)

Definition at line 31 of file in_place_copy.hpp.

◆ InPlaceCopyInternal() [2/2]

void mlpack::bindings::cli::InPlaceCopyInternal ( util::ParamData d,
util::ParamData input,
const typename std::enable_if< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value||data::HasSerialize< T >::value >::type *  = 0 
)

Modify the filename for any type that needs to be loaded from disk to match the filename of the input parameter.

Parameters
dParamData object we want to make into an in-place copy.
inputParamData object whose filename we should copy.

Definition at line 50 of file in_place_copy.hpp.

References ParamData::value.

◆ MapParameterName() [1/3]

std::string mlpack::bindings::cli::MapParameterName ( const std::string &  identifier,
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 
)

If needed, map the parameter name to the name that is used by CLI11.

This overload simply returns the same name, so it is used for primitive types.

Definition at line 28 of file map_parameter_name.hpp.

Referenced by CLIOption< N >::CLIOption().

◆ MapParameterName() [2/3]

std::string mlpack::bindings::cli::MapParameterName ( const std::string &  identifier,
const typename boost::enable_if_c< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value||data::HasSerialize< T >::value >::type *  = 0 
)

Map the parameter name to the name that is used by CLI11.

This overload addresses matrices and models, where the parameter name has "_file" appended to it (since a filename will be provided).

Definition at line 44 of file map_parameter_name.hpp.

◆ MapParameterName() [3/3]

void mlpack::bindings::cli::MapParameterName ( util::ParamData d,
const void *  ,
void *  output 
)

Map the parameter name to the name seen by CLI.

Parameters
dParameter data.
*(input) Unused parameter.
outputPointer to std::string that will hold the mapped name.

Definition at line 63 of file map_parameter_name.hpp.

References ParamData::name.

◆ OutputParam()

void mlpack::bindings::cli::OutputParam ( util::ParamData data,
const void *  ,
void *   
)

Output an option.

This is the function that will be called by the IO module.

Definition at line 74 of file output_param.hpp.

◆ OutputParamImpl() [1/5]

void mlpack::bindings::cli::OutputParamImpl ( 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 
)

Output an option (print to stdout).

◆ OutputParamImpl() [2/5]

void mlpack::bindings::cli::OutputParamImpl ( util::ParamData data,
const typename boost::enable_if< util::IsStdVector< T >>::type *  = 0 
)

Output a vector option (print to stdout).

◆ OutputParamImpl() [3/5]

void mlpack::bindings::cli::OutputParamImpl ( util::ParamData data,
const typename boost::enable_if< arma::is_arma_type< T >>::type *  = 0 
)

Output a matrix option (this saves it to the given file).

◆ OutputParamImpl() [4/5]

void mlpack::bindings::cli::OutputParamImpl ( util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Output a serializable class option (this saves it to the given file).

◆ OutputParamImpl() [5/5]

void mlpack::bindings::cli::OutputParamImpl ( util::ParamData data,
const typename boost::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *  = 0 
)

Output a mapped dataset.

◆ PARAM_FLAG() [1/3]

mlpack::bindings::cli::PARAM_FLAG ( "help"  ,
"Default help info."  ,
"h"   
)

◆ PARAM_FLAG() [2/3]

mlpack::bindings::cli::PARAM_FLAG ( "verbose"  ,
"Display informational messages and the full list of " "parameters and timers at the end of execution."  ,
"v"   
)

◆ PARAM_FLAG() [3/3]

mlpack::bindings::cli::PARAM_FLAG ( "version"  ,
"Display the version of mlpack."  ,
"V"   
)

◆ PARAM_STRING_IN()

mlpack::bindings::cli::PARAM_STRING_IN ( "info"  ,
"Print help on a specific option."  ,
""  ,
""   
)

◆ ParamString()

std::string mlpack::bindings::cli::ParamString ( const std::string &  paramName)
inline

Print what a user would type to invoke the given option name.

Note that the name must exist in the CLI module. (Note that because of the way BINDING_LONG_DESC() and BINDING_EXAMPLE() is structured, this doesn't mean that all of the PARAM_*() declarataions need to come before BINDING_LONG_DESC() and BINDING_EXAMPLE() declaration.)

◆ ParseCommandLine()

void mlpack::bindings::cli::ParseCommandLine ( int  argc,
char **  argv 
)

Parse the command line, setting all of the options inside of the CLI object to their appropriate given values.

Definition at line 36 of file parse_command_line.hpp.

References Log::Debug, IO::didParse, Log::Fatal, IO::functionMap, IO::GetSingleton(), mlpack::util::GetVersion(), IO::HasParam(), PrefixedOutStream::ignoreInput, Log::Info, IO::Parameters(), PrintHelp(), IO::ProgramName(), ParamData::required, and ParamData::tname.

◆ PrintDataset()

std::string mlpack::bindings::cli::PrintDataset ( const std::string &  dataset)
inline

Print a dataset type parameter (add .csv and return).

◆ PrintDefault()

std::string mlpack::bindings::cli::PrintDefault ( const std::string &  paramName)
inline

Given a parameter name, print its corresponding default value.

◆ PrintHelp()

void mlpack::bindings::cli::PrintHelp ( const std::string &  param = "")

Print the help for the given parameter.

If no parameter is specified, then help will be printed for all parameters.

Parameters
paramParameter name to print help for.

Referenced by ParseCommandLine().

◆ PrintImport()

std::string mlpack::bindings::cli::PrintImport ( const std::string &  bindingName)
inline

Print any imports for CLI (there are none, so this returns an empty string).

◆ PrintInputOptionInfo()

std::string mlpack::bindings::cli::PrintInputOptionInfo ( )
inline

Print any special information about input options.

◆ PrintModel()

std::string mlpack::bindings::cli::PrintModel ( const std::string &  model)
inline

Print a model type parameter (add .bin and return).

◆ PrintOutputOptionInfo()

std::string mlpack::bindings::cli::PrintOutputOptionInfo ( )
inline

Print any special information about output options.

◆ PrintType()

std::string mlpack::bindings::cli::PrintType ( util::ParamData param)
inline

Print the type of a parameter that a user would specify from the command-line.

◆ PrintTypeDoc() [1/6]

std::string mlpack::bindings::cli::PrintTypeDoc ( 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 
)

Return a string representing the command-line type of an option.

◆ PrintTypeDoc() [2/6]

std::string mlpack::bindings::cli::PrintTypeDoc ( util::ParamData data,
const typename std::enable_if< util::IsStdVector< T >::value >::type *  = 0 
)

Return a string representing the command-line type of a vector.

◆ PrintTypeDoc() [3/6]

std::string mlpack::bindings::cli::PrintTypeDoc ( util::ParamData data,
const typename std::enable_if< arma::is_arma_type< T >::value >::type *  = 0 
)

Return a string representing the command-line type of a matrix option.

◆ PrintTypeDoc() [4/6]

std::string mlpack::bindings::cli::PrintTypeDoc ( util::ParamData data,
const typename std::enable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Return a string representing the command-line type of a matrix tuple option.

◆ PrintTypeDoc() [5/6]

std::string mlpack::bindings::cli::PrintTypeDoc ( util::ParamData data,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Return a string representing the command-line type of a model.

◆ PrintTypeDoc() [6/6]

void mlpack::bindings::cli::PrintTypeDoc ( util::ParamData data,
const void *  ,
void *  output 
)

Print the command-line type of an option into a string.

Definition at line 72 of file print_type_doc.hpp.

◆ PrintTypeDocs()

std::string mlpack::bindings::cli::PrintTypeDocs ( )
inline

Print documentation for each of the types.

◆ PrintValue()

std::string mlpack::bindings::cli::PrintValue ( const T &  value,
bool  quotes 
)
inline

Given a parameter type, print the corresponding value.

◆ ProcessOptions() [1/2]

std::string mlpack::bindings::cli::ProcessOptions ( )
inline

Base case for recursion.

◆ ProcessOptions() [2/2]

std::string mlpack::bindings::cli::ProcessOptions ( const std::string &  paramName,
const T &  value,
Args...  args 
)

Print an option for a command-line argument.

◆ ProgramCall() [1/2]

std::string mlpack::bindings::cli::ProgramCall ( const std::string &  programName,
Args...  args 
)

Given a program name and arguments for it, print what its invocation would be.

◆ ProgramCall() [2/2]

std::string mlpack::bindings::cli::ProgramCall ( const std::string &  programName)
inline

Given a program name, print a program call invocation assuming that all options are specified.

◆ SetParam() [1/5]

void mlpack::bindings::cli::SetParam ( util::ParamData d,
const boost::any &  value,
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,
const typename boost::disable_if< std::is_same< T, bool >>::type *  = 0 
)

This overload is called when nothing special needs to happen to the name of the parameter.

Definition at line 27 of file set_param.hpp.

References ParamData::value.

◆ SetParam() [2/5]

void mlpack::bindings::cli::SetParam ( util::ParamData d,
const boost::any &  ,
const typename boost::enable_if< std::is_same< T, bool >>::type *  = 0 
)

This overload is called to set a boolean.

Definition at line 44 of file set_param.hpp.

References ParamData::value, and ParamData::wasPassed.

◆ SetParam() [3/5]

void mlpack::bindings::cli::SetParam ( util::ParamData d,
const boost::any &  value,
const typename std::enable_if< arma::is_arma_type< T >::value||std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *  = 0 
)

Set a matrix parameter, a matrix/dataset info parameter, or a serializable object.

These set the filename referring to the parameter.

Definition at line 58 of file set_param.hpp.

References ParamData::value.

◆ SetParam() [4/5]

void mlpack::bindings::cli::SetParam ( util::ParamData d,
const boost::any &  value,
const typename boost::disable_if< arma::is_arma_type< T >>::type *  = 0,
const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0 
)

Set a serializable object.

This sets the filename referring to the parameter.

Definition at line 76 of file set_param.hpp.

References ParamData::value.

◆ SetParam() [5/5]

void mlpack::bindings::cli::SetParam ( util::ParamData d,
const void *  input,
void *   
)

Return a parameter casted to the given type.

Type checking does not happen here!

Parameters
dParameter information.
inputUnused parameter.
*(output) Place to store pointer to value.

Definition at line 97 of file set_param.hpp.

◆ StringTypeParam()

void mlpack::bindings::cli::StringTypeParam ( util::ParamData ,
const void *  ,
void *  output 
)

Return a string containing the type of a parameter.

This overload is used if we don't have a primitive type.

Definition at line 51 of file string_type_param.hpp.

References StringTypeParam< bool >(), StringTypeParam< double >(), and StringTypeParam< int >().

◆ StringTypeParam< bool >()

void mlpack::bindings::cli::StringTypeParam< bool > ( util::ParamData ,
const void *  ,
void *  output 
)
inline

Return "bool".

Referenced by StringTypeParam().

◆ StringTypeParam< double >()

void mlpack::bindings::cli::StringTypeParam< double > ( util::ParamData ,
const void *  ,
void *  output 
)
inline

Return "double".

Referenced by StringTypeParam().

◆ StringTypeParam< int >()

void mlpack::bindings::cli::StringTypeParam< int > ( util::ParamData ,
const void *  ,
void *  output 
)
inline

Return "int".

Referenced by StringTypeParam().

◆ StringTypeParam< std::string >()

void mlpack::bindings::cli::StringTypeParam< std::string > ( util::ParamData ,
const void *  ,
void *  output 
)
inline

Return "string".

◆ StringTypeParam< std::tuple< mlpack::data::DatasetInfo, arma::mat > >()

void mlpack::bindings::cli::StringTypeParam< std::tuple< mlpack::data::DatasetInfo, arma::mat > > ( util::ParamData ,
const void *  ,
void *  output 
)
inline

Return "string";.

◆ StringTypeParamImpl() [1/3]

std::string mlpack::bindings::cli::StringTypeParamImpl ( const typename boost::disable_if< util::IsStdVector< T >>::type *  = 0,
const typename boost::disable_if< data::HasSerialize< T >>::type *  = 0 
)

Return a string containing the type of the parameter.

◆ StringTypeParamImpl() [2/3]

std::string mlpack::bindings::cli::StringTypeParamImpl ( const typename boost::enable_if< util::IsStdVector< T >>::type *  = 0)

Return a string containing the type of the parameter, for vector options.

◆ StringTypeParamImpl() [3/3]

std::string mlpack::bindings::cli::StringTypeParamImpl ( const typename boost::enable_if< data::HasSerialize< T >>::type *  = 0)

Return a string containing the type of the parameter,.