Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_EpetraCrsMatrix_MatrixAdapter_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Amesos2: Templated Direct Sparse Solver Package
4 //
5 // Copyright 2011 NTESS and the Amesos2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 
21 #ifndef AMESOS2_EPETRACRSMATRIX_MATRIXADAPTER_DECL_HPP
22 #define AMESOS2_EPETRACRSMATRIX_MATRIXADAPTER_DECL_HPP
23 
24 #include "Amesos2_config.h"
25 
26 #include <Epetra_CrsMatrix.h>
27 #ifdef HAVE_AMESOS2_EPETRAEXT
28 #include <EpetraExt_Reindex_CrsMatrix.h>
29 #endif
30 
32 #include "Amesos2_MatrixAdapter_decl.hpp"
33 
34 namespace Amesos2 {
35 
36  // template <class M, class D> class AbstractConcreteMatrixAdapter;
37 
50  template <>
51  class ConcreteMatrixAdapter< Epetra_CrsMatrix >
52  : public AbstractConcreteMatrixAdapter< Epetra_RowMatrix, Epetra_CrsMatrix >
53  {
54  // Give our matrix adapter class access to our private
55  // implementation functions
56  friend class MatrixAdapter< Epetra_RowMatrix >;
57  public:
58  typedef Epetra_CrsMatrix matrix_t;
59  private:
60  typedef AbstractConcreteMatrixAdapter<Epetra_RowMatrix,
61  Epetra_CrsMatrix> super_t;
62  public:
63  // 'import' superclass types
64  typedef super_t::scalar_t scalar_t;
65  typedef super_t::local_ordinal_t local_ordinal_t;
66  typedef super_t::global_ordinal_t global_ordinal_t;
67  typedef super_t::node_t node_t;
68  typedef super_t::global_size_t global_size_t;
69 
70  typedef ConcreteMatrixAdapter<matrix_t> type;
71 
72  ConcreteMatrixAdapter(RCP<matrix_t> m);
73 
74  RCP<const MatrixAdapter<matrix_t> > get_impl(const Teuchos::Ptr<const Tpetra::Map<local_ordinal_t,global_ordinal_t,node_t> > map, EDistribution distribution = ROOTED) const;
75  RCP<const MatrixAdapter<matrix_t> > reindex_impl(Teuchos::RCP<const Tpetra::Map<local_ordinal_t,global_ordinal_t,node_t>> &contigRowMap,
76  Teuchos::RCP<const Tpetra::Map<local_ordinal_t,global_ordinal_t,node_t>> &contigColMap) const;
77 
79  void
80  describe (Teuchos::FancyOStream& os,
81  const Teuchos::EVerbosityLevel verbLevel =
82  Teuchos::Describable::verbLevel_default) const;
83 #ifdef HAVE_AMESOS2_EPETRAEXT
84  private:
85  mutable RCP<EpetraExt::CrsMatrix_Reindex> StdIndex_;
86  mutable RCP<Epetra_CrsMatrix> ContigMat_;
87 #endif
88  };
89 
90 } // end namespace Amesos2
91 
92 #endif // AMESOS2_EPETRACRSMATRIX_MATRIXADAPTER_DECL_HPP
A Matrix adapter interface for Amesos2.
Definition: Amesos2_MatrixAdapter_decl.hpp:42
Provides the Epetra_RowMatrix abstraction for the concrete Epetra row matric adapters.
Definition: Amesos2_AbstractConcreteMatrixAdapter.hpp:55
EDistribution
Definition: Amesos2_TypeDecl.hpp:89