Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_MatrixView.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 // WARNING: This code is experimental. Backwards compatibility should not be expected.
11 
12 #ifndef XPETRA_MATRIXVIEW_HPP
13 #define XPETRA_MATRIXVIEW_HPP
14 
15 #include <Teuchos_Describable.hpp>
16 #include <Tpetra_KokkosCompat_DefaultNode.hpp>
17 
18 #include "Xpetra_ConfigDefs.hpp"
19 #include "Xpetra_Map.hpp"
20 
25 namespace Xpetra {
26 
27 template <class Scalar,
28  class LocalOrdinal,
29  class GlobalOrdinal,
30  class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
31 class MatrixView { // TODO : virtual public Teuchos::Describable {
33 
34  public:
36 
37 
39  MatrixView(const RCP<const Map> &rowMap, const RCP<const Map> &colMap)
40  : rowMap_(rowMap)
41  , colMap_(colMap)
42  , maxEigValueEstimate_(-Teuchos::ScalarTraits<Scalar>::one()) {}
43 
45  virtual ~MatrixView() {}
46 
48 
50 
51  const RCP<const Map> &GetRowMap() const { return rowMap_; }
53 
55  const RCP<const Map> &GetColMap() const { return colMap_; }
56 
58  void SetRowMap(const RCP<const Map> &rowMap) { rowMap_ = rowMap; }
59 
61  void SetColMap(const RCP<const Map> &colMap) { colMap_ = colMap; }
63 
65  void SetMaxEigenvalueEstimate(Scalar const &sigma) { maxEigValueEstimate_ = sigma; }
66 
69 
70  private:
71  RCP<const Map> rowMap_;
72  RCP<const Map> colMap_;
73 
75 
76 }; // class MatrixView
77 
78 } // namespace Xpetra
79 
80 #define XPETRA_MATRIXVIEW_SHORT
81 #endif // XPETRA_MATRIX_VIEW_DECL_HPP
void SetColMap(const RCP< const Map > &colMap)
Set the Map that describes the column distribution in this matrix.
void SetRowMap(const RCP< const Map > &rowMap)
Returns the Map that describes the row distribution in this matrix.
void SetMaxEigenvalueEstimate(Scalar const &sigma)
Set an maximum eigenvalue estimate for this matrix.
virtual ~MatrixView()
Destructor.
Scalar GetMaxEigenvalueEstimate() const
Return the maximum eigenvalue estimate for this matrix.
const RCP< const Map > & GetRowMap() const
Returns the Map that describes the row distribution in this matrix.
RCP< const Map > colMap_
RCP< const Map > rowMap_
const RCP< const Map > & GetColMap() const
Returns the Map that describes the column distribution in this matrix.
MatrixView(const RCP< const Map > &rowMap, const RCP< const Map > &colMap)
Constructor.
Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > Map