12 #ifndef MLPACK_BINDINGS_CLI_GET_PRINTABLE_PARAM_IMPL_HPP 13 #define MLPACK_BINDINGS_CLI_GET_PRINTABLE_PARAM_IMPL_HPP 26 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* ,
29 const typename std::enable_if<!std::is_same<T,
30 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* )
32 std::ostringstream oss;
33 oss << boost::any_cast<T>(data.
value);
44 const T& t = boost::any_cast<T>(data.
value);
46 std::ostringstream oss;
47 for (
size_t i = 0; i < t.size(); ++i)
54 std::string GetMatrixSize(
56 const typename std::enable_if<arma::is_arma_type<T>::value>::type* = 0)
58 std::ostringstream oss;
59 oss << matrix.n_rows <<
"x" << matrix.n_cols <<
" matrix";
65 std::string GetMatrixSize(
67 const typename std::enable_if<std::is_same<T,
68 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
70 return GetMatrixSize(std::get<1>(matrixAndInfo));
77 const typename std::enable_if<arma::is_arma_type<T>::value ||
79 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* )
82 typedef std::tuple<T, typename ParameterType<T>::type> TupleType;
83 const TupleType* tuple = boost::any_cast<TupleType>(&data.
value);
85 std::ostringstream oss;
86 oss <<
"'" << std::get<0>(std::get<1>(*tuple)) <<
"'";
88 if (std::get<0>(std::get<1>(*tuple)) !=
"")
92 std::string matDescription =
93 std::to_string(std::get<2>(std::get<1>(*tuple))) +
"x" +
94 std::to_string(std::get<1>(std::get<1>(*tuple))) +
" matrix";
96 oss <<
" (" << matDescription <<
")";
106 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* ,
110 typedef std::tuple<T*, typename ParameterType<T>::type> TupleType;
111 const TupleType* tuple = boost::any_cast<TupleType>(&data.
value);
113 std::ostringstream oss;
114 oss << std::get<1>(*tuple);
Definition: has_serialize.hpp:47
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:52
Metaprogramming structure for vector detection.
Definition: is_std_vector.hpp:23
boost::any value
The actual value that is held.
Definition: param_data.hpp:82
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.
Definition: get_printable_param_impl.hpp:24