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