12 #ifndef MLPACK_CORE_UTIL_IO_IMPL_HPP 13 #define MLPACK_CORE_UTIL_IO_IMPL_HPP 38 identifier.length() == 1 &&
GetSingleton().aliases.count(identifier[0]))
42 Log::Fatal <<
"Parameter --" << key <<
" does not exist in this program!" 49 Log::Fatal <<
"Attempted to access parameter --" << key <<
" as type " 63 return *boost::any_cast<T>(&d.
value);
78 std::string key = ((
GetSingleton().parameters.count(identifier) == 0) &&
79 (identifier.length() == 1) &&
84 Log::Fatal <<
"Parameter --" << key <<
" does not exist in this program!" 91 Log::Fatal <<
"Attempted to access parameter --" << key <<
" as type " 105 std::ostringstream oss;
106 oss <<
"no GetPrintableParam function handler registered for type " 108 throw std::runtime_error(oss.str());
118 identifier.length() == 1 &&
GetSingleton().aliases.count(identifier[0]))
122 Log::Fatal <<
"Parameter --" << key <<
" does not exist in this program!" 129 Log::Fatal <<
"Attempted to access parameter --" << key <<
" as type " 130 <<
TYPENAME(T) <<
", but its true type is " << d.
tname <<
"!" 144 return GetParam<T>(identifier);
151 std::string errMsg1 =
"The input " + identifier +
" has NaN values.";
152 std::string errMsg2 =
"The input " + identifier +
" has inf values.";
154 if (matrix.has_nan())
156 if (matrix.has_inf())
std::string tname
Type information of this parameter.
Definition: param_data.hpp:61
static MLPACK_EXPORT util::PrefixedOutStream Fatal
Prints fatal messages prefixed with [FATAL], then terminates the program.
Definition: log.hpp:90
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
std::string cppType
The true name of the type, as it would be written in C++.
Definition: param_data.hpp:84
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
static void CheckInputMatrix(const T &matrix, const std::string &identifier)
Utility function for CheckInputMatrices().
Definition: io_impl.hpp:149
#define TYPENAME(x)
The TYPENAME macro is used internally to convert a type into a string.
Definition: param_data.hpp:22
boost::any value
The actual value that is held.
Definition: param_data.hpp:82