arma_traits.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_UTIL_ARMA_TRAITS_HPP
13 #define MLPACK_CORE_UTIL_ARMA_TRAITS_HPP
14 
15 // Structs have public members by default (that's why they are chosen over
16 // classes).
17 
34 template<typename VecType>
35 struct IsVector
36 {
37  const static bool value = false;
38 };
39 
40 // Commenting out the first template per case, because
41 // Visual Studio doesn't like this instantiaion pattern (error C2910).
42 // template<>
43 template<typename eT>
44 struct IsVector<arma::Col<eT> >
45 {
46  const static bool value = true;
47 };
48 
49 // template<>
50 template<typename eT>
51 struct IsVector<arma::SpCol<eT> >
52 {
53  const static bool value = true;
54 };
55 
56 // template<>
57 template<typename eT>
58 struct IsVector<arma::Row<eT> >
59 {
60  const static bool value = true;
61 };
62 
63 // template<>
64 template<typename eT>
65 struct IsVector<arma::SpRow<eT> >
66 {
67  const static bool value = true;
68 };
69 
70 // template<>
71 template<typename eT>
72 struct IsVector<arma::subview_col<eT> >
73 {
74  const static bool value = true;
75 };
76 
77 // template<>
78 template<typename eT>
79 struct IsVector<arma::subview_row<eT> >
80 {
81  const static bool value = true;
82 };
83 
84 // I'm not so sure about this one. An SpSubview object can be a row or column,
85 // but it can also be a matrix subview.
86 
87 // template<>
88 template<typename eT>
89 struct IsVector<arma::SpSubview<eT> >
90 {
91  const static bool value = true;
92 };
93 
94 #endif
static const bool value
Definition: arma_traits.hpp:37
If value == true, then VecType is some sort of Armadillo vector or subview.
Definition: arma_traits.hpp:35