13 #ifndef MLPACK_BINDINGS_CLI_END_PROGRAM_HPP 14 #define MLPACK_BINDINGS_CLI_END_PROGRAM_HPP 32 std::map<std::string, util::ParamData>& parameters = params.
Parameters();
33 for (
auto& it : parameters)
40 if (params.
Has(
"verbose"))
42 Log::Info << std::endl <<
"Execution parameters:" << std::endl;
45 for (
auto& it : parameters)
55 std::string printableParam;
57 (
void*) &printableParam);
61 Log::Info <<
"Program timers:" << std::endl;
64 std::map<std::string, std::chrono::microseconds> timerMap =
66 std::map<std::string, std::chrono::microseconds> globalTimerMap =
68 for (
auto& it : globalTimerMap)
70 if (timerMap.count(it.first) == 1)
71 timerMap[it.first] += it.second;
73 timerMap[it.first] = it.second;
76 for (
auto& it2 : timerMap)
85 std::unordered_map<void*, util::ParamData*> memoryAddresses;
86 for (
auto& it : parameters)
93 if (result != NULL && memoryAddresses.count(result) == 0)
94 memoryAddresses[result] = &data;
98 std::unordered_map<void*, util::ParamData*>::const_iterator it2;
99 it2 = memoryAddresses.begin();
100 while (it2 != memoryAddresses.end())
Linear algebra utility functions, generally performed on matrices or vectors.
static std::map< std::string, std::chrono::microseconds > GetAllTimers()
Returns a copy of all the timers used via this interface.
static std::string Print(const std::chrono::microseconds &totalDuration)
Prints the specified timer.
void StopAllTimers()
Stop all timers.
bool input
True if this option is an input option (otherwise, it is output).
static MLPACK_EXPORT util::PrefixedOutStream Info
Prints informational messages if –verbose is specified, prefixed with [INFO ].
std::map< std::string, ParamData > & Parameters()
Get the map of parameters.
This structure holds all of the information about a single parameter, including its value (which is s...
bool Has(const std::string &identifier) const
Return true if the specified parameter was given.
std::string tname
Type information of this parameter.
std::map< std::string, std::chrono::microseconds > GetAllTimers()
Returns a copy of all the timers used via this interface.
FunctionMapType functionMap
Map for functions and types.
void EndProgram(util::Params ¶ms, util::Timers &timers)
Handle command-line program termination.
The Params class holds all information about the parameters passed to a specific binding.