Tpetra Matrix/Vector Services  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Tpetra_RowGraph.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_HPP
43 #define TPETRA_ROWGRAPH_HPP
44 
45 #include <Teuchos_Describable.hpp>
46 #include <Kokkos_DefaultNode.hpp>
47 
48 #include "Tpetra_ConfigDefs.hpp"
49 #include "Tpetra_Map.hpp"
50 #include "Tpetra_Import.hpp"
51 #include "Tpetra_Export.hpp"
52 
53 namespace Tpetra
54 {
55 
57 
63  template <class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
64  class RowGraph : virtual public Teuchos::Describable {
65  public:
66  typedef LocalOrdinal local_ordinal_type;
67  typedef GlobalOrdinal global_ordinal_type;
68  typedef Node node_type;
69 
71 
72 
74  virtual ~RowGraph();
75 
77 
79 
80 
82  virtual const Teuchos::RCP<const Teuchos::Comm<int> > & getComm() const = 0;
83 
85  virtual Teuchos::RCP<Node> getNode() const = 0;
86 
88  virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & getRowMap() const = 0;
89 
91  virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & getColMap() const = 0;
92 
94  virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & getDomainMap() const = 0;
95 
97  virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & getRangeMap() const = 0;
98 
100  virtual Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > getImporter() const = 0;
101 
103  virtual Teuchos::RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > getExporter() const = 0;
104 
106  virtual global_size_t getGlobalNumRows() const = 0;
107 
109  virtual global_size_t getGlobalNumCols() const = 0;
110 
112  virtual size_t getNodeNumRows() const = 0;
113 
115  virtual size_t getNodeNumCols() const = 0;
116 
118  virtual GlobalOrdinal getIndexBase() const = 0;
119 
121  virtual global_size_t getGlobalNumEntries() const = 0;
122 
124  virtual size_t getNodeNumEntries() const = 0;
125 
127 
128  virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const = 0;
129 
131 
132  virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const = 0;
133 
135  virtual global_size_t getGlobalNumDiags() const = 0;
136 
138  virtual size_t getNodeNumDiags() const = 0;
139 
141  virtual size_t getGlobalMaxNumRowEntries() const = 0;
142 
144  virtual size_t getNodeMaxNumRowEntries() const = 0;
145 
147  virtual bool hasColMap() const = 0;
148 
150  virtual bool isLowerTriangular() const = 0;
151 
153  virtual bool isUpperTriangular() const = 0;
154 
156  virtual bool isLocallyIndexed() const = 0;
157 
159  virtual bool isGloballyIndexed() const = 0;
160 
162  virtual bool isFillComplete() const = 0;
163 
165 
167 
168 
170 
179  virtual void getGlobalRowCopy(GlobalOrdinal GlobalRow,
180  const Teuchos::ArrayView<GlobalOrdinal> &Indices,
181  size_t &NumIndices) const = 0;
182 
184 
193  virtual void getLocalRowCopy(LocalOrdinal LocalRow,
194  const Teuchos::ArrayView<LocalOrdinal> &Indices,
195  size_t &NumIndices) const = 0;
196 
198 
199  }; // class RowGraph
200 
201  template <class LocalOrdinal, class GlobalOrdinal, class Node>
203  }
204 
205 
206 } // namespace Tpetra
207 
208 #endif
virtual bool hasColMap() const =0
Indicates whether the graph has a well-defined column map.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getRangeMap() const =0
Returns the Map associated with the domain of this graph.
virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const =0
Returns the current number of entries on this node in the specified local row.
A pure virtual interface for row-partitioned graphs.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getRowMap() const =0
Returns the Map that describes the row distribution in this graph.
virtual GlobalOrdinal getIndexBase() const =0
Returns the index base for global indices for this graph.
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getDomainMap() const =0
Returns the Map associated with the domain of this graph.
virtual size_t getNodeNumCols() const =0
Returns the number of columns connected to the locally owned rows of this graph.
virtual size_t getNodeNumEntries() const =0
Returns the local number of entries in the graph.
virtual Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const =0
Returns the importer associated with this graph.
virtual size_t getNodeNumRows() const =0
Returns the number of rows owned on the calling node.
virtual size_t getNodeMaxNumRowEntries() const =0
Returns the maximum number of entries across all rows/columns on this node.
virtual Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const =0
Returns the exporter associated with this graph.
virtual bool isFillComplete() const =0
Returns true if fillComplete() has been called.
virtual bool isLowerTriangular() const =0
Indicates whether the graph is lower triangular.
size_t global_size_t
Global size_t object.
virtual global_size_t getGlobalNumRows() const =0
Returns the number of global rows in the graph.
virtual size_t getGlobalMaxNumRowEntries() const =0
Returns the maximum number of entries across all rows/columns on all nodes.
virtual global_size_t getGlobalNumCols() const =0
Returns the number of global columns in the graph.
virtual Teuchos::RCP< Node > getNode() const =0
Returns the underlying node.
virtual bool isUpperTriangular() const =0
Indicates whether the graph is upper triangular.
virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const =0
Returns the current number of entries on this node in the specified global row.
virtual ~RowGraph()
Destructor.
virtual bool isGloballyIndexed() const =0
If graph indices are in the global range, this function returns true. Otherwise, this function return...
virtual const Teuchos::RCP< const Teuchos::Comm< int > > & getComm() const =0
Returns the communicator.
virtual bool isLocallyIndexed() const =0
If graph indices are in the local range, this function returns true. Otherwise, this function returns...
virtual const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > & getColMap() const =0
Returns the Map that describes the column distribution in this graph.
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...
virtual global_size_t getGlobalNumDiags() const =0
Returns the number of global diagonal entries, based on global row/column index comparisons.
virtual global_size_t getGlobalNumEntries() const =0
Returns the global number of entries in the graph.
virtual size_t getNodeNumDiags() const =0
Returns the number of local diagonal entries, based on global row/column index comparisons.
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...