print_output_processing.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_R_PRINT_OUTPUT_PROCESSING_HPP
14 #define MLPACK_BINDINGS_R_PRINT_OUTPUT_PROCESSING_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 #include "get_type.hpp"
18 
19 namespace mlpack {
20 namespace bindings {
21 namespace r {
22 
26 template<typename T>
28  util::ParamData& d,
29  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
30  const typename std::enable_if<!data::HasSerialize<T>::value>::type* = 0,
31  const typename std::enable_if<!std::is_same<T,
32  std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
33 {
41  MLPACK_COUT_STREAM << " \"" << d.name << "\" = GetParam" << GetType<T>(d)
42  << "(p, \"" << d.name << "\")";
43 }
44 
48 template<typename T>
50  util::ParamData& d,
51  const typename std::enable_if<arma::is_arma_type<T>::value>::type* = 0,
52  const typename std::enable_if<!std::is_same<T,
53  std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
54 {
62  MLPACK_COUT_STREAM << " \"" << d.name << "\" = GetParam" << GetType<T>(d)
63  << "(p, \"" << d.name << "\")";
64 }
65 
69 template<typename T>
71  util::ParamData& d,
72  const typename std::enable_if<std::is_same<T,
73  std::tuple<data::DatasetInfo, arma::mat>>::value>::type* = 0)
74 {
82  MLPACK_COUT_STREAM << " \"" << d.name << "\" = GetParam" << GetType<T>(d)
83  << "(p, \"" << d.name << "\")";
84 }
85 
89 template<typename T>
91  util::ParamData& d,
92  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
93  const typename std::enable_if<data::HasSerialize<T>::value>::type* = 0)
94 {
102  MLPACK_COUT_STREAM << " \"" << d.name << "\" = " << d.name;
103 }
104 
110 template<typename T>
112  const void* /*input*/,
113  void* /* output */)
114 {
115  PrintOutputProcessing<typename std::remove_pointer<T>::type>(d);
116 }
117 
118 } // namespace r
119 } // namespace bindings
120 } // namespace mlpack
121 
122 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:51
void PrintOutputProcessing(util::ParamData &d, const typename std::enable_if<!arma::is_arma_type< 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 output processing for a regular parameter type.
#define MLPACK_COUT_STREAM
Definition: prereqs.hpp:45
std::string name
Name of this parameter.
Definition: param_data.hpp:55