get_printable_param.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_CLI_GET_PRINTABLE_PARAM_HPP
14 #define MLPACK_BINDINGS_CLI_GET_PRINTABLE_PARAM_HPP
15 
16 #include <mlpack/prereqs.hpp>
19 
20 namespace mlpack {
21 namespace bindings {
22 namespace cli {
23 
27 template<typename T>
28 std::string GetPrintableParam(
29  util::ParamData& data,
30  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
31  const typename std::enable_if<!util::IsStdVector<T>::value>::type* = 0,
32  const typename std::enable_if<!data::HasSerialize<T>::value>::type* = 0,
33  const typename std::enable_if<!std::is_same<T,
34  std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0);
35 
39 template<typename T>
40 std::string GetPrintableParam(
41  util::ParamData& data,
42  const typename std::enable_if<util::IsStdVector<T>::value>::type* = 0);
43 
47 template<typename T>
48 std::string GetPrintableParam(
49  util::ParamData& data,
50  const typename std::enable_if<arma::is_arma_type<T>::value ||
51  std::is_same<T,
52  std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0);
53 
57 template<typename T>
58 std::string GetPrintableParam(
59  util::ParamData& data,
60  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
61  const typename std::enable_if<data::HasSerialize<T>::value>::type* = 0);
62 
68 template<typename T>
70  const void* /* input */,
71  void* output)
72 {
73  *((std::string*) output) =
74  GetPrintableParam<typename std::remove_pointer<T>::type>(data);
75 }
76 
77 } // namespace cli
78 } // namespace bindings
79 } // namespace mlpack
80 
81 // Include implementation.
82 #include "get_printable_param_impl.hpp"
83 
84 #endif
static const bool value
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
std::string GetPrintableParam(util::ParamData &data, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if<!util::IsStdVector< T >::value >::type *=0, const typename std::enable_if<!data::HasSerialize< T >::value >::type *=0, const typename std::enable_if<!std::is_same< T, std::tuple< data::DatasetInfo, arma::mat >>::value >::type *=0)
Print an option.
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:51
constexpr auto data(Container const &container) noexcept -> decltype(container.data())
Definition: iterator.hpp:79