11 #ifndef AMESOS2_EPETRACRSMATRIX_MATRIXADAPTER_DEF_HPP
12 #define AMESOS2_EPETRACRSMATRIX_MATRIXADAPTER_DEF_HPP
14 #include <Epetra_LocalMap.h>
15 #include <Epetra_Import.h>
19 #include "Amesos2_MatrixAdapter_def.hpp"
24 ConcreteMatrixAdapter<Epetra_CrsMatrix>::ConcreteMatrixAdapter(RCP<Epetra_CrsMatrix> m)
25 : AbstractConcreteMatrixAdapter<Epetra_RowMatrix,Epetra_CrsMatrix>(m)
28 Teuchos::RCP<const MatrixAdapter<Epetra_CrsMatrix> >
29 ConcreteMatrixAdapter<Epetra_CrsMatrix>::get_impl(
const Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,global_ordinal_t,node_t> > map,
EDistribution )
const
33 using Teuchos::rcpFromRef;
35 RCP<const Epetra_Map> o_map, t_map;
36 o_map = rcpFromRef(this->mat_->RowMap());
37 t_map = Util::tpetra_map_to_epetra_map<local_ordinal_t,global_ordinal_t,global_size_t,node_t>(*map);
39 RCP<Epetra_CrsMatrix> t_mat = rcp(
new Epetra_CrsMatrix(Copy, *t_map, this->getMaxRowNNZ()));
41 Epetra_Import importer(*t_map, *o_map);
42 t_mat->Import(*(this->mat_), importer, Insert);
44 t_mat->FillComplete();
46 return( rcp(
new ConcreteMatrixAdapter<Epetra_CrsMatrix>(t_mat)) );
51 #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:89