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 | |
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 | |
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 | |
void | AddToCLI11 (const std::string &cliName, util::ParamData ¶m, 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 | |
void | AddToCLI11 (const std::string &cliName, util::ParamData ¶m, 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 | |
void | AddToCLI11 (const std::string &cliName, util::ParamData ¶m, 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 | |
void | AddToCLI11 (const std::string &cliName, util::ParamData ¶m, 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 | |
void | AddToCLI11 (const std::string &cliName, util::ParamData ¶m, 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 | |
void | AddToCLI11 (util::ParamData ¶m, const void *, void *output) |
Add an option to CLI11. More... | |
template | |
void | DefaultParam (util::ParamData &data, const void *, void *output) |
Return the default value of an option. More... | |
template | |
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 | |
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 | |
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 | |
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 | |
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 | |
void | DeleteAllocatedMemory (util::ParamData &d, const void *, void *) |
template | |
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 | |
void | DeleteAllocatedMemoryImpl (util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0) |
template | |
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 | |
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 | |
void * | GetAllocatedMemory (util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0) |
template | |
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 | |
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_ | |
template | |
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 | |
T & | GetParam (util::ParamData &d, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0) |
Return a matrix parameter. More... | |
template | |
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 | |
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 | |
void | GetParam (util::ParamData &d, const void *, void *output) |
Return a parameter casted to the given type. More... | |
template | |
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 | |
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 | |
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 | |
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 | |
void | GetPrintableParam (util::ParamData &data, const void *, void *output) |
Print an option into a std::string. More... | |
template | |
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 | |
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 | |
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 | |
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 | |
void | GetPrintableParamName (util::ParamData &d, const void *, void *output) |
Get the parameter's name as seen by the user. More... | |
template | |
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 | |
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 | |
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 | |
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 | |
void | GetPrintableParamValue (util::ParamData &d, const void *input, void *output) |
Get the parameter's name as seen by the user. More... | |
template | |
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 | |
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 | |
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 | |
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 | |
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 | |
void | GetPrintableType (util::ParamData &data, const void *, void *output) |
Print the command-line type of an option into a string. More... | |
template | |
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 | |
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 | |
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 | |
void | GetRawParam (util::ParamData &d, const void *, void *output) |
Return a parameter casted to the given type. More... | |
template | |
bool | IgnoreCheck (const T &) |
Return whether or not a runtime check on parameters should be ignored. More... | |
template | |
void | InPlaceCopy (util::ParamData &d, const void *input, void *) |
Make the given ParamData be an in-place copy of the input. More... | |
template | |
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 | |
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 | |
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 | |
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 | |
void | MapParameterName (util::ParamData &d, const void *, void *output) |
Map the parameter name to the name seen by CLI. More... | |
template | |
void | OutputParam (util::ParamData &data, const void *, void *) |
Output an option. More... | |
template | |
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 | |
void | OutputParamImpl (util::ParamData &data, const typename boost::enable_if< util::IsStdVector< T >>::type *=0) |
Output a vector option (print to stdout). More... | |
template | |
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 | |
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 | |
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 ¶mName) |
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 ¶mName) |
Given a parameter name, print its corresponding default value. More... | |
void | PrintHelp (const std::string ¶m="") |
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 ¶m) |
Print the type of a parameter that a user would specify from the command-line. More... | |
template | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
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 | |
std::string | ProcessOptions (const std::string ¶mName, const T &value, Args... args) |
Print an option for a command-line argument. More... | |
template | |
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 | |
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 | |
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 | |
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 | |
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 | |
void | SetParam (util::ParamData &d, const void *input, void *) |
Return a parameter casted to the given type. More... | |
template | |
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 | |
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 | |
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 | |
std::string | StringTypeParamImpl (const typename boost::enable_if< data::HasSerialize< T >>::type *=0) |
Return a string containing the type of the parameter,. More... | |
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.
cliName | The name of the option to add to CLI11. |
param | an object of util::ParamData. |
app | A CLI11 object to add parameter to. |
Definition at line 33 of file add_to_cli11.hpp.
References ParamData::desc, ParamData::value, and ParamData::wasPassed.
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.
cliName | The name of the option to add to CLI11. |
param | an object of util::ParamData. |
app | a CLI11 object to add parameter to. |
Definition at line 65 of file add_to_cli11.hpp.
References ParamData::desc, ParamData::value, and ParamData::wasPassed.
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.
cliName | The name of the option to add to CLI11. |
param | an object of util::ParamData. |
app | a CLI11 object to add parameter to. |
Definition at line 97 of file add_to_cli11.hpp.
References ParamData::desc, ParamData::value, and ParamData::wasPassed.
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.
cliName | The name of the option to add to CLI11. |
param | an object of util::ParamData. |
app | a CLI11 object to add parameter to. |
Definition at line 127 of file add_to_cli11.hpp.
References ParamData::desc, ParamData::value, and ParamData::wasPassed.
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.
cliName | The name of the option to add to CLI11. |
param | an object of util::ParamData. |
app | a CLI11 object to add parameter to. |
Definition at line 157 of file add_to_cli11.hpp.
References ParamData::desc, ParamData::value, and ParamData::wasPassed.
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.
param | Parameter data. |
* | (input) Unused void pointer. |
output | Void pointer to options_description object. |
Definition at line 188 of file add_to_cli11.hpp.
References ParamData::alias, and ParamData::name.
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.
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.
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.
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.
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).
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).
void mlpack::bindings::cli::DeleteAllocatedMemory | ( | util::ParamData & | d, |
const void * | , | ||
void * | |||
) |
Definition at line 50 of file delete_allocated_memory.hpp.
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.
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.
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.
|
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.
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.
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.
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.
void mlpack::bindings::cli::GetAllocatedMemory | ( | util::ParamData & | d, |
const void * | , | ||
void * | output | ||
) |
Definition at line 52 of file get_allocated_memory.hpp.
|
inline |
Given the name of a binding, print its command-line name (this returns "mlpack_
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.
d | ParamData object to get parameter value from. |
Definition at line 29 of file get_param.hpp.
References ParamData::value.
T& mlpack::bindings::cli::GetParam | ( | util::ParamData & | d, |
const typename boost::enable_if< arma::is_arma_type< T >>::type * | = 0 |
||
) |
Return a matrix parameter.
d | ParamData 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.
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.
d | ParamData 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.
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.
d | ParamData 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.
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!
d | Parameter information. |
* | (input) Unused parameter. |
output | Place to store pointer to value. |
Definition at line 132 of file get_param.hpp.
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 |
||
) |
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.
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).
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.
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.
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.
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).
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).
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).
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.
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.
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).
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).
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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!
d | Parameter information. |
* | (input) Unused parameter. |
output | Place to store pointer to value. |
Definition at line 80 of file get_raw_param.hpp.
|
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.
void mlpack::bindings::cli::InPlaceCopy | ( | util::ParamData & | d, |
const void * | input, | ||
void * | |||
) |
Make the given ParamData be an in-place copy of the input.
d | Parameter information. |
input | Input 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.
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.
* | (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.
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.
d | ParamData object we want to make into an in-place copy. |
input | ParamData object whose filename we should copy. |
Definition at line 50 of file in_place_copy.hpp.
References ParamData::value.
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().
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.
void mlpack::bindings::cli::MapParameterName | ( | util::ParamData & | d, |
const void * | , | ||
void * | output | ||
) |
Map the parameter name to the name seen by CLI.
d | Parameter data. |
* | (input) Unused parameter. |
output | Pointer to std::string that will hold the mapped name. |
Definition at line 63 of file map_parameter_name.hpp.
References ParamData::name.
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.
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).
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).
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).
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).
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.
mlpack::bindings::cli::PARAM_FLAG | ( | "help" | , |
"Default help info." | , | ||
"h" | |||
) |
mlpack::bindings::cli::PARAM_FLAG | ( | "verbose" | , |
"Display informational messages and the full list of " "parameters and timers at the end of execution." | , | ||
"v" | |||
) |
mlpack::bindings::cli::PARAM_FLAG | ( | "version" | , |
"Display the version of mlpack." | , | ||
"V" | |||
) |
mlpack::bindings::cli::PARAM_STRING_IN | ( | "info" | , |
"Print help on a specific option." | , | ||
"" | , | ||
"" | |||
) |
|
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.)
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.
|
inline |
Print a dataset type parameter (add .csv and return).
|
inline |
Given a parameter name, print its corresponding default value.
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.
param | Parameter name to print help for. |
Referenced by ParseCommandLine().
|
inline |
Print any imports for CLI (there are none, so this returns an empty string).
|
inline |
Print any special information about input options.
|
inline |
Print a model type parameter (add .bin and return).
|
inline |
Print any special information about output options.
|
inline |
Print the type of a parameter that a user would specify from the command-line.
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.
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.
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.
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.
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.
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.
|
inline |
Print documentation for each of the types.
|
inline |
Given a parameter type, print the corresponding value.
|
inline |
Base case for recursion.
std::string mlpack::bindings::cli::ProcessOptions | ( | const std::string & | paramName, |
const T & | value, | ||
Args... | args | ||
) |
Print an option for a command-line argument.
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.
|
inline |
Given a program name, print a program call invocation assuming that all options are specified.
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.
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.
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.
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.
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!
d | Parameter information. |
input | Unused parameter. |
* | (output) Place to store pointer to value. |
Definition at line 97 of file set_param.hpp.
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 >().
|
inline |
Return "bool".
Referenced by StringTypeParam().
|
inline |
Return "double".
Referenced by StringTypeParam().
|
inline |
Return "int".
Referenced by StringTypeParam().
|
inline |
Return "string".
|
inline |
Return "string";.
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.
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.
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,.