45 #ifndef AMESOS2_EPETRACRSMATRIX_MATRIXADAPTER_DEF_HPP
46 #define AMESOS2_EPETRACRSMATRIX_MATRIXADAPTER_DEF_HPP
48 #include <Epetra_LocalMap.h>
49 #include <Epetra_Import.h>
53 #include "Amesos2_MatrixAdapter_def.hpp"
58 ConcreteMatrixAdapter<Epetra_CrsMatrix>::ConcreteMatrixAdapter(RCP<Epetra_CrsMatrix> m)
59 : AbstractConcreteMatrixAdapter<Epetra_RowMatrix,Epetra_CrsMatrix>(m)
62 Teuchos::RCP<const MatrixAdapter<Epetra_CrsMatrix> >
63 ConcreteMatrixAdapter<Epetra_CrsMatrix>::get_impl(
const Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,global_ordinal_t,node_t> > map,
EDistribution )
const
67 using Teuchos::rcpFromRef;
69 RCP<const Epetra_Map> o_map, t_map;
70 o_map = rcpFromRef(this->mat_->RowMap());
71 t_map = Util::tpetra_map_to_epetra_map<local_ordinal_t,global_ordinal_t,global_size_t,node_t>(*map);
73 RCP<Epetra_CrsMatrix> t_mat = rcp(
new Epetra_CrsMatrix(Copy, *t_map, this->getMaxRowNNZ()));
75 Epetra_Import importer(*t_map, *o_map);
76 t_mat->Import(*(this->mat_), importer, Insert);
78 t_mat->FillComplete();
80 return( rcp(
new ConcreteMatrixAdapter<Epetra_CrsMatrix>(t_mat)) );
85 #endif // AMESOS2_EPETRACRSMATRIX_MATRIXADAPTER_DEF_HPP
Definitions for the Epetra_RowMatrix abstract adapter.
Specialization of the ConcreteMatrixAdapter for Epetra_CrsMatrix. Inherits all its functionality from...
EDistribution
Definition: Amesos2_TypeDecl.hpp:123