mlpack  3.4.2
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::string type;
57 };
58 
65 template<typename eT>
66 struct ParameterType<arma::Row<eT>>
67 {
68  typedef std::string type;
69 };
70 
76 template<typename eT>
77 struct ParameterType<arma::Mat<eT>>
78 {
79  typedef std::string 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::string type;
90 };
91 
92 } // namespace cli
93 } // namespace bindings
94 } // namespace mlpack
95 
96 #endif
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
mlpack::bindings::cli::ParameterType::type
ParameterTypeDeducer< data::HasSerialize< T >::value, T >::type type
Definition: parameter_type.hpp:45
mlpack::bindings::cli::ParameterType< arma::Row< eT > >::type
std::string type
Definition: parameter_type.hpp:68
mlpack::bindings::cli::ParameterType< arma::Mat< eT > >::type
std::string type
Definition: parameter_type.hpp:79
mlpack::bindings::cli::ParameterTypeDeducer::type
T type
Definition: parameter_type.hpp:26
mlpack::bindings::cli::ParameterType< std::tuple< mlpack::data::DatasetMapper< PolicyType, std::string >, arma::Mat< eT > > >::type
std::string type
Definition: parameter_type.hpp:89
mlpack
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: add_to_cli11.hpp:21
mlpack::bindings::cli::ParameterTypeDeducer
Definition: parameter_type.hpp:25
mlpack::bindings::cli::ParameterTypeDeducer< true, T >::type
std::string type
Definition: parameter_type.hpp:33
mlpack::bindings::cli::ParameterType< arma::Col< eT > >::type
std::string type
Definition: parameter_type.hpp:56
std
Definition: prereqs.hpp:67
mlpack::bindings::cli::ParameterType
Utility struct to return the type that CLI11 should accept for a given input type.
Definition: parameter_type.hpp:43