get_numpy_type_char.hpp
Go to the documentation of this file.
1 
13 #ifndef MLPACK_BINDINGS_PYTHON_GET_NUMPY_TYPE_CHAR_HPP
14 #define MLPACK_BINDINGS_PYTHON_GET_NUMPY_TYPE_CHAR_HPP
15 
16 #include <mlpack/prereqs.hpp>
17 
18 namespace mlpack {
19 namespace bindings {
20 namespace python {
21 
22 template<typename T>
23 inline std::string GetNumpyTypeChar()
24 {
25  return "?";
26 }
27 
28 // size_t = s.
29 template<>
30 inline std::string GetNumpyTypeChar<arma::Mat<size_t>>()
31 {
32  return "s";
33 }
34 
35 template<>
36 inline std::string GetNumpyTypeChar<arma::Col<size_t>>()
37 {
38  return "s";
39 }
40 
41 template<>
42 inline std::string GetNumpyTypeChar<arma::Row<size_t>>()
43 {
44  return "s";
45 }
46 
47 // double = d.
48 template<>
49 inline std::string GetNumpyTypeChar<arma::mat>()
50 {
51  return "d";
52 }
53 
54 template<>
55 inline std::string GetNumpyTypeChar<arma::vec>()
56 {
57  return "d";
58 }
59 
60 template<>
61 inline std::string GetNumpyTypeChar<arma::rowvec>()
62 {
63  return "d";
64 }
65 
66 } // namespace python
67 } // namespace bindings
68 } // namespace mlpack
69 
70 #endif
strip_type.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
python
Definition: CMakeLists.txt:4