12 #ifndef MLPACK_BINDINGS_CLI_DEFAULT_PARAM_IMPL_HPP 13 #define MLPACK_BINDINGS_CLI_DEFAULT_PARAM_IMPL_HPP 27 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* ,
30 const typename std::enable_if<!std::is_same<T,
31 std::string>::value>::type*,
32 const typename std::enable_if<!std::is_same<T,
33 std::tuple<mlpack::data::DatasetInfo, arma::mat>>::value>::type* )
35 std::ostringstream oss;
36 if (!std::is_same<T, bool>::value)
37 oss << boost::any_cast<T>(data.
value);
51 std::ostringstream oss;
52 const T& vector = boost::any_cast<T>(data.
value);
54 if (std::is_same<T, std::vector<std::string>>::value)
56 if (vector.size() > 0)
58 for (
size_t i = 0; i < vector.size() - 1; ++i)
60 oss <<
"'" << vector[i] <<
"', ";
63 oss <<
"'" << vector[vector.size() - 1] <<
"'";
70 if (vector.size() > 0)
72 for (
size_t i = 0; i < vector.size() - 1; ++i)
74 oss << vector[i] <<
", ";
77 oss << vector[vector.size() - 1];
92 const typename std::enable_if<std::is_same<T, std::string>::value>::type*)
94 const std::string& s = *boost::any_cast<std::string>(&data.
value);
104 const typename std::enable_if<
105 arma::is_arma_type<T>::value ||
107 arma::mat>>::value>::type* )
119 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* ,
Auxiliary information for a dataset, including mappings to/from strings (or other types) and the data...
Definition: dataset_mapper.hpp:41
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
std::string DefaultParamImpl(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::string >::value >::type *=0, const typename std::enable_if<!std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value >::type *=0)
Return the default value of an option.
Definition: default_param_impl.hpp:25
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