49 #ifndef XPETRA_CLONER_HPP
50 #define XPETRA_CLONER_HPP
57 #include "Xpetra_Map.hpp"
58 #ifdef HAVE_XPETRA_TPETRA
59 #include "Xpetra_TpetraMap.hpp"
63 #include "Xpetra_CrsMatrixWrap.hpp"
71 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node1,
class Node2>
74 throw std::invalid_argument(
"Map::clone() functionality is only available for Tpetra");
75 #if defined(HAVE_XPETRA_TPETRA) && defined(TPETRA_ENABLE_DEPRECATED_CODE)
78 return tMap->clone(node2);
84 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node1,
class Node2>
87 throw std::invalid_argument(
"Matrix::clone() functionality is only available for Tpetra");
90 Teuchos::rcp_dynamic_cast<const CrsMatrixWrap<Scalar,LocalOrdinal,GlobalOrdinal,Node1> >(rcpFromRef(matrix));
92 return tMatrix->clone(node2);
95 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node1,
class Node2>
98 throw std::invalid_argument(
"MultiVector::clone() functionality is only available for Tpetra");
99 #ifdef HAVE_XPETRA_TPETRA
101 Teuchos::rcp_dynamic_cast<const TpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node1> >(rcpFromRef(MV));
103 return tMV->clone(node2);
105 return Teuchos::null;
112 #define XPETRA_CLONER_SHORT
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const =0
The Map describing the parallel distribution of this object.
virtual UnderlyingLib lib() const =0
Get the library used by this object (Tpetra or Epetra?)
Xpetra-specific matrix class.
virtual const RCP< const Map > & getRowMap() const
Returns the Map that describes the row distribution in this matrix.
RCP< Map< LocalOrdinal, GlobalOrdinal, Node2 > > clone(const Map< LocalOrdinal, GlobalOrdinal, Node1 > &map, const RCP< Node2 > &node2)