print_model_type_import.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_JULIA_PRINT_MODEL_TYPE_IMPORT_HPP
14 #define MLPACK_BINDINGS_JULIA_PRINT_MODEL_TYPE_IMPORT_HPP
15 
17 
18 namespace mlpack {
19 namespace bindings {
20 namespace julia {
21 
25 template<typename T>
27  util::ParamData& /* d */,
28  const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
29  const typename std::enable_if<!data::HasSerialize<T>::value>::type* = 0)
30 {
31  // Do nothing.
32 }
33 
37 template<typename T>
39  util::ParamData& /* d */,
40  const typename std::enable_if<arma::is_arma_type<T>::value>::type* = 0)
41 {
42  // Do nothing.
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<data::HasSerialize<T>::value>::type* = 0)
53 {
54  // We need to print, e.g.,
55  // import ..<type>
56 
57  // First, print the struct definition.
58  std::cout << "import .." << util::StripType(d.cppType) << std::endl;
59 }
60 
65 template<typename T>
67  const void* /* input */,
68  void* /* output */)
69 {
70  PrintModelTypeImport<typename std::remove_pointer<T>::type>(d);
71 }
72 
73 } // namespace julia
74 } // namespace bindings
75 } // namespace mlpack
76 
77 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
void PrintModelTypeImport(util::ParamData &, const typename std::enable_if<!arma::is_arma_type< T >::value >::type *=0, const typename std::enable_if<!data::HasSerialize< T >::value >::type *=0)
If the type is not serializable, print nothing.
julia
Definition: CMakeLists.txt:6
This structure holds all of the information about a single parameter, including its value (which is s...
Definition: param_data.hpp:51
std::string StripType(std::string cppType)
Given a C++ type name, turn it into something that has no special characters that can simply be print...
Definition: strip_type.hpp:27
std::string cppType
The true name of the type, as it would be written in C++.
Definition: param_data.hpp:80