Tpetra parallel linear algebra  Version of the Day
Tpetra_RowGraph_decl.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Tpetra: Templated Linear Algebra Services Package
5 // Copyright (2008) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 
42 #ifndef TPETRA_ROWGRAPH_DECL_HPP
43 #define TPETRA_ROWGRAPH_DECL_HPP
44 
45 #include "Tpetra_RowGraph_fwd.hpp"
46 #include "Tpetra_Map.hpp"
47 #include "Tpetra_Import.hpp"
48 #include "Tpetra_Export.hpp"
49 #include "Tpetra_Packable.hpp"
50 #include "Teuchos_Describable.hpp"
51 
52 namespace Tpetra {
53 namespace Classes {
54 
67  template <class LocalOrdinal = ::Tpetra::Details::DefaultTypes::local_ordinal_type,
68  class GlobalOrdinal = ::Tpetra::Details::DefaultTypes::global_ordinal_type,
70  class RowGraph :
71  virtual public Teuchos::Describable,
72  public Packable<GlobalOrdinal, LocalOrdinal> {
73  public:
75 
76  typedef LocalOrdinal local_ordinal_type;
79  typedef GlobalOrdinal global_ordinal_type;
81  typedef Node node_type;
83 
85  virtual ~RowGraph() {};
86 
88 
89 
91  virtual Teuchos::RCP<const Teuchos::Comm<int> >
92  getComm () const = 0;
93 
95  virtual Teuchos::RCP<Node> getNode () const = 0;
96 
98  virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
99  getRowMap () const = 0;
100 
102  virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
103  getColMap () const = 0;
104 
106  virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
107  getDomainMap () const = 0;
108 
110  virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
111  getRangeMap () const = 0;
112 
114  virtual Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> >
115  getImporter () const = 0;
116 
118  virtual Teuchos::RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> >
119  getExporter () const = 0;
120 
122  virtual global_size_t getGlobalNumRows() const = 0;
123 
125  virtual global_size_t getGlobalNumCols() const = 0;
126 
128  virtual size_t getNodeNumRows() const = 0;
129 
131  virtual size_t getNodeNumCols() const = 0;
132 
134  virtual GlobalOrdinal getIndexBase() const = 0;
135 
137  virtual global_size_t getGlobalNumEntries() const = 0;
138 
140  virtual size_t getNodeNumEntries() const = 0;
141 
143 
144  virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const = 0;
145 
147 
148  virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const = 0;
149 
155  virtual global_size_t TPETRA_DEPRECATED getGlobalNumDiags () const = 0;
156 
161  virtual size_t TPETRA_DEPRECATED getNodeNumDiags () const = 0;
162 
164  virtual size_t getGlobalMaxNumRowEntries() const = 0;
165 
167  virtual size_t getNodeMaxNumRowEntries() const = 0;
168 
170  virtual bool hasColMap() const = 0;
171 
182  virtual bool TPETRA_DEPRECATED isLowerTriangular () const = 0;
183 
194  virtual bool TPETRA_DEPRECATED isUpperTriangular () const = 0;
195 
197  virtual bool isLocallyIndexed() const = 0;
198 
200  virtual bool isGloballyIndexed() const = 0;
201 
203  virtual bool isFillComplete() const = 0;
204 
206 
208 
210 
219  virtual void
220  getGlobalRowCopy (GlobalOrdinal GlobalRow,
221  const Teuchos::ArrayView<GlobalOrdinal> &Indices,
222  size_t &NumIndices) const = 0;
223 
225 
234  virtual void
235  getLocalRowCopy (LocalOrdinal LocalRow,
236  const Teuchos::ArrayView<LocalOrdinal> &Indices,
237  size_t &NumIndices) const = 0;
238 
245  virtual bool supportsRowViews () const {
246  return false;
247  }
248 
276  virtual void
277  getLocalRowView (const LocalOrdinal lclRow,
278  Teuchos::ArrayView<const LocalOrdinal>& lclColInds) const;
279 
295  virtual void
296  getGlobalRowView (const GlobalOrdinal gblRow,
297  Teuchos::ArrayView<const GlobalOrdinal>& gblColInds) const;
298 
300 
302 
304  virtual void
305  pack (const Teuchos::ArrayView<const LocalOrdinal>& exportLIDs,
306  Teuchos::Array<GlobalOrdinal>& exports,
307  const Teuchos::ArrayView<size_t>& numPacketsPerLID,
308  size_t& constantNumPackets,
309  Distributor& distor) const;
311  }; // class RowGraph
312 } // namespace Classes
313 } // namespace Tpetra
314 
315 #endif // TPETRA_ROWGRAPH_DECL_HPP
Tpetra::Classes::RowGraph::getGlobalRowView
virtual void getGlobalRowView(const GlobalOrdinal gblRow, Teuchos::ArrayView< const GlobalOrdinal > &gblColInds) const
Get a const, non-persisting view of the given global row's global column indices, as a Teuchos::Array...
Definition: Tpetra_RowGraph_def.hpp:131
Tpetra::Classes::RowGraph::getNode
virtual Teuchos::RCP< Node > getNode() const =0
The Kokkos Node instance with which this object was created.
Tpetra::Classes::RowGraph::isLowerTriangular
virtual bool TPETRA_DEPRECATED isLowerTriangular() const =0
Whether the graph is locally lower triangular.
Tpetra::Classes::RowGraph::node_type
Node node_type
The Kokkos Node type.
Definition: Tpetra_RowGraph_decl.hpp:81
Tpetra::Classes::RowGraph::getGlobalNumDiags
virtual global_size_t TPETRA_DEPRECATED getGlobalNumDiags() const =0
Number of diagonal entries over all processes in the graph's communicator.
Tpetra::Classes::RowGraph::getGlobalRowCopy
virtual void getGlobalRowCopy(GlobalOrdinal GlobalRow, const Teuchos::ArrayView< GlobalOrdinal > &Indices, size_t &NumIndices) const =0
Extract a list of entries in a specified global row of the graph. Put into pre-allocated storage.
Tpetra::Classes::RowGraph::getNumEntriesInGlobalRow
virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const =0
Returns the current number of entries on this node in the specified global row.
Tpetra::Details::DefaultTypes::node_type
::Kokkos::Compat::KokkosDeviceWrapperNode< execution_space > node_type
Default value of Node template parameter.
Definition: Tpetra_Details_DefaultTypes.hpp:105
Tpetra::Classes::RowGraph::global_ordinal_type
GlobalOrdinal global_ordinal_type
The type of global indices in the graph.
Definition: Tpetra_RowGraph_decl.hpp:79
Tpetra::Classes::RowGraph::getNodeNumDiags
virtual size_t TPETRA_DEPRECATED getNodeNumDiags() const =0
Number of diagonal entries on the calling process.
Tpetra::Classes::RowGraph::getDomainMap
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const =0
The Map associated with the domain of this graph.
Tpetra::Classes::RowGraph::isFillComplete
virtual bool isFillComplete() const =0
Whether fillComplete() has been called (without an intervening resumeFill()).
Tpetra_RowGraph_fwd.hpp
Forward declaration of Tpetra::RowGraph.
Tpetra::Classes::RowGraph::getNodeMaxNumRowEntries
virtual size_t getNodeMaxNumRowEntries() const =0
Returns the maximum number of entries across all rows/columns on this node.
Tpetra::Classes::RowGraph::getLocalRowCopy
virtual void getLocalRowCopy(LocalOrdinal LocalRow, const Teuchos::ArrayView< LocalOrdinal > &Indices, size_t &NumIndices) const =0
Extract a list of entries in a specified local row of the graph. Put into storage allocated by callin...
Tpetra::Classes::RowGraph::getGlobalMaxNumRowEntries
virtual size_t getGlobalMaxNumRowEntries() const =0
Returns the maximum number of entries across all rows/columns on all nodes.
Tpetra::Classes::RowGraph::getIndexBase
virtual GlobalOrdinal getIndexBase() const =0
Returns the index base for global indices for this graph.
Tpetra::Classes::RowGraph
An abstract interface for graphs accessed by rows.
Definition: Tpetra_RowGraph_decl.hpp:70
Tpetra::Classes::RowGraph::getExporter
virtual Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const =0
This graph's Export object.
Tpetra::Classes::RowGraph::isUpperTriangular
virtual bool TPETRA_DEPRECATED isUpperTriangular() const =0
Whether the graph is locally upper triangular.
Tpetra::Classes::Packable
Abstract base class for objects that can be the source of an Import or Export operation,...
Definition: Tpetra_Packable.hpp:101
Tpetra::Classes::RowGraph::pack
virtual void pack(const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Teuchos::Array< GlobalOrdinal > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets, Distributor &distor) const
Pack this object's data for Import or Export.
Definition: Tpetra_RowGraph_def.hpp:52
Tpetra::Classes::RowGraph::getRowMap
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const =0
The Map that describes this graph's distribution of rows over processes.
Tpetra::Classes::RowGraph::getLocalRowView
virtual void getLocalRowView(const LocalOrdinal lclRow, Teuchos::ArrayView< const LocalOrdinal > &lclColInds) const
Get a constant, nonpersisting, locally indexed view of the given row of the graph.
Definition: Tpetra_RowGraph_def.hpp:110
Tpetra::Classes::RowGraph::getImporter
virtual Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const =0
This graph's Import object.
Tpetra::Distributor
Sets up and executes a communication plan for a Tpetra DistObject.
Definition: Tpetra_Distributor.hpp:188
Tpetra::Classes::RowGraph::getGlobalNumEntries
virtual global_size_t getGlobalNumEntries() const =0
Returns the global number of entries in the graph.
Tpetra::Classes::RowGraph::isGloballyIndexed
virtual bool isGloballyIndexed() const =0
If graph indices are in the global range, this function returns true. Otherwise, this function return...
Tpetra::Details::DefaultTypes::local_ordinal_type
int local_ordinal_type
Default value of Scalar template parameter.
Definition: Tpetra_Details_DefaultTypes.hpp:72
Tpetra::Classes::RowGraph::getNodeNumCols
virtual size_t getNodeNumCols() const =0
Returns the number of columns connected to the locally owned rows of this graph.
Tpetra::Classes::RowGraph::getGlobalNumCols
virtual global_size_t getGlobalNumCols() const =0
Returns the number of global columns in the graph.
Tpetra::Classes::RowGraph::~RowGraph
virtual ~RowGraph()
Destructor (virtual for memory safety of derived classes).
Definition: Tpetra_RowGraph_decl.hpp:85
Tpetra::Classes::RowGraph::getNodeNumEntries
virtual size_t getNodeNumEntries() const =0
Returns the local number of entries in the graph.
Tpetra::Classes::RowGraph::supportsRowViews
virtual bool supportsRowViews() const
Whether this class implements getLocalRowView() and getGlobalRowView().
Definition: Tpetra_RowGraph_decl.hpp:245
Tpetra::Classes::RowGraph::getColMap
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const =0
The Map that describes this graph's distribution of columns over processes.
Tpetra::Classes::RowGraph::getComm
virtual Teuchos::RCP< const Teuchos::Comm< int > > getComm() const =0
The communicator over which this graph is distributed.
Tpetra::Classes::RowGraph::getNumEntriesInLocalRow
virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const =0
Returns the current number of entries on this node in the specified local row.
Tpetra::Classes::RowGraph::getNodeNumRows
virtual size_t getNodeNumRows() const =0
Returns the number of rows owned on the calling node.
Tpetra::global_size_t
size_t global_size_t
Global size_t object.
Definition: Tpetra_ConfigDefs.hpp:109
Tpetra
Namespace Tpetra contains the class and methods constituting the Tpetra library.
Tpetra::Classes::RowGraph::getRangeMap
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const =0
The Map associated with the range of this graph.
Tpetra_Packable.hpp
Declaration of Tpetra::Packable.
Tpetra::Classes::RowGraph::hasColMap
virtual bool hasColMap() const =0
Whether the graph has a well-defined column Map.
Tpetra::Classes::RowGraph::getGlobalNumRows
virtual global_size_t getGlobalNumRows() const =0
Returns the number of global rows in the graph.
Tpetra::Classes::RowGraph::isLocallyIndexed
virtual bool isLocallyIndexed() const =0
If graph indices are in the local range, this function returns true. Otherwise, this function returns...
Tpetra::Classes::RowGraph::local_ordinal_type
LocalOrdinal local_ordinal_type
The type of local indices in the graph.
Definition: Tpetra_RowGraph_decl.hpp:77