Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_TpetraCrsGraph_def.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Xpetra: A linear algebra interface package
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact
39 // Jonathan Hu (jhu@sandia.gov)
40 // Andrey Prokopenko (aprokop@sandia.gov)
41 // Ray Tuminaro (rstumin@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 #ifndef XPETRA_TPETRACRSGRAPH_DEF_HPP
47 #define XPETRA_TPETRACRSGRAPH_DEF_HPP
49 #include "Xpetra_Exceptions.hpp"
50 
51 #include "Tpetra_CrsGraph.hpp"
52 
53 #include "Xpetra_CrsGraph.hpp"
55 #include "Xpetra_Utils.hpp"
56 #include "Xpetra_TpetraMap.hpp"
57 #include "Xpetra_TpetraImport.hpp"
58 #include "Xpetra_TpetraExport.hpp"
59 
60 
61 namespace Xpetra {
62 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
63 #endif
64 
65 template<class LocalOrdinal, class GlobalOrdinal, class Node>
66 TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params)
67 : graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), maxNumEntriesPerRow, Tpetra::StaticProfile, params))) { }
68 
69 template<class LocalOrdinal, class GlobalOrdinal, class Node>
70 TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params)
71 : graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), NumEntriesPerRowToAlloc(), Tpetra::StaticProfile, params))) { }
72 
73 template<class LocalOrdinal, class GlobalOrdinal, class Node>
74 TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params)
75 : graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), toTpetra(colMap), maxNumEntriesPerRow, Tpetra::StaticProfile, params))) { }
76 
77 template<class LocalOrdinal, class GlobalOrdinal, class Node>
78 TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params)
79 : graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), toTpetra(colMap), NumEntriesPerRowToAlloc(), Tpetra::StaticProfile, params))) { }
80 
81 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
82 template<class LocalOrdinal, class GlobalOrdinal, class Node>
84 TpetraCrsGraph(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
85  const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
86  const typename local_graph_type::row_map_type& rowPointers,
87  const typename local_graph_type::entries_type::non_const_type& columnIndices,
88  const Teuchos::RCP< Teuchos::ParameterList > &plist)
89  : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, plist))) { }
90 
91 
92 template<class LocalOrdinal, class GlobalOrdinal, class Node>
94 TpetraCrsGraph(const Teuchos::RCP<const map_type>& rowMap,
95  const Teuchos::RCP<const map_type>& colMap,
96  const local_graph_type& lclGraph,
97  const Teuchos::RCP<Teuchos::ParameterList>& params)
98  : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), lclGraph, params))) { }
99 
100 template<class LocalOrdinal, class GlobalOrdinal, class Node>
102 TpetraCrsGraph(const local_graph_type& lclGraph,
103  const Teuchos::RCP<const map_type>& rowMap,
104  const Teuchos::RCP<const map_type>& colMap,
105  const Teuchos::RCP<const map_type>& domainMap,
106  const Teuchos::RCP<const map_type>& rangeMap,
107  const Teuchos::RCP<Teuchos::ParameterList>& params)
108  : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph, toTpetra(rowMap), toTpetra(colMap), toTpetra(domainMap), toTpetra(rangeMap), params))) { }
109 #endif
110 
111 template<class LocalOrdinal, class GlobalOrdinal, class Node>
113 
114 template<class LocalOrdinal, class GlobalOrdinal, class Node>
115 void TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
116 { XPETRA_MONITOR("TpetraCrsGraph::insertGlobalIndices"); graph_->insertGlobalIndices(globalRow, indices); }
117 
118 template<class LocalOrdinal, class GlobalOrdinal, class Node>
119 void TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
120 { XPETRA_MONITOR("TpetraCrsGraph::insertLocalIndices"); graph_->insertLocalIndices(localRow, indices); }
121 
122 template<class LocalOrdinal, class GlobalOrdinal, class Node>
124 { XPETRA_MONITOR("TpetraCrsGraph::removeLocalIndices"); graph_->removeLocalIndices(localRow); }
125 
126 template<class LocalOrdinal, class GlobalOrdinal, class Node>
127 void TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params)
128 { XPETRA_MONITOR("TpetraCrsGraph::fillComplete"); graph_->fillComplete(toTpetra(domainMap), toTpetra(rangeMap), params); }
129 
130 template<class LocalOrdinal, class GlobalOrdinal, class Node>
132 { XPETRA_MONITOR("TpetraCrsGraph::fillComplete"); graph_->fillComplete(params); }
133 
134 template<class LocalOrdinal, class GlobalOrdinal, class Node>
136 { XPETRA_MONITOR("TpetraCrsGraph::getComm"); return graph_->getComm(); }
137 
138 template<class LocalOrdinal, class GlobalOrdinal, class Node>
139 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getRowMap() const
140 { XPETRA_MONITOR("TpetraCrsGraph::getRowMap"); return toXpetra(graph_->getRowMap()); }
141 
142 template<class LocalOrdinal, class GlobalOrdinal, class Node>
143 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getColMap() const
144 { XPETRA_MONITOR("TpetraCrsGraph::getColMap"); return toXpetra(graph_->getColMap()); }
145 
146 template<class LocalOrdinal, class GlobalOrdinal, class Node>
147 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getDomainMap() const
148 { XPETRA_MONITOR("TpetraCrsGraph::getDomainMap"); return toXpetra(graph_->getDomainMap()); }
149 
150 template<class LocalOrdinal, class GlobalOrdinal, class Node>
151 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getRangeMap() const
152 { XPETRA_MONITOR("TpetraCrsGraph::getRangeMap"); return toXpetra(graph_->getRangeMap()); }
153 
154 template<class LocalOrdinal, class GlobalOrdinal, class Node>
155 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getImporter() const
156 { XPETRA_MONITOR("TpetraCrsGraph::getImporter"); return toXpetra(graph_->getImporter()); }
157 
158 template<class LocalOrdinal, class GlobalOrdinal, class Node>
159 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getExporter() const
160 { XPETRA_MONITOR("TpetraCrsGraph::getExporter"); return toXpetra(graph_->getExporter()); }
161 
162 template<class LocalOrdinal, class GlobalOrdinal, class Node>
164 { XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumRows"); return graph_->getGlobalNumRows(); }
165 
166 template<class LocalOrdinal, class GlobalOrdinal, class Node>
168 { XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumCols"); return graph_->getGlobalNumCols(); }
169 
170 template<class LocalOrdinal, class GlobalOrdinal, class Node>
172 { XPETRA_MONITOR("TpetraCrsGraph::getNodeNumRows"); return graph_->getNodeNumRows(); }
173 
174 template<class LocalOrdinal, class GlobalOrdinal, class Node>
176 { XPETRA_MONITOR("TpetraCrsGraph::getNodeNumCols"); return graph_->getNodeNumCols(); }
177 
178 template<class LocalOrdinal, class GlobalOrdinal, class Node>
180 { XPETRA_MONITOR("TpetraCrsGraph::getIndexBase"); return graph_->getIndexBase(); }
181 
182 template<class LocalOrdinal, class GlobalOrdinal, class Node>
184 { XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumEntries"); return graph_->getGlobalNumEntries(); }
185 
186 template<class LocalOrdinal, class GlobalOrdinal, class Node>
188 { XPETRA_MONITOR("TpetraCrsGraph::getNodeNumEntries"); return graph_->getNodeNumEntries(); }
189 
190 template<class LocalOrdinal, class GlobalOrdinal, class Node>
192 { XPETRA_MONITOR("TpetraCrsGraph::getNumEntriesInGlobalRow"); return graph_->getNumEntriesInGlobalRow(globalRow); }
193 
194 template<class LocalOrdinal, class GlobalOrdinal, class Node>
196 { XPETRA_MONITOR("TpetraCrsGraph::getNumEntriesInLocalRow"); return graph_->getNumEntriesInLocalRow(localRow); }
197 
198 template<class LocalOrdinal, class GlobalOrdinal, class Node>
200 { XPETRA_MONITOR("TpetraCrsGraph::getNumAllocatedEntriesInGlobalRow"); return graph_->getNumAllocatedEntriesInGlobalRow(globalRow); }
201 
202 template<class LocalOrdinal, class GlobalOrdinal, class Node>
204 { XPETRA_MONITOR("TpetraCrsGraph::getNumAllocatedEntriesInLocalRow"); return graph_->getNumAllocatedEntriesInLocalRow(localRow); }
205 
206 template<class LocalOrdinal, class GlobalOrdinal, class Node>
208 { XPETRA_MONITOR("TpetraCrsGraph::getGlobalMaxNumRowEntries"); return graph_->getGlobalMaxNumRowEntries(); }
209 
210 template<class LocalOrdinal, class GlobalOrdinal, class Node>
212 { XPETRA_MONITOR("TpetraCrsGraph::getNodeMaxNumRowEntries"); return graph_->getNodeMaxNumRowEntries(); }
213 
214 template<class LocalOrdinal, class GlobalOrdinal, class Node>
216 { XPETRA_MONITOR("TpetraCrsGraph::hasColMap"); return graph_->hasColMap(); }
217 
218 template<class LocalOrdinal, class GlobalOrdinal, class Node>
220 { XPETRA_MONITOR("TpetraCrsGraph::isLocallyIndexed"); return graph_->isLocallyIndexed(); }
221 
222 template<class LocalOrdinal, class GlobalOrdinal, class Node>
224 { XPETRA_MONITOR("TpetraCrsGraph::isGloballyIndexed"); return graph_->isGloballyIndexed(); }
225 
226 template<class LocalOrdinal, class GlobalOrdinal, class Node>
228 { XPETRA_MONITOR("TpetraCrsGraph::isFillComplete"); return graph_->isFillComplete(); }
229 
230 template<class LocalOrdinal, class GlobalOrdinal, class Node>
232 { XPETRA_MONITOR("TpetraCrsGraph::isStorageOptimized"); return graph_->isStorageOptimized(); }
233 
234 template<class LocalOrdinal, class GlobalOrdinal, class Node>
235 void TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
236 { XPETRA_MONITOR("TpetraCrsGraph::getGlobalRowView"); graph_->getGlobalRowView(GlobalRow, Indices); }
237 
238 template<class LocalOrdinal, class GlobalOrdinal, class Node>
239 void TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
240 { XPETRA_MONITOR("TpetraCrsGraph::getLocalRowView"); graph_->getLocalRowView(LocalRow, indices); }
241 
242 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
243 template<class LocalOrdinal, class GlobalOrdinal, class Node>
245  return getTpetra_CrsGraph()->getLocalGraph();
246 }
247 #endif
248 
249 template<class LocalOrdinal, class GlobalOrdinal, class Node>
251  // mfh 07 May 2018: See GitHub Issue #2565.
252  graph_->computeGlobalConstants();
253  }
254 
255 template<class LocalOrdinal, class GlobalOrdinal, class Node>
257 { XPETRA_MONITOR("TpetraCrsGraph::description"); return graph_->description(); }
258 
259 template<class LocalOrdinal, class GlobalOrdinal, class Node>
260 void TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
261 { XPETRA_MONITOR("TpetraCrsGraph::describe"); graph_->describe(out, verbLevel); }
262 
263 template<class LocalOrdinal, class GlobalOrdinal, class Node>
265 { XPETRA_MONITOR("TpetraCrsGraph::getNodeRowPtrs"); return graph_->getNodeRowPtrs(); }
266 
267 template<class LocalOrdinal, class GlobalOrdinal, class Node>
268 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getMap() const
269 { XPETRA_MONITOR("TpetraCrsGraph::getMap"); return rcp( new TpetraMap< LocalOrdinal, GlobalOrdinal, Node >(graph_->getMap()) ); }
270 
271 template<class LocalOrdinal, class GlobalOrdinal, class Node>
274  XPETRA_MONITOR("TpetraCrsGraph::doImport");
275 
276  XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, source, tSource, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
277  RCP< const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_CrsGraph();
278  //graph_->doImport(toTpetraCrsGraph(source), *tImporter.getTpetra_Import(), toTpetra(CM));
279 
280  graph_->doImport(*v, toTpetra(importer), toTpetra(CM));
281 }
282 
283 template<class LocalOrdinal, class GlobalOrdinal, class Node>
286  XPETRA_MONITOR("TpetraCrsGraph::doExport");
287 
288  XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, dest, tDest, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
289  RCP< const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_CrsGraph();
290  graph_->doExport(*v, toTpetra(importer), toTpetra(CM));
291 
292 }
293 
294 template<class LocalOrdinal, class GlobalOrdinal, class Node>
297  XPETRA_MONITOR("TpetraCrsGraph::doImport");
298 
299  XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, source, tSource, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
300  RCP< const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_CrsGraph();
301 
302  graph_->doImport(*v, toTpetra(exporter), toTpetra(CM));
303 
304 }
305 
306 template<class LocalOrdinal, class GlobalOrdinal, class Node>
309  XPETRA_MONITOR("TpetraCrsGraph::doExport");
310 
311  XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, dest, tDest, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
312  RCP< const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_CrsGraph();
313 
314  graph_->doExport(*v, toTpetra(exporter), toTpetra(CM));
315 
316 }
317 
318 template<class LocalOrdinal, class GlobalOrdinal, class Node>
319 TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) : graph_(graph)
320 { }
321 
322 template<class LocalOrdinal, class GlobalOrdinal, class Node>
323 RCP< const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getTpetra_CrsGraph() const
324 { return graph_; }
325 
326 
327 #ifdef HAVE_XPETRA_EPETRA
328 
329 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
330  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
331 
332  // specialization of TpetraCrsGraph for GO=LO=int
333  template <>
334  class TpetraCrsGraph<int,int,EpetraNode>
335  : public CrsGraph<int,int,EpetraNode>
336  {
337  typedef int LocalOrdinal;
338  typedef int GlobalOrdinal;
339  typedef EpetraNode Node;
340 
341  // The following typedef is used by the XPETRA_DYNAMIC_CAST() macro.
344 
345  public:
346 
348 
349 
351  TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null) {
353  }
354 
356  TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null) {
358  }
359 
361  TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null) {
363  }
364 
366  TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null) {
368  }
369 
370 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
371  TpetraCrsGraph(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
391  const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
392  const typename local_graph_type::row_map_type& rowPointers,
393  const typename local_graph_type::entries_type::non_const_type& columnIndices,
394  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
397  "int",
398  typeid(EpetraNode).name());
399  }
400 
419  TpetraCrsGraph(const Teuchos::RCP<const map_type>& rowMap,
420  const Teuchos::RCP<const map_type>& colMap,
421  const local_graph_type& lclGraph,
422  const Teuchos::RCP<Teuchos::ParameterList>& params) {
423  XPETRA_TPETRA_ETI_EXCEPTION( typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
424  typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
425  "int",
426  typeid(EpetraNode).name());
427  }
428 
453  TpetraCrsGraph(const local_graph_type& lclGraph,
454  const Teuchos::RCP<const map_type>& rowMap,
455  const Teuchos::RCP<const map_type>& colMap,
456  const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
457  const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
458  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
459  XPETRA_TPETRA_ETI_EXCEPTION( typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
460  typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
461  "int",
462  typeid(EpetraNode).name());
463  }
464 #endif
465 
467  virtual ~TpetraCrsGraph() { }
468 
470 
472 
473 
475  void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices) { }
476 
478  void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices) { }
479 
481  void removeLocalIndices(LocalOrdinal localRow) { }
482 
484 
486 
487 
489  void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null) { }
490 
492  void fillComplete(const RCP< ParameterList > &params=null) { }
493 
495 
497 
498 
500  RCP< const Comm< int > > getComm() const { return Teuchos::null; }
501 
503  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const { return Teuchos::null; }
504 
506  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const { return Teuchos::null; }
507 
509  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const { return Teuchos::null; }
510 
512  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const { return Teuchos::null; }
513 
515  RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const { return Teuchos::null; }
516 
518  RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const { return Teuchos::null; }
519 
521  global_size_t getGlobalNumRows() const { return 0; }
522 
524  global_size_t getGlobalNumCols() const { return 0; }
525 
527  size_t getNodeNumRows() const { return 0; }
528 
530  size_t getNodeNumCols() const { return 0; }
531 
533  GlobalOrdinal getIndexBase() const { return 0; }
534 
536  global_size_t getGlobalNumEntries() const { return 0; }
537 
539  size_t getNodeNumEntries() const { return 0; }
540 
542  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
543 
545  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
546 
548  size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
549 
551  size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
552 
554  size_t getGlobalMaxNumRowEntries() const { return 0; }
555 
557  size_t getNodeMaxNumRowEntries() const { return 0; }
558 
560  bool hasColMap() const { return false; }
561 
563  bool isLocallyIndexed() const { return false; }
564 
566  bool isGloballyIndexed() const { return false; }
567 
569  bool isFillComplete() const { return false; }
570 
572  bool isStorageOptimized() const { return false; }
573 
575  void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const { }
576 
578  void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const { }
579 
580 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
581  local_graph_type getLocalGraph () const {
583  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::RuntimeError,
584  "Epetra does not support Kokkos::StaticCrsGraph!");
585  TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
586  }
587 #endif
588 
591 
593 
595 
596 
598  std::string description() const { return std::string(""); }
599 
601  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const { }
602 
604 
606 
607 
609  ArrayRCP< const size_t > getNodeRowPtrs() const { return Teuchos::ArrayRCP< const size_t>(); }
610 
612 
614  //{@
615 
617  Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const { return Teuchos::null; }
618 
622 
626 
630 
634 
635  // @}
636 
638 
639 
641  TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
643  }
644 
646  RCP< const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > getTpetra_CrsGraph() const { return Teuchos::null; }
647 
649  }; // TpetraCrsGraph class (specialization for LO=GO=int and NO=EpetraNode)
650 #endif
651 
652 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
653  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
654 
655  // specialization of TpetraCrsGraph for GO=long long and NO=EpetraNode
656  template <>
657  class TpetraCrsGraph<int,long long,EpetraNode>
658  : public CrsGraph<int,long long,EpetraNode>
659  {
660  typedef int LocalOrdinal;
661  typedef long long GlobalOrdinal;
662  typedef EpetraNode Node;
663 
664  // The following typedef is used by the XPETRA_DYNAMIC_CAST() macro.
667 
668  public:
669 
671 
672 
674  TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null) {
676  }
677 
679  TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null) {
681  }
682 
684  TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null) {
686  }
687 
689  TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null) {
691  }
692 
693 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
694  TpetraCrsGraph(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
714  const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
715  const typename local_graph_type::row_map_type& rowPointers,
716  const typename local_graph_type::entries_type::non_const_type& columnIndices,
717  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
720  "int",
721  typeid(EpetraNode).name());
722  }
723 
742  TpetraCrsGraph(const Teuchos::RCP<const map_type>& rowMap,
743  const Teuchos::RCP<const map_type>& colMap,
744  const local_graph_type& lclGraph,
745  const Teuchos::RCP<Teuchos::ParameterList>& params) {
746  XPETRA_TPETRA_ETI_EXCEPTION( typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
747  typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
748  "int",
749  typeid(EpetraNode).name());
750  }
751 
776  TpetraCrsGraph(const local_graph_type& lclGraph,
777  const Teuchos::RCP<const map_type>& rowMap,
778  const Teuchos::RCP<const map_type>& colMap,
779  const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
780  const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
781  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
782  XPETRA_TPETRA_ETI_EXCEPTION( typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
783  typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
784  "int",
785  typeid(EpetraNode).name());
786  }
787 #endif
788 
790  virtual ~TpetraCrsGraph() { }
791 
793 
795 
796 
798  void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices) { }
799 
801  void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices) { }
802 
804  void removeLocalIndices(LocalOrdinal localRow) { }
805 
807 
809 
810 
812  void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null) { }
813 
815  void fillComplete(const RCP< ParameterList > &params=null) { }
816 
818 
820 
821 
823  RCP< const Comm< int > > getComm() const { return Teuchos::null; }
824 
826  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const { return Teuchos::null; }
827 
829  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const { return Teuchos::null; }
830 
832  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const { return Teuchos::null; }
833 
835  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const { return Teuchos::null; }
836 
838  RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const { return Teuchos::null; }
839 
841  RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const { return Teuchos::null; }
842 
844  global_size_t getGlobalNumRows() const { return 0; }
845 
847  global_size_t getGlobalNumCols() const { return 0; }
848 
850  size_t getNodeNumRows() const { return 0; }
851 
853  size_t getNodeNumCols() const { return 0; }
854 
856  GlobalOrdinal getIndexBase() const { return 0; }
857 
859  global_size_t getGlobalNumEntries() const { return 0; }
860 
862  size_t getNodeNumEntries() const { return 0; }
863 
865  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
866 
868  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
869 
871  size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
872 
874  size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
875 
877  size_t getGlobalMaxNumRowEntries() const { return 0; }
878 
880  size_t getNodeMaxNumRowEntries() const { return 0; }
881 
883  bool hasColMap() const { return false; }
884 
886  bool isLocallyIndexed() const { return false; }
887 
889  bool isGloballyIndexed() const { return false; }
890 
892  bool isFillComplete() const { return false; }
893 
895  bool isStorageOptimized() const { return false; }
896 
898  void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const { }
899 
901  void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const { }
902 
903 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
904  local_graph_type getLocalGraph () const {
906  TEUCHOS_TEST_FOR_EXCEPTION(true, Xpetra::Exceptions::RuntimeError,
907  "Epetra does not support Kokkos::StaticCrsGraph!");
908  TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
909  }
910 #endif
911 
914 
916 
918 
919 
921  std::string description() const { return std::string(""); }
922 
924  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const { }
925 
927 
929 
930 
932  ArrayRCP< const size_t > getNodeRowPtrs() const { return Teuchos::ArrayRCP< const size_t>(); }
933 
935 
937  //{@
938 
940  Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const { return Teuchos::null; }
941 
945 
949 
953 
957 
958  // @}
959 
961 
962 
964  TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
966  }
967 
969  RCP< const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > getTpetra_CrsGraph() const { return Teuchos::null; }
970 
972  }; // TpetraCrsGraph class (specialization for GO=long long and NO=EpetraNode)
973 #endif
974 
975 #endif // HAVE_XPETRA_EPETRA
976 
977 
978 } // Xpetra namespace
979 #endif //XPETRA_TPETRACRSGRAPH_DEF_HPP
980 
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null)
Constructor specifying column Map and fixed number of entries for each row.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null)
Constructor specifying (possibly different) number of entries in each row.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null)
Constructor specifying (possibly different) number of entries in each row.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null)
Constructor specifying column Map and number of entries in each row.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
void computeGlobalConstants()
Force the computation of global constants if we don&#39;t have them.
Exception throws to report errors in the internal logical of the program.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
bool isStorageOptimized() const
Returns true if storage has been optimized.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null)
Constructor specifying fixed number of entries for each row.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
std::string description() const
Return a simple one-line description of this object.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
bool isStorageOptimized() const
Returns true if storage has been optimized.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
RCP< const Comm< int > > getComm() const
Returns the communicator.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
TpetraCrsGraph(const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
TpetraCrsGraph constructor to wrap a Tpetra::CrsGraph object.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
RCP< const Comm< int > > getComm() const
Returns the communicator.
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null)
Constructor specifying fixed number of entries for each row.
bool isStorageOptimized() const
Returns true if storage has been optimized.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
bool hasColMap() const
Whether the graph has a column Map.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
virtual ~TpetraCrsGraph()
Destructor.
RCP< const Comm< int > > getComm() const
Returns the communicator.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
size_t global_size_t
Global size_t object.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
TpetraCrsGraph(const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
TpetraCrsGraph constructor to wrap a Tpetra::CrsGraph object.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
bool hasColMap() const
Whether the graph has a column Map.
bool hasColMap() const
Whether the graph has a column Map.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null)
Constructor specifying column Map and fixed number of entries for each row.
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
void computeGlobalConstants()
Dummy implementation for computeGlobalConstants.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
CombineMode
Xpetra::Combine Mode enumerable type.
#define XPETRA_MONITOR(funcName)
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
std::string description() const
Return a simple one-line description of this object.
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
std::string description() const
Return a simple one-line description of this object.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null)
Constructor specifying column Map and number of entries in each row.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null)
Constructor specifying fixed number of entries for each row.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
void computeGlobalConstants()
Dummy implementation for computeGlobalConstants.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.