12 #ifndef XPETRA_MATRIXFACTORY2_DEF_HPP
13 #define XPETRA_MATRIXFACTORY2_DEF_HPP
16 #include "Xpetra_BlockedCrsMatrix.hpp"
20 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
21 RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>>
MatrixFactory2<Scalar, LocalOrdinal, GlobalOrdinal, Node>::BuildCopy(
const RCP<
const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>> A,
bool setFixedBlockSize) {
22 RCP<const CrsMatrixWrap> oldOp = Teuchos::rcp_dynamic_cast<
const CrsMatrixWrap>(A);
23 if (oldOp == Teuchos::null)
26 RCP<const CrsMatrix> oldCrsOp = oldOp->getCrsMatrix();
31 "Not Epetra or Tpetra matrix");
33 #ifdef HAVE_XPETRA_EPETRA
40 #ifdef HAVE_XPETRA_TPETRA
43 RCP<const TpetraCrsMatrix> oldTCrsOp = Teuchos::rcp_dynamic_cast<
const TpetraCrsMatrix>(oldCrsOp);
45 if (oldTCrsOp != Teuchos::null) {
47 RCP<CrsMatrixWrap> newOp(
new CrsMatrixWrap(Teuchos::as<RCP<CrsMatrix>>(newTCrsOp)));
48 if (setFixedBlockSize)
49 newOp->SetFixedBlockSize(A->GetFixedBlockSize());
Exception throws to report errors in the internal logical of the program.
Exception indicating invalid cast attempted.
Concrete implementation of Xpetra::Matrix.
static RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > BuildCopy(const RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > A, bool setFixedBlockSize=true)
Xpetra-specific matrix class.