#ifndef HPC_MATVEC_ISGEMATRIX_H #define HPC_MATVEC_ISGEMATRIX_H 1 #include <cassert> #include <type_traits> #include <hpc/aux/iscomplex.h> #include <hpc/matvec/gematrix.h> namespace hpc { namespace matvec { template <typename Matrix> struct IsGeMatrix { struct Two { char a, b; }; template <typename T, typename I> static char checker(const GeMatrix<T, I> &); template <typename T, typename I> static char checker(const GeMatrixView<T, I> &); template <typename T, typename I> static char checker(const GeMatrixConstView<T, I> &); template <typename T> static Two checker(const T &); static Matrix matrix; static const bool value = sizeof(checker(matrix)) == 1; }; template <typename Matrix> struct IsRealGeMatrix { typedef typename Matrix::ElementType T; static const bool value = IsGeMatrix<Matrix>::value && !aux::IsComplex<T>::value; }; template <typename Matrix> struct IsComplexGeMatrix { typedef typename Matrix::ElementType T; static const bool value = IsGeMatrix<Matrix>::value && aux::IsComplex<T>::value; }; } } // namespace matvec, hpc #endif // HPC_MATVEC_ISGEMATRIX_H |