Home
Get Started
Documentation
Community
Google Summer of Code
FAQ
GitHub
Home
Get Started
Documentation
Community
Google Summer of Code
FAQ
GitHub
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>
24
struct
ParameterTypeDeducer
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>
42
struct
ParameterType
43
{
44
typedef
typename
ParameterTypeDeducer<data::HasSerialize<T>::value
, T>
::type
45
type
;
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
mlpack::bindings::cli::ParameterType::type
ParameterTypeDeducer< data::HasSerialize< T >::value, T >::type type
Definition:
parameter_type.hpp:45
mlpack::bindings::cli::ParameterType< arma::Col< eT > >::type
std::string type
Definition:
parameter_type.hpp:56
mlpack::bindings::cli::ParameterTypeDeducer::type
T type
Definition:
parameter_type.hpp:26
mlpack
.hpp
Definition:
add_to_po.hpp:21
prereqs.hpp
The core includes that mlpack expects; standard C++ includes and Armadillo.
std
Definition:
prereqs.hpp:55
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::bindings::cli::ParameterTypeDeducer
Definition:
parameter_type.hpp:24
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::ParameterType
Utility struct to return the type that boost::program_options should accept for a given input type...
Definition:
parameter_type.hpp:42
mlpack::bindings::cli::ParameterTypeDeducer< true, T >::type
std::string type
Definition:
parameter_type.hpp:33