get_printable_type.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_CLI_GET_PRINTABLE_TYPE_HPP
14 #define MLPACK_BINDINGS_CLI_GET_PRINTABLE_TYPE_HPP
15 
16 namespace mlpack {
17 namespace bindings {
18 namespace cli {
19 
23 template<typename T>
24 std::string GetPrintableType(
25  util::ParamData& data,
26  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
27  const typename std::enable_if<!util::IsStdVector<T>::value>::type* = 0,
28  const typename std::enable_if<!data::HasSerialize<T>::value>::type* = 0,
29  const typename std::enable_if<!std::is_same<T,
30  std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0);
31 
35 template<typename T>
36 std::string GetPrintableType(
37  util::ParamData& data,
38  const typename std::enable_if<util::IsStdVector<T>::value>::type* = 0);
39 
43 template<typename T>
44 std::string GetPrintableType(
45  util::ParamData& data,
46  const typename std::enable_if<arma::is_arma_type<T>::value>::type* = 0);
47 
51 template<typename T>
52 std::string GetPrintableType(
53  util::ParamData& data,
54  const typename std::enable_if<std::is_same<T,
55  std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0);
56 
60 template<typename T>
61 std::string GetPrintableType(
62  util::ParamData& data,
63  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
64  const typename std::enable_if<data::HasSerialize<T>::value>::type* = 0);
65 
69 template<typename T>
71  const void* /* input */,
72  void* output)
73 {
74  *((std::string*) output) =
75  GetPrintableType<typename std::remove_pointer<T>::type>(data);
76 }
77 
78 } // namespace cli
79 } // namespace bindings
80 } // namespace mlpack
81 
82 #include "get_printable_type_impl.hpp"
83 
84 #endif
static const bool value
Linear algebra utility functions, generally performed on matrices or vectors.
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
std::string GetPrintableType(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)
Return a string representing the command-line type of an option.