13 #ifndef MLPACK_CORE_BINDINGS_TESTS_TEST_OPTION_HPP 14 #define MLPACK_CORE_BINDINGS_TESTS_TEST_OPTION_HPP 63 const std::string& identifier,
64 const std::string& description,
65 const std::string& alias,
66 const std::string& cppName,
67 const bool required =
false,
68 const bool input =
true,
69 const bool noTranspose =
false,
70 const std::string& bindingName =
"")
75 data.
desc = description;
76 data.
name = identifier;
78 data.
alias = alias[0];
86 data.
value = boost::any(defaultValue);
88 const std::string tname = data.
tname;
95 &GetPrintableParam<N>);
98 &GetAllocatedMemory<N>);
100 &DeleteAllocatedMemory<N>);
boost::any value
The actual value that is held.
Linear algebra utility functions, generally performed on matrices or vectors.
bool wasPassed
True if the option was passed to the program.
std::string desc
Description of this parameter, if any.
bool input
True if this option is an input option (otherwise, it is output).
This structure holds all of the information about a single parameter, including its value (which is s...
bool loaded
If this is an input parameter that needs extra loading, this indicates whether or not it has been loa...
#define TYPENAME(x)
The TYPENAME macro is used internally to convert a type into a string.
static void RegisterFunction(const std::string &tname, const std::string &functionName, void(*func)(util::ParamData &, const void *, void *))
Register the function func for the given typename tname and the given function name functionName...
char alias
Alias for this parameter.
std::string tname
Type information of this parameter.
std::string name
Name of this parameter.
bool required
True if this option is required.
static void AddParameter(const std::string &bindingName, util::ParamData &&d)
Adds a parameter to the hierarchy; use the PARAM_*() macros instead of this (i.e. ...
TestOption(const N defaultValue, const std::string &identifier, const std::string &description, const std::string &alias, const std::string &cppName, const bool required=false, const bool input=true, const bool noTranspose=false, const std::string &bindingName="")
Construct an Option object.
A static object whose constructor registers a parameter with the IO class.
std::string cppType
The true name of the type, as it would be written in C++.
bool noTranspose
True if this is a matrix that should not be transposed.