14 #ifndef MLPACK_CORE_UTIL_CLI_HPP 15 #define MLPACK_CORE_UTIL_CLI_HPP 22 #include <boost/any.hpp> 23 #include <boost/program_options.hpp> 38 namespace po = boost::program_options;
190 static void Add(
const T& defaultValue,
193 const char alias =
'\0',
194 const bool required =
false,
195 const bool input =
true,
196 const bool noTranspose =
false);
203 static void Destroy();
237 static T& GetRawParam(
const std::string& identifier);
251 static CLI& GetSingleton();
258 static bool HasParam(
const std::string& identifier);
275 static void ParseCommandLine(
int argc,
char** argv);
281 static void PrintHelp(
const std::string& param =
"");
350 static char AliasReverseLookup(
const std::string& value);
394 #include "cli_impl.hpp"
Linear algebra utility functions, generally performed on matrices or vectors.
std::list< std::string > requiredOptions
Convenience list of required options.
The core includes that mlpack expects; standard C++ includes and Armadillo.
po::variables_map vmap
Values of the options given by user.
std::map< std::string, util::ParamData > parameters
Map of parameters.
Timers timer
Holds the timer objects.
util::ProgramDoc * doc
Pointer to the ProgramDoc object.
po::options_description desc
The documentation and names of options.
The timer class provides a way for mlpack methods to be timed.
Metaprogramming structure for vector detection.
std::list< std::string > outputOptions
Convenience list of output options.
std::string programName
Holds the name of the program for –version.
ParameterTypeDeducer< data::HasSerialize< T >::value, T >::type type
std::map< char, std::string > aliases
Convenience map from alias values to names.
static CLI * singleton
The singleton itself.
bool didParse
True, if CLI was used to parse command line options.
test cpp RESULT_VARIABLE MEX_RESULT_TRASH OUTPUT_VARIABLE MEX_OUTPUT ERROR_VARIABLE MEX_ERROR_TRASH string(REGEX MATCH"Warning: You are using"MEX_WARNING"${MEX_OUTPUT}") if(MEX_WARNING) string(REGEX REPLACE".*using [a-zA-Z]* version \"([0-9.]*)[^\"]*\".*""\\1"OTHER_COMPILER_VERSION"$
A static object whose constructor registers program documentation with the CLI class.
Parses the command line for parameters and holds user-specified parameters.
typename enable_if< B, T >::type enable_if_t