12 #ifndef MLPACK_BINDINGS_PYTHON_PY_OPTION_HPP 13 #define MLPACK_BINDINGS_PYTHON_PY_OPTION_HPP 31 extern std::string programName;
46 const std::string& identifier,
47 const std::string& description,
48 const std::string& alias,
49 const std::string& cppName,
50 const bool required =
false,
51 const bool input =
true,
52 const bool noTranspose =
false,
53 const std::string& =
"")
58 data.
desc = description;
59 data.
name = identifier;
61 data.
alias = alias[0];
69 if (identifier ==
"verbose" || identifier ==
"copy_all_inputs" ||
70 identifier ==
"check_input_matrices")
77 data.
value = boost::any(defaultValue);
80 if (identifier !=
"verbose" && identifier !=
"copy_all_inputs")
89 &GetPrintableParam<T>;
100 &PrintOutputProcessing<T>;
102 &PrintInputProcessing<T>;
109 if (identifier !=
"verbose" && identifier !=
"copy_all_inputs")
char alias
Alias for this parameter.
Definition: param_data.hpp:63
std::string tname
Type information of this parameter.
Definition: param_data.hpp:61
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
bool input
True if this option is an input option (otherwise, it is output).
Definition: param_data.hpp:73
bool persistent
If this should be preserved across different settings (i.e.
Definition: param_data.hpp:79
std::string cppType
The true name of the type, as it would be written in C++.
Definition: param_data.hpp:84
std::string desc
Description of this parameter, if any.
Definition: param_data.hpp:58
bool noTranspose
True if this is a matrix that should not be transposed.
Definition: param_data.hpp:69
static IO & GetSingleton()
Retrieve the singleton.
Definition: io.cpp:147
The Python option class.
Definition: py_option.hpp:37
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
bool loaded
If this is an input parameter that needs extra loading, this indicates whether or not it has been loa...
Definition: param_data.hpp:76
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
#define TYPENAME(x)
The TYPENAME macro is used internally to convert a type into a string.
Definition: param_data.hpp:22
static void StoreSettings(const std::string &name)
Take all parameters and function mappings and store them, under the given name.
Definition: io.cpp:185
boost::any value
The actual value that is held.
Definition: param_data.hpp:82
static void ClearSettings()
Clear all of the settings, removing all parameters and function mappings.
Definition: io.cpp:218
PyOption(const T 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 &="")
Construct a PyOption object.
Definition: py_option.hpp:45
std::string name
Name of this parameter.
Definition: param_data.hpp:56
bool required
True if this option is required.
Definition: param_data.hpp:71
bool wasPassed
True if the option was passed to the program.
Definition: param_data.hpp:66