Classes | |
class | CLIOption |
A static object whose constructor registers a parameter with the CLI class. More... | |
struct | ParameterType |
Utility struct to return the type that boost::program_options should accept for a given input type. More... | |
struct | ParameterType< arma::Col< eT > > |
For vector types, boost::program_options 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, boost::program_options 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, boost::program_options 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 > |
class | ProgramDoc |
A static object whose constructor registers program documentation with the CLI class. More... | |
Functions | |
template < typename T > | |
void | AddToPO (const std::string &boostName, const std::string &descr, boost::program_options::options_description &desc, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< std::is_same< T, bool >>::type *=0) |
Add a non-vector option to boost::program_options. More... | |
template < typename T > | |
void | AddToPO (const std::string &boostName, const std::string &descr, boost::program_options::options_description &desc, const typename boost::enable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< std::is_same< T, bool >>::type *=0) |
Add a vector option to boost::program_options. More... | |
template < typename T > | |
void | AddToPO (const std::string &boostName, const std::string &descr, boost::program_options::options_description &desc, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::enable_if< std::is_same< T, bool >>::type *=0) |
Add a boolean option to boost::program_options. More... | |
template < typename T > | |
void | AddToPO (const util::ParamData &d, const void *, void *output) |
Add an option to boost::program_options. More... | |
template < typename T > | |
void | DefaultParam (const util::ParamData &data, const void *, void *output) |
Return the default value of an option. More... | |
template < typename T > | |
std::string | DefaultParamImpl (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::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 (const 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 (const 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 (const 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 (const 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 (const util::ParamData &d, const void *, void *) |
template < typename T > | |
void | DeleteAllocatedMemoryImpl (const 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 (const util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0) |
template < typename T > | |
void | DeleteAllocatedMemoryImpl (const 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 (const 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 (const util::ParamData &, const typename boost::enable_if< arma::is_arma_type< T >>::type *=0) |
template < typename T > | |
void * | GetAllocatedMemory (const 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 (const 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 (const util::ParamData &d, const void *, void *output) |
Return a parameter casted to the given type. More... | |
template < typename T > | |
std::string | GetPrintableParam (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0) |
Print an option. More... | |
template < typename T > | |
std::string | GetPrintableParam (const 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 (const 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 (const 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 (const util::ParamData &data, const void *, void *output) |
Print an option into a std::string. More... | |
template < typename T > | |
std::string | GetPrintableParamName (const 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 (const 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 (const 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 (const 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 (const util::ParamData &d, const void *, void *output) |
Get the parameter's name as seen by the user. More... | |
template < typename T > | |
std::string | GetPrintableParamValue (const 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 (const 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 (const 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 (const 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 (const 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 (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0) |
Return a string representing the command-line type of an option. More... | |
template < typename T > | |
std::string | GetPrintableType (const 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 (const 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 (const 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 (const 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 (const 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 (const 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 > | |
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 boost::program_options. 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 boost::program_options. More... | |
template < typename T > | |
void | MapParameterName (const util::ParamData &d, const void *, void *output) |
Map the parameter name to the name seen by boost::program_options. More... | |
template < typename T > | |
void | OutputParam (const util::ParamData &data, const void *, void *) |
Output an option. More... | |
template < typename T > | |
void | OutputParamImpl (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0) |
Output an option (print to stdout). More... | |
template < typename T > | |
void | OutputParamImpl (const 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 (const 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 (const 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 (const 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 | 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 (const util::ParamData ¶m) |
Print the type of a parameter that a user would specify from the command-line. More... | |
template < typename T > | |
std::string | PrintTypeDoc (const util::ParamData &data, const typename boost::disable_if< arma::is_arma_type< T >>::type *=0, const typename boost::disable_if< util::IsStdVector< T >>::type *=0, const typename boost::disable_if< data::HasSerialize< T >>::type *=0, const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type *=0) |
Return a string representing the command-line type of an option. More... | |
template < typename T > | |
std::string | PrintTypeDoc (const 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 (const 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 (const 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 (const 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 (const 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 ¶mName, 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 (const util::ParamData &d, const void *input, void *) |
Return a parameter casted to the given type. More... | |
template < typename T > | |
void | StringTypeParam (const util::ParamData &, const void *, void *output) |
Return a string containing the type of a parameter. More... | |
template < > | |
void | StringTypeParam< bool > (const util::ParamData &, const void *, void *output) |
Return "bool". More... | |
template < > | |
void | StringTypeParam< double > (const util::ParamData &, const void *, void *output) |
Return "double". More... | |
template < > | |
void | StringTypeParam< int > (const util::ParamData &, const void *, void *output) |
Return "int". More... | |
template < > | |
void | StringTypeParam< std::string > (const util::ParamData &, const void *, void *output) |
Return "string". More... | |
template < > | |
void | StringTypeParam< std::tuple< mlpack::data::DatasetInfo, arma::mat > > (const 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... | |
void mlpack::bindings::cli::AddToPO | ( | const std::string & | boostName, |
const std::string & | descr, | ||
boost::program_options::options_description & | desc, | ||
const typename boost::disable_if< util::IsStdVector< T >>::type * | = 0 , |
||
const typename boost::disable_if< std::is_same< T, bool >>::type * | = 0 |
||
) |
Add a non-vector option to boost::program_options.
boostName | The name of the option to add to boost::program_options. |
descr | Description string for parameter. |
desc | Options description to add parameter to. |
Definition at line 33 of file add_to_po.hpp.
void mlpack::bindings::cli::AddToPO | ( | const std::string & | boostName, |
const std::string & | descr, | ||
boost::program_options::options_description & | desc, | ||
const typename boost::enable_if< util::IsStdVector< T >>::type * | = 0 , |
||
const typename boost::disable_if< std::is_same< T, bool >>::type * | = 0 |
||
) |
Add a vector option to boost::program_options.
This overload will use the multitoken() option.
boostName | The name of the option to add to boost::program_options. |
descr | Description string for parameter. |
desc | Options description to add parameter to. |
Definition at line 52 of file add_to_po.hpp.
void mlpack::bindings::cli::AddToPO | ( | const std::string & | boostName, |
const std::string & | descr, | ||
boost::program_options::options_description & | desc, | ||
const typename boost::disable_if< util::IsStdVector< T >>::type * | = 0 , |
||
const typename boost::enable_if< std::is_same< T, bool >>::type * | = 0 |
||
) |
Add a boolean option to boost::program_options.
boostName | The name of the option to add to boost::program_options. |
descr | Description string for parameter. |
desc | Options description to add parameter to. |
Definition at line 70 of file add_to_po.hpp.
void mlpack::bindings::cli::AddToPO | ( | const util::ParamData & | d, |
const void * | , | ||
void * | output | ||
) |
Add an option to boost::program_options.
This is the function meant to be used in the CLI function map.
d | Parameter data. |
input | Unused void pointer. |
output | Void pointer to options_description object. |
Definition at line 88 of file add_to_po.hpp.
References ParamData::alias, ParamData::desc, and ParamData::name.
void mlpack::bindings::cli::DefaultParam | ( | const 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 | ( | const util::ParamData & | data, |
const typename boost::disable_if< arma::is_arma_type< T >>::type * | = 0 , |
||
const typename boost::disable_if< util::IsStdVector< T >>::type * | = 0 , |
||
const typename boost::disable_if< data::HasSerialize< T >>::type * | = 0 , |
||
const typename boost::disable_if< std::is_same< T, std::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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const util::ParamData & | d, |
const void * | , | ||
void * | |||
) |
Definition at line 50 of file delete_allocated_memory.hpp.
void mlpack::bindings::cli::DeleteAllocatedMemoryImpl | ( | const 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 | ( | const 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 | ( | const 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 CLI::functionMap, Timers::GetAllTimers(), CLI::GetSingleton(), CLI::HasParam(), Log::Info, ParamData::input, CLI::Parameters(), Timers::PrintTimer(), Timers::StopAllTimers(), CLI::timer, and ParamData::tname.
void* mlpack::bindings::cli::GetAllocatedMemory | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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_<bindingName>".
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 | ( | const 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 | ( | const util::ParamData & | data, |
const typename boost::disable_if< arma::is_arma_type< T >>::type * | = 0 , |
||
const typename boost::disable_if< util::IsStdVector< T >>::type * | = 0 , |
||
const typename boost::disable_if< data::HasSerialize< T >>::type * | = 0 , |
||
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type * | = 0 |
||
) |
std::string mlpack::bindings::cli::GetPrintableParam | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const util::ParamData & | data, |
const typename boost::disable_if< arma::is_arma_type< T >>::type * | = 0 , |
||
const typename boost::disable_if< util::IsStdVector< T >>::type * | = 0 , |
||
const typename boost::disable_if< data::HasSerialize< T >>::type * | = 0 , |
||
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type * | = 0 |
||
) |
Return a string representing the command-line type of an option.
std::string mlpack::bindings::cli::GetPrintableType | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 111 of file print_doc_functions.hpp.
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 boost::program_options.
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 boost::program_options.
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 | ( | const util::ParamData & | d, |
const void * | , | ||
void * | output | ||
) |
Map the parameter name to the name seen by boost::program_options.
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 | ( | const util::ParamData & | data, |
const void * | , | ||
void * | |||
) |
Output an option.
This is the function that will be called by the CLI module.
Definition at line 74 of file output_param.hpp.
void mlpack::bindings::cli::OutputParamImpl | ( | const util::ParamData & | data, |
const typename boost::disable_if< arma::is_arma_type< T >>::type * | = 0 , |
||
const typename boost::disable_if< util::IsStdVector< T >>::type * | = 0 , |
||
const typename boost::disable_if< data::HasSerialize< T >>::type * | = 0 , |
||
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type * | = 0 |
||
) |
Output an option (print to stdout).
void mlpack::bindings::cli::OutputParamImpl | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 ProgramInfo is structured, this doesn't mean that all of the PARAM_*() declarataions need to come before the PROGRAM_INFO() 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 35 of file parse_command_line.hpp.
References Log::Debug, CLI::didParse, Log::Fatal, CLI::functionMap, CLI::GetSingleton(), mlpack::util::GetVersion(), CLI::HasParam(), PrefixedOutStream::ignoreInput, Log::Info, ParamData::name, CLI::Parameters(), PrintHelp(), CLI::ProgramName(), ParamData::required, ParamData::tname, ParamData::value, and ParamData::wasPassed.
|
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 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 | ( | const util::ParamData & | data, |
const typename boost::disable_if< arma::is_arma_type< T >>::type * | = 0 , |
||
const typename boost::disable_if< util::IsStdVector< T >>::type * | = 0 , |
||
const typename boost::disable_if< data::HasSerialize< T >>::type * | = 0 , |
||
const typename boost::disable_if< std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>>::type * | = 0 |
||
) |
Return a string representing the command-line type of an option.
std::string mlpack::bindings::cli::PrintTypeDoc | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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 | ( | const 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,.