12 #ifndef MLPACK_CORE_UTIL_OUTPUT_PARAM_IMPL_HPP 13 #define MLPACK_CORE_UTIL_OUTPUT_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::tuple<data::DatasetInfo, arma::mat>>::value>::type* )
33 std::cout << data.
name <<
": " << *boost::any_cast<T>(&data.
value)
43 std::cout << data.
name <<
": ";
44 const T& t = *boost::any_cast<T>(&data.
value);
45 for (
size_t i = 0; i < t.size(); ++i)
46 std::cout << t[i] <<
" ";
47 std::cout << std::endl;
54 const typename std::enable_if<arma::is_arma_type<T>::value>::type* )
56 typedef std::tuple<T, std::tuple<std::string, size_t, size_t>> TupleType;
57 const T& output = std::get<0>(*boost::any_cast<TupleType>(&data.
value));
58 const std::string& filename =
59 std::get<0>(std::get<1>(*boost::any_cast<TupleType>(&data.
value)));
61 if (output.n_elem > 0 && filename !=
"")
63 if (arma::is_Row<T>::value || arma::is_Col<T>::value)
74 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* ,
80 typedef std::tuple<T*, std::string> TupleType;
81 T*& output =
const_cast<T*&
>(std::get<0>(*boost::any_cast<TupleType>(
83 const std::string& filename =
84 std::get<1>(*boost::any_cast<TupleType>(&data.
value));
94 const typename std::enable_if<std::is_same<T,
95 std::tuple<data::DatasetInfo, arma::mat>>::value>::type* )
98 typedef std::tuple<T, std::tuple<std::string, size_t, size_t>> TupleType;
99 const T& tuple = std::get<0>(*boost::any_cast<TupleType>(&data.
value));
100 const std::string& filename =
101 std::get<0>(std::get<1>(*boost::any_cast<TupleType>(&data.
value)));
102 const arma::mat& matrix = std::get<1>(tuple);
Definition: has_serialize.hpp:47
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
bool noTranspose
True if this is a matrix that should not be transposed.
Definition: param_data.hpp:69
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
void OutputParamImpl(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)
Output an option (print to stdout).
Definition: output_param_impl.hpp:25
boost::any value
The actual value that is held.
Definition: param_data.hpp:82
std::string name
Name of this parameter.
Definition: param_data.hpp:56
bool Save(const std::string &filename, const arma::Mat< eT > &matrix, const bool fatal=false, bool transpose=true, arma::file_type inputSaveType=arma::auto_detect)
Saves a matrix to file, guessing the filetype from the extension.
Definition: save_impl.hpp:47