Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_RowMatrix.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 #ifndef XPETRA_ROWMATRIX_HPP
11 #define XPETRA_ROWMATRIX_HPP
12 
13 /* this file is automatically generated - do not edit (see script/interfaces.py) */
14 
15 // WARNING: This code is experimental. Backwards compatibility should not be expected.
16 
17 #include <Teuchos_Describable.hpp>
18 #include <Tpetra_KokkosCompat_DefaultNode.hpp>
19 #include "Xpetra_ConfigDefs.hpp"
20 #include "Xpetra_Map.hpp"
21 #include "Xpetra_Operator.hpp"
22 #include "Xpetra_Vector.hpp"
23 
24 namespace Xpetra {
25 
26 template <class Scalar,
27  class LocalOrdinal,
28  class GlobalOrdinal,
29  class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
30 class RowMatrix : virtual public Operator<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
31  public:
32  typedef Scalar scalar_type;
33  typedef LocalOrdinal local_ordinal_type;
34  typedef GlobalOrdinal global_ordinal_type;
35  typedef Node node_type;
36 
38 
39 
41  virtual ~RowMatrix() {}
42 
44 
46 
47 
49  virtual const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRowMap() const = 0;
50 
52  virtual const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getColMap() const = 0;
53 
55  virtual global_size_t getGlobalNumRows() const = 0;
56 
58  virtual global_size_t getGlobalNumCols() const = 0;
59 
61  virtual size_t getLocalNumRows() const = 0;
62 
64  virtual size_t getLocalNumCols() const = 0;
65 
67  virtual global_size_t getGlobalNumEntries() const = 0;
68 
70  virtual size_t getLocalNumEntries() const = 0;
71 
73  virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const = 0;
74 
76  virtual size_t getGlobalMaxNumRowEntries() const = 0;
77 
79  virtual size_t getLocalMaxNumRowEntries() const = 0;
80 
82  virtual bool isLocallyIndexed() const = 0;
83 
85  virtual bool isGloballyIndexed() const = 0;
86 
88  virtual bool isFillComplete() const = 0;
89 
91  virtual bool supportsRowViews() const = 0;
92 
94 
96 
97 
99  virtual void getLocalRowCopy(LocalOrdinal LocalRow, const Teuchos::ArrayView<LocalOrdinal> &Indices, const Teuchos::ArrayView<Scalar> &Values, size_t &NumEntries) const = 0;
100 
102  virtual void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &indices, ArrayView<const Scalar> &values) const = 0;
103 
105  virtual void getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &indices, ArrayView<const Scalar> &values) const = 0;
106 
109 
111 
113 
114 
116  virtual typename ScalarTraits<Scalar>::magnitudeType getFrobeniusNorm() const = 0;
117 
119 
121 
122 
124  virtual const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getDomainMap() const = 0;
125 
127  virtual const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRangeMap() const = 0;
128 
130  virtual void apply(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &X, MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &Y, Teuchos::ETransp mode = Teuchos::NO_TRANS, Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(), Scalar beta = Teuchos::ScalarTraits<Scalar>::zero()) const = 0;
131 
133 
134 }; // RowMatrix class
135 
136 } // namespace Xpetra
137 
138 #define XPETRA_ROWMATRIX_SHORT
139 #endif // XPETRA_ROWMATRIX_HPP
virtual bool isLocallyIndexed() const =0
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
virtual void getLocalRowCopy(LocalOrdinal LocalRow, const Teuchos::ArrayView< LocalOrdinal > &Indices, const Teuchos::ArrayView< Scalar > &Values, size_t &NumEntries) const =0
Extract a list of entries in a specified local row of the graph. Put into storage allocated by callin...
virtual void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const =0
Get a copy of the diagonal entries owned by this node, with local row indices.
virtual ~RowMatrix()
Destructor.
virtual bool isGloballyIndexed() const =0
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
virtual size_t getLocalNumCols() const =0
Returns the number of columns needed to apply the forward operator on this node, i.e., the number of elements listed in the column map.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const =0
Returns the Map associated with the domain of this operator, which must be compatible with X...
virtual size_t getGlobalMaxNumRowEntries() const =0
Returns the maximum number of entries across all rows/columns on all nodes.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const =0
Returns the Map associated with the range of this operator, which must be compatible with Y...
virtual void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const =0
Extract a const, non-persisting view of global indices in a specified row of the matrix.
virtual size_t getLocalNumEntries() const =0
Returns the local number of entries in this matrix.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const =0
Returns the Map that describes the column distribution in this matrix.
GlobalOrdinal global_ordinal_type
virtual global_size_t getGlobalNumEntries() const =0
Returns the global number of entries in this matrix.
virtual global_size_t getGlobalNumCols() const =0
Returns the number of global columns in this matrix.
size_t global_size_t
Global size_t object.
virtual bool isFillComplete() const =0
Returns true if fillComplete() has been called.
virtual void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const =0
Extract a const, non-persisting view of local indices in a specified row of the matrix.
virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const =0
Returns the current number of entries on this node in the specified local row.
virtual size_t getLocalNumRows() const =0
Returns the number of rows owned on the calling node.
virtual ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const =0
Returns the Frobenius norm of the matrix.
LocalOrdinal local_ordinal_type
virtual void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const =0
Computes the operator-multivector application.
virtual bool supportsRowViews() const =0
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
virtual size_t getLocalMaxNumRowEntries() const =0
Returns the maximum number of entries across all rows/columns on this node.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const =0
Returns the Map that describes the row distribution in this matrix.
virtual global_size_t getGlobalNumRows() const =0
Returns the number of global rows in this matrix.