// @HEADER // ***************************************************************************** // Xpetra: A linear algebra interface package // // Copyright 2012 NTESS and the Xpetra contributors. // SPDX-License-Identifier: BSD-3-Clause // ***************************************************************************** // @HEADER #ifndef XPETRA_HELPERS_DECL_HPP #define XPETRA_HELPERS_DECL_HPP #include "Xpetra_ConfigDefs.hpp" #include "Xpetra_BlockedCrsMatrix.hpp" #include "Xpetra_CrsMatrixWrap.hpp" #include "Xpetra_MapExtractor.hpp" #include "Xpetra_Map.hpp" #include "Xpetra_Matrix.hpp" #ifdef HAVE_XPETRA_EPETRA #include #endif #ifdef HAVE_XPETRA_EPETRAEXT #include #include #include #endif // HAVE_XPETRA_EPETRAEXT #ifdef HAVE_XPETRA_TPETRA #include #include #include #include #include #include #include #include #include #include #endif // HAVE_XPETRA_TPETRA namespace Xpetra { /*! @class Helpers @brief Xpetra utility class containing transformation routines between Xpetra::Matrix and Epetra/Tpetra objects Note: this class is not in the Xpetra_UseShortNames.hpp */ template class Helpers { #include "Xpetra_UseShortNames.hpp" public: #ifdef HAVE_XPETRA_EPETRA static RCP Op2EpetraCrs(RCP Op); static RCP Op2NonConstEpetraCrs(RCP Op); static const Epetra_CrsMatrix& Op2EpetraCrs(const Matrix& Op); static Epetra_CrsMatrix& Op2NonConstEpetraCrs(const Matrix& Op); #endif // HAVE_XPETRA_EPETRA #ifdef HAVE_XPETRA_TPETRA static RCP > Op2TpetraCrs(RCP Op); static RCP > Op2NonConstTpetraCrs(RCP Op); static const Tpetra::CrsMatrix& Op2TpetraCrs(const Matrix& Op); static Tpetra::CrsMatrix& Op2NonConstTpetraCrs(const Matrix& Op); static bool isTpetraCrs(RCP Op); static bool isTpetraCrs(const Matrix& Op); static RCP > Op2TpetraBlockCrs(RCP Op); static RCP > Op2NonConstTpetraBlockCrs(RCP Op); static const Tpetra::BlockCrsMatrix& Op2TpetraBlockCrs(const Matrix& Op); static Tpetra::BlockCrsMatrix& Op2NonConstTpetraBlockCrs(const Matrix& Op); static bool isTpetraBlockCrs(RCP Op); static bool isTpetraBlockCrs(const Matrix& Op); #else // HAVE_XPETRA_TPETRA static bool isTpetraCrs(const Matrix& Op); static bool isTpetraBlockCrs(const Matrix& Op); #endif // HAVE_XPETRA_TPETRA #ifdef HAVE_XPETRA_TPETRA using tcrs_matrix_type = Tpetra::CrsMatrix; static Teuchos::RCP tpetraAdd( const tcrs_matrix_type& A, bool transposeA, const typename tcrs_matrix_type::scalar_type alpha, const tcrs_matrix_type& B, bool transposeB, const typename tcrs_matrix_type::scalar_type beta); #endif #ifdef HAVE_XPETRA_EPETRAEXT static void epetraExtMult(const Matrix& A, bool transposeA, const Matrix& B, bool transposeB, Matrix& C, bool fillCompleteResult); #endif }; } // namespace Xpetra #endif