mlpack 3.4.2
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
18namespace mlpack {
19namespace bindings {
20namespace python {
21
22template<typename T>
23inline std::string GetNumpyTypeChar()
24{
25 return "?";
26}
27
28// size_t = s.
29template<>
30inline std::string GetNumpyTypeChar<arma::Mat<size_t>>()
31{
32 return "s";
33}
34
35template<>
36inline std::string GetNumpyTypeChar<arma::Col<size_t>>()
37{
38 return "s";
39}
40
41template<>
42inline std::string GetNumpyTypeChar<arma::Row<size_t>>()
43{
44 return "s";
45}
46
47// double = d.
48template<>
49inline std::string GetNumpyTypeChar<arma::mat>()
50{
51 return "d";
52}
53
54template<>
55inline std::string GetNumpyTypeChar<arma::vec>()
56{
57 return "d";
58}
59
60template<>
61inline std::string GetNumpyTypeChar<arma::rowvec>()
62{
63 return "d";
64}
65
66} // namespace python
67} // namespace bindings
68} // namespace mlpack
69
70#endif
python
Definition: CMakeLists.txt:6
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.