13 #ifndef MLPACK_BINDINGS_PYTHON_GET_CYTHON_TYPE_HPP 14 #define MLPACK_BINDINGS_PYTHON_GET_CYTHON_TYPE_HPP 24 inline std::string GetCythonType(
26 const typename std::enable_if<!util::IsStdVector<T>::value>::type* = 0,
27 const typename std::enable_if<!data::HasSerialize<T>::value>::type* = 0,
28 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0)
34 inline std::string GetCythonType<int>(
36 const typename std::enable_if<!util::IsStdVector<int>::value>::type*,
37 const typename std::enable_if<!data::HasSerialize<int>::value>::type*,
38 const typename std::enable_if<!arma::is_arma_type<int>::value>::type*)
44 inline std::string GetCythonType<double>(
46 const typename std::enable_if<!util::IsStdVector<double>::value>::type*,
47 const typename std::enable_if<!data::HasSerialize<double>::value>::type*,
48 const typename std::enable_if<!arma::is_arma_type<double>::value>::type*)
54 inline std::string GetCythonType<std::string>(
56 const typename std::enable_if<
57 !util::IsStdVector<std::string>::value>::type*,
58 const typename std::enable_if<
59 !data::HasSerialize<std::string>::value>::type*,
60 const typename std::enable_if<
61 !arma::is_arma_type<std::string>::value>::type*)
67 inline std::string GetCythonType<size_t>(
69 const typename std::enable_if<!util::IsStdVector<size_t>::value>::type*,
70 const typename std::enable_if<!data::HasSerialize<size_t>::value>::type*,
71 const typename std::enable_if<!arma::is_arma_type<size_t>::value>::type*)
77 inline std::string GetCythonType<bool>(
79 const typename std::enable_if<!util::IsStdVector<bool>::value>::type*,
80 const typename std::enable_if<!data::HasSerialize<bool>::value>::type*,
81 const typename std::enable_if<!arma::is_arma_type<bool>::value>::type*)
87 inline std::string GetCythonType(
89 const typename std::enable_if<util::IsStdVector<T>::value>::type* = 0)
91 return "vector[" + GetCythonType<typename T::value_type>(d) +
"]";
95 inline std::string GetCythonType(
97 const typename std::enable_if<arma::is_arma_type<T>::value>::type* = 0)
99 std::string type =
"Mat";
105 return "arma." + type +
"[" + GetCythonType<typename T::elem_type>(d) +
"]";
109 inline std::string GetCythonType(
111 const typename std::enable_if<!arma::is_arma_type<T>::value>::type* = 0,
112 const typename std::enable_if<data::HasSerialize<T>::value>::type* = 0)
114 return d.cppType +
"*";
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.