default_param.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_BINDINGS_JULIA_DEFAULT_PARAM_HPP
13 #define MLPACK_BINDINGS_JULIA_DEFAULT_PARAM_HPP
14 
15 #include <mlpack/prereqs.hpp>
18 
19 namespace mlpack {
20 namespace bindings {
21 namespace julia {
22 
26 template<typename T>
27 std::string DefaultParamImpl(
29  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
30  const typename std::enable_if<!util::IsStdVector<T>::value>::type* = 0,
31  const typename std::enable_if<!data::HasSerialize<T>::value>::type* = 0,
32  const typename std::enable_if<!std::is_same<T,
33  std::string>::value>::type* = 0,
34  const typename std::enable_if<!std::is_same<T,
35  std::tuple<mlpack::data::DatasetInfo, arma::mat>>::value>::type* = 0);
36 
40 template<typename T>
41 std::string DefaultParamImpl(
42  util::ParamData& data,
43  const typename std::enable_if<util::IsStdVector<T>::value>::type* = 0);
44 
48 template<typename T>
49 std::string DefaultParamImpl(
50  util::ParamData& data,
51  const typename std::enable_if<std::is_same<T, std::string>::value>::type* = 0);
52 
58 template<typename T>
59 std::string DefaultParamImpl(
60  util::ParamData& data,
61  const typename std::enable_if<
62  arma::is_arma_type<T>::value ||
63  std::is_same<T, std::tuple<mlpack::data::DatasetInfo,
64  arma::mat>>::value>::type* = 0);
65 
70 template<typename T>
71 std::string DefaultParamImpl(
72  util::ParamData& data,
73  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
74  const typename std::enable_if<data::HasSerialize<T>::value>::type* = 0);
75 
80 template<typename T>
82  const void* /* input */,
83  void* output)
84 {
85  std::string* outstr = (std::string*) output;
86  *outstr = DefaultParamImpl<typename std::remove_pointer<T>::type>(data);
87 }
88 
89 } // namespace julia
90 } // namespace bindings
91 } // namespace mlpack
92 
93 // Include implementation.
94 #include "default_param_impl.hpp"
95 
96 #endif
Auxiliary information for a dataset, including mappings to/from strings (or other types) and the data...
std::string DefaultParamImpl(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::string >::value >::type *=0, const typename std::enable_if<!std::is_same< T, std::tuple< mlpack::data::DatasetInfo, arma::mat >>::value >::type *=0)
Return the default value of an option.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
julia
Definition: CMakeLists.txt:6
void DefaultParam(util::ParamData &data, const void *, void *output)
Return the default value of an option.
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:51
constexpr auto data(Container const &container) noexcept -> decltype(container.data())
Definition: iterator.hpp:79
Metaprogramming structure for vector detection.