13 #ifndef MLPACK_BINDINGS_PYTHON_CYTHON_CLI_UTIL_HPP
14 #define MLPACK_BINDINGS_PYTHON_CYTHON_CLI_UTIL_HPP
34 CLI::GetParam<T>(identifier) = std::move(value);
52 CLI::GetParam<T*>(identifier) = copy ?
new T(*value) : value;
63 typedef typename std::tuple<data::DatasetInfo, T> TupleType;
64 typedef typename T::elem_type eT;
67 const size_t dimensions = matrix.n_rows;
68 std::get<1>(CLI::GetParam<TupleType>(identifier)) = std::move(matrix);
72 bool hasCategoricals =
false;
73 for (
size_t i = 0; i < dimensions; ++i)
78 hasCategoricals =
true;
85 arma::vec maxs = arma::max(
86 std::get<1>(CLI::GetParam<TupleType>(identifier)), 1);
88 for (
size_t i = 0; i < dimensions; ++i)
93 for (
size_t j = 0; j < (size_t) maxs[i]; ++j)
95 std::ostringstream oss;
111 return CLI::GetParam<T*>(paramName);
121 typedef std::tuple<data::DatasetInfo, T> TupleType;
122 return std::get<1>(CLI::GetParam<TupleType>(paramName));
T MapString(const InputType &input, const size_t dimension)
Given the input and the dimension to which it belongs, return its numeric mapping.
bool backtrace
If true, on a fatal error, a backtrace will be printed if HAS_BFD_DL is defined.
Auxiliary information for a dataset, including mappings to/from strings (or other types) and the data...
void ResetTimers()
Reset the status of all timers.
static CLI & GetSingleton()
Retrieve the singleton.
void SetParamPtr(const std::string &identifier, T *value)
Set the parameter to the given value, given that the type is a pointer.
Datatype Type(const size_t dimension) const
Return the type of a given dimension (numeric or categorical).
void DisableVerbose()
Turn verbose output off.
Timers timer
Holds the timer objects.
bool ignoreInput
Discards input, prints nothing if true.
void DisableBacktrace()
Disable backtraces.
static MLPACK_EXPORT util::PrefixedOutStream Fatal
Prints fatal messages prefixed with [FATAL], then terminates the program.
void EnableTimers()
Enable timing.
static MLPACK_EXPORT util::PrefixedOutStream Info
Prints informational messages if –verbose is specified, prefixed with [INFO ].
T * GetParamPtr(const std::string ¶mName)
Return a pointer.
void SetParam(const std::string &identifier, T &value)
Set the parameter to the given value.
DatasetMapper< data::IncrementPolicy > DatasetInfo
static void EnableTiming()
Enable timing of mlpack programs.
T & GetParamWithInfo(const std::string ¶mName)
Return the matrix part of a matrix + dataset info parameter.
void EnableVerbose()
Turn verbose output on.
void Reset()
Reset the timers.
string(REGEX REPLACE".*#define MLPACK_VERSION_MINOR ([0-9]+).*""\\1"MLPACK_VERSION_MINOR"${VERSION_HPP_CONTENTS}") string(REGEX REPLACE".* "\\1" MLPACK_VERSION_PATCH "$
void SetParamWithInfo(const std::string &identifier, T &matrix, const bool *dims)
Set the parameter (which is a matrix/DatasetInfo tuple) to the given value.