Merge pull request #2356 from conradsnicta/traits-fix

corrections to handle vector types in Armadillo 9.870
This commit is contained in:
Conrad Sanderson
2020-04-07 03:26:42 +02:00
committed by GitHub
+28 -8
View File
@@ -81,14 +81,34 @@ struct IsVector<arma::subview_row<eT> >
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<typename eT>
struct IsVector<arma::SpSubview<eT> >
{
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<typename eT>
struct IsVector<arma::SpSubview_col<eT> >
{
const static bool value = true;
};
template<typename eT>
struct IsVector<arma::SpSubview_row<eT> >
{
const static bool value = true;
};
#else
// fallback for older Armadillo versions
template<typename eT>
struct IsVector<arma::SpSubview<eT> >
{
const static bool value = true;
};
#endif
#endif