parameter_type.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_CLI_PARAMETER_TYPE_HPP
14 #define MLPACK_BINDINGS_CLI_PARAMETER_TYPE_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 namespace bindings {
20 namespace cli {
21 
22 // Default: HasSerialize = false.
23 template<bool HasSerialize, typename T>
25 {
26  typedef T type;
27 };
28 
29 // If we have a serialize() function, then the type is a string.
30 template<typename T>
31 struct ParameterTypeDeducer<true, T>
32 {
33  typedef std::string type;
34 };
35 
41 template<typename T>
43 {
46 };
47 
53 template<typename eT>
54 struct ParameterType<arma::Col<eT>>
55 {
56  typedef std::tuple<std::string, size_t, size_t> type;
57 };
58 
65 template<typename eT>
66 struct ParameterType<arma::Row<eT>>
67 {
68  typedef std::tuple<std::string, size_t, size_t> type;
69 };
70 
76 template<typename eT>
77 struct ParameterType<arma::Mat<eT>>
78 {
79  typedef std::tuple<std::string, size_t, size_t> type;
80 };
81 
85 template<typename eT, typename PolicyType>
86 struct ParameterType<std::tuple<mlpack::data::DatasetMapper<PolicyType,
87  std::string>, arma::Mat<eT>>>
88 {
89  typedef std::tuple<std::string, size_t, size_t> type;
90 };
91 
92 } // namespace cli
93 } // namespace bindings
94 } // namespace mlpack
95 
96 #endif
std::tuple< std::string, size_t, size_t > type
ParameterTypeDeducer< data::HasSerialize< T >::value, T >::type type
std::tuple< std::string, size_t, size_t > type
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
std::tuple< std::string, size_t, size_t > type
Utility struct to return the type that CLI11 should accept for a given input type.