13 #ifndef MLPACK_CORE_UTIL_IO_HPP 14 #define MLPACK_CORE_UTIL_IO_HPP 21 #include <boost/any.hpp> 188 static bool HasParam(
const std::string& identifier);
197 static T&
GetParam(
const std::string& identifier);
220 static T&
GetRawParam(
const std::string& identifier);
229 static void CheckInputMatrix(
const T& matrix,
const std::string& identifier);
241 const std::string& inputParamName);
257 static std::map<std::string, util::ParamData>&
Parameters();
259 static std::map<char, std::string>&
Aliases();
269 static void SetPassed(
const std::string& name);
290 static void RestoreSettings(
const std::string& name,
const bool fatal =
true);
304 std::map<char, std::string> aliases;
306 std::map<std::string, util::ParamData> parameters;
311 typedef std::map<std::string, std::map<std::string,
317 std::map<std::string, std::tuple<std::map<std::string, util::ParamData>,
345 IO& operator=(
const IO& other);
Timers timer
Holds the timer objects.
Definition: io.hpp:329
static bool HasParam(const std::string &identifier)
See if the specified flag was found while parsing.
Definition: io.cpp:85
static void Add(util::ParamData &&d)
Adds a parameter to the hierarchy; use the PARAM_*() macros instead of this (i.e. ...
Definition: io.cpp:36
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
static std::map< char, std::string > & Aliases()
Return a modifiable list of aliases that IO knows about.
Definition: io.cpp:160
The core includes that mlpack expects; standard C++ includes and Armadillo.
static void SetPassed(const std::string &name)
Mark a particular parameter as passed.
Definition: io.cpp:172
static void CheckInputMatrices()
Checks all input matrices for NaN and inf values, exits if found any.
Definition: io.cpp:271
Definition: timers.hpp:98
static T & GetRawParam(const std::string &identifier)
Get the raw value of the parameter before any processing that GetParam() might normally do...
Definition: io_impl.hpp:113
static std::string GetPrintableParam(const std::string &identifier)
Cast the given parameter of the given type to a short, printable std::string, for use in status messa...
Definition: io_impl.hpp:75
static IO & GetSingleton()
Retrieve the singleton.
Definition: io.cpp:147
static T & GetParam(const std::string &identifier)
Get the value of type T found while parsing.
Definition: io_impl.hpp:33
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
std::string programName
Holds the name of the program for –version.
Definition: io.hpp:326
Parses the command line for parameters and holds user-specified parameters.
Definition: io.hpp:172
static void RestoreSettings(const std::string &name, const bool fatal=true)
Restore all of the parameters and function mappings of the given name, if they exist.
Definition: io.cpp:197
util::BindingDetails doc
Holds the bindingDetails objects.
Definition: io.hpp:335
static void CheckInputMatrix(const T &matrix, const std::string &identifier)
Utility function for CheckInputMatrices().
Definition: io_impl.hpp:149
The timer class provides a way for mlpack methods to be timed.
Definition: timers.hpp:46
static void MakeInPlaceCopy(const std::string &outputParamName, const std::string &inputParamName)
Given two (matrix) parameters, ensure that the first is an in-place copy of the second.
Definition: io.cpp:118
static void StoreSettings(const std::string &name)
Take all parameters and function mappings and store them, under the given name.
Definition: io.cpp:185
static std::map< std::string, util::ParamData > & Parameters()
Return a modifiable list of parameters that IO knows about.
Definition: io.cpp:154
static std::string ProgramName()
Get the program name as set by the BINDING_NAME() macro.
Definition: io.cpp:166
std::map< std::string, std::map< std::string, void(*)(util::ParamData &, const void *, void *)> > FunctionMapType
Map for functions and types.
Definition: io.hpp:312
bool didParse
True, if IO was used to parse command line options.
Definition: io.hpp:322
static void ClearSettings()
Clear all of the settings, removing all parameters and function mappings.
Definition: io.cpp:218
This structure holds all of the information about bindings documentation.
Definition: binding_details.hpp:24