diff --git a/src/mlpack/core/util/arma_traits.hpp b/src/mlpack/core/util/arma_traits.hpp index 45e5dac125..155a6a0d82 100644 --- a/src/mlpack/core/util/arma_traits.hpp +++ b/src/mlpack/core/util/arma_traits.hpp @@ -81,14 +81,34 @@ struct IsVector > const static bool value = true; }; -// I'm not so sure about this one. An SpSubview object can be a row or column, -// but it can also be a matrix subview. -// template<> -template -struct IsVector > -{ - const static bool value = true; -}; +#if ((ARMA_VERSION_MAJOR >= 10) || \ + ((ARMA_VERSION_MAJOR == 9) && (ARMA_VERSION_MINOR >= 869))) + + // Armadillo 9.869+ has SpSubview_col and SpSubview_row + + template + struct IsVector > + { + const static bool value = true; + }; + + template + struct IsVector > + { + const static bool value = true; + }; + +#else + + // fallback for older Armadillo versions + + template + struct IsVector > + { + const static bool value = true; + }; + +#endif #endif