diff --git a/include/pressio/type_traits.hpp b/include/pressio/type_traits.hpp index 4a4176f..c485507 100644 --- a/include/pressio/type_traits.hpp +++ b/include/pressio/type_traits.hpp @@ -59,9 +59,7 @@ template struct Traits; #include "type_traits/nested_typedef_detection.hpp" //*** vector **** -#ifdef PRESSIO_ENABLE_TPL_EIGEN #include "type_traits/native_eigen_vector.hpp" -#endif #ifdef PRESSIO_ENABLE_TPL_KOKKOS #include "type_traits/native_kokkos_vector.hpp" #endif @@ -81,10 +79,8 @@ template struct Traits; #ifdef PRESSIO_ENABLE_TPL_TRILINOS #include "type_traits/native_teuchos_dense_matrix.hpp" #endif -#ifdef PRESSIO_ENABLE_TPL_EIGEN #include "type_traits/native_eigen_dense_matrix.hpp" #include "type_traits/native_eigen_sparse_matrix.hpp" -#endif //*** multi vector **** #ifdef PRESSIO_ENABLE_TPL_TRILINOS diff --git a/include/pressio/type_traits/native_eigen_dense_matrix.hpp b/include/pressio/type_traits/native_eigen_dense_matrix.hpp index 7e22c9a..73e4877 100644 --- a/include/pressio/type_traits/native_eigen_dense_matrix.hpp +++ b/include/pressio/type_traits/native_eigen_dense_matrix.hpp @@ -49,13 +49,16 @@ #ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_EIGEN_DENSE_MATRIX_HPP_ #define PRESSIOOPS_TYPE_TRAITS_NATIVE_EIGEN_DENSE_MATRIX_HPP_ +#ifdef PRESSIO_ENABLE_TPL_EIGEN #include "Eigen/Dense" +#endif namespace pressio{ template struct is_static_dense_matrix_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN /* T is a dense STATIC eigen matrix if * T is not an eigen vector * rows and cols are not = Eigen:Dynamic @@ -73,11 +76,13 @@ struct is_static_dense_matrix_eigen< T::ColsAtCompileTime != Eigen::Dynamic > > : std::true_type{}; +#endif //---------------------------------------------------------------------- template struct is_dynamic_dense_matrix_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN /* T is a dense DYNAMIC eigen matrix if * is not an eigen vector * is not a static dense matrix @@ -148,11 +153,13 @@ struct is_dynamic_dense_matrix_eigen< T::ColsAtCompileTime != Eigen::Dynamic > > : std::true_type{}; +#endif //---------------------------------------------------------------------- template struct is_dense_row_major_matrix_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_dense_row_major_matrix_eigen< T, @@ -162,11 +169,13 @@ struct is_dense_row_major_matrix_eigen< int(T::IsRowMajor)==1 > > : std::true_type{}; +#endif //---------------------------------------------------------------------- template struct is_dense_col_major_matrix_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_dense_col_major_matrix_eigen< T, @@ -176,11 +185,13 @@ struct is_dense_col_major_matrix_eigen< int(T::IsRowMajor)==0 > > : std::true_type{}; +#endif //---------------------------------------------------------------------- template struct is_dense_matrix_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_dense_matrix_eigen< T, @@ -189,6 +200,7 @@ struct is_dense_matrix_eigen< is_dynamic_dense_matrix_eigen::value > > : std::true_type{}; +#endif }//end namespace #endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_EIGEN_DENSE_MATRIX_HPP_ diff --git a/include/pressio/type_traits/native_eigen_sparse_matrix.hpp b/include/pressio/type_traits/native_eigen_sparse_matrix.hpp index 6d4b817..7484837 100644 --- a/include/pressio/type_traits/native_eigen_sparse_matrix.hpp +++ b/include/pressio/type_traits/native_eigen_sparse_matrix.hpp @@ -49,13 +49,16 @@ #ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_EIGEN_SPARSE_MATRIX_HPP_ #define PRESSIOOPS_TYPE_TRAITS_NATIVE_EIGEN_SPARSE_MATRIX_HPP_ +#ifdef PRESSIO_ENABLE_TPL_EIGEN #include "Eigen/Sparse" +#endif namespace pressio{ template struct is_sparse_matrix_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN /* * T is an eigen sparse matrix if is * not an eigen vector @@ -72,7 +75,7 @@ struct is_sparse_matrix_eigen< >::value > > : std::true_type{}; - +#endif //---------------------------------------------------------------------- diff --git a/include/pressio/type_traits/native_eigen_vector.hpp b/include/pressio/type_traits/native_eigen_vector.hpp index c3afbd0..bb05cfd 100644 --- a/include/pressio/type_traits/native_eigen_vector.hpp +++ b/include/pressio/type_traits/native_eigen_vector.hpp @@ -49,13 +49,16 @@ #ifndef PRESSIOOPS_TYPE_TRAITS_NATIVE_EIGEN_VECTOR_HPP_ #define PRESSIOOPS_TYPE_TRAITS_NATIVE_EIGEN_VECTOR_HPP_ +#ifdef PRESSIO_ENABLE_TPL_EIGEN #include +#endif namespace pressio{ template struct is_dynamic_row_vector_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_dynamic_row_vector_eigen< T, @@ -66,11 +69,13 @@ struct is_dynamic_row_vector_eigen< >::value > > : std::true_type{}; +#endif //---------------------------------------------- template struct is_static_row_vector_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_static_row_vector_eigen< T, @@ -82,11 +87,14 @@ struct is_static_row_vector_eigen< !is_dynamic_row_vector_eigen::value > > : std::true_type{}; +#endif //---------------------------------------------- template struct is_dynamic_column_vector_eigen : std::false_type {}; + +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_dynamic_column_vector_eigen< T, @@ -97,11 +105,14 @@ struct is_dynamic_column_vector_eigen< >::value > > : std::true_type{}; +#endif //---------------------------------------------- template struct is_static_column_vector_eigen : std::false_type {}; + +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_static_column_vector_eigen< T, @@ -113,11 +124,14 @@ struct is_static_column_vector_eigen< !is_dynamic_column_vector_eigen::value > > : std::true_type{}; +#endif //---------------------------------------------- template struct is_static_vector_eigen : std::false_type {}; + +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_static_vector_eigen< T, @@ -126,11 +140,14 @@ struct is_static_vector_eigen< is_static_column_vector_eigen::value > > : std::true_type{}; +#endif //---------------------------------------------- template struct is_dynamic_vector_eigen : std::false_type {}; + +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_dynamic_vector_eigen< T, @@ -139,11 +156,13 @@ struct is_dynamic_vector_eigen< is_dynamic_column_vector_eigen::value > > : std::true_type{}; +#endif //---------------------------------------------- template struct is_vector_eigen : std::false_type {}; +#ifdef PRESSIO_ENABLE_TPL_EIGEN template struct is_vector_eigen< T, @@ -152,6 +171,7 @@ struct is_vector_eigen< is_static_vector_eigen::value > > : std::true_type{}; +#endif }//end namespace #endif // PRESSIOOPS_TYPE_TRAITS_NATIVE_EIGEN_VECTOR_HPP_