Xpetra_EpetraCrsGraph.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_EPETRACRSGRAPH_HPP
47 #define XPETRA_EPETRACRSGRAPH_HPP
48 
49 /* this file is automatically generated - do not edit (see script/epetra.py) */
50 
52 #include "Xpetra_Exceptions.hpp"
53 
54 #include "Xpetra_CrsGraph.hpp"
55 
56 #include "Xpetra_EpetraExport.hpp"
57 #include "Xpetra_EpetraImport.hpp"
58 #include "Xpetra_EpetraMap.hpp"
59 #include "Xpetra_EpetraUtils.hpp"
60 
61 #include <Epetra_CrsGraph.h>
62 
63 namespace Xpetra {
64 
65 // TODO: move that elsewhere
66 template<class GlobalOrdinal, class Node>
67 RCP< const CrsGraph<int, GlobalOrdinal, Node> >
68 toXpetra (const Epetra_CrsGraph& graph);
69 
70 template<class GlobalOrdinal, class Node>
71 const Epetra_CrsGraph&
72 toEpetra (const RCP<const CrsGraph<int, GlobalOrdinal, Node> > &graph);
73 
74 template<class GlobalOrdinal, class Node>
76  : public CrsGraph<int, GlobalOrdinal, Node>
77 {
78  typedef int LocalOrdinal;
79 
82 
83 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
84 #ifdef HAVE_XPETRA_TPETRA
87  typedef typename node_type::execution_space execution_space;
88 #endif
89 #endif
90 
91 public:
92 
94 
95  EpetraCrsGraphT(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
98  "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
99  }
100 
102  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=null) {
104  "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
105  }
106 
108  // Definition not in cpp, so comment out
109  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > &params=null) {
111  "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
112  }
113 
114 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
115 #ifdef HAVE_XPETRA_TPETRA
118  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
119  const typename local_graph_type::row_map_type& rowPointers,
120  const typename local_graph_type::entries_type::non_const_type& columnIndices,
121  const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
123  "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
124  }
125 
127  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
128  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
129  const local_graph_type& lclGraph,
130  const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
132  "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
133  }
134 
136  EpetraCrsGraphT(const local_graph_type& lclGraph,
137  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
138  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
139  const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
140  const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
141  const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
143  "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
144  }
145 #endif
146 #endif
147 
149  virtual ~EpetraCrsGraphT() { }
150 
152 
154 
155 
157  void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &indices) { }
158 
160  void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal> &indices) { }
161 
163  void removeLocalIndices(LocalOrdinal localRow) { }
164 
166 
168 
169 
171  void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null){ }
172 
174  void fillComplete(const RCP< ParameterList > &params=null) { }
176 
178 
179 
182  return Teuchos::null;
183  }
184 
187 
190 
193 
196 
199 
202 
204  global_size_t getGlobalNumRows() const { return 0; }
205 
207  global_size_t getGlobalNumCols() const { return 0; }
208 
210  size_t getNodeNumRows() const { return 0; }
211 
213  size_t getNodeNumCols() const { return 0; }
214 
216  GlobalOrdinal getIndexBase() const { return 0; }
217 
219  global_size_t getGlobalNumEntries() const { return 0; }
220 
222  size_t getNodeNumEntries() const { return 0; }
223 
225  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
226 
228  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
229 
231  size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
232 
234  size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
235 
237  size_t getGlobalMaxNumRowEntries() const { return 0; }
238 
240  size_t getNodeMaxNumRowEntries() const { return 0; }
241 
243  bool hasColMap() const { return false; }
244 
246  bool isLocallyIndexed() const { return false; }
247 
249  bool isGloballyIndexed() const { return false; }
250 
252  bool isFillComplete() const { return false; }
253 
255  bool isStorageOptimized() const { return false; }
256 
258  void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &Indices) const { }
259 
261  void getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &indices) const { }
262 
263 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
264 #ifdef HAVE_XPETRA_TPETRA
265  local_graph_type getLocalGraph () const {
267  "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
268  TEUCHOS_UNREACHABLE_RETURN((Kokkos::StaticCrsGraph<LocalOrdinal, Kokkos::LayoutLeft, execution_space>()));
269  }
270 #else
271 #ifdef __GNUC__
272 #warning "Xpetra Kokkos interface for CrsGraph is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
273 #endif
274 #endif
275 #endif
276 
277 
280 
282 
284 
285 
287  std::string description() const { return std::string(""); }
288 
291 
293 
295  //{@
296 
299 
303 
307 
311 
316 
318 
319 
323  "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
324  }
325 
327  RCP< const Epetra_CrsGraph> getEpetra_CrsGraph() const { return Teuchos::null; }
328 
330 
331 private:
332 
333 }; // EpetraCrsGraphT class
334 
335 // specialization on GO=int and Node=EpetraNode
336 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
337 template<>
339 : public virtual CrsGraph<int, int, EpetraNode>
340 {
341  typedef int LocalOrdinal;
342  typedef int GlobalOrdinal;
343  typedef EpetraNode Node;
344 
347 
348 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
349 #ifdef HAVE_XPETRA_TPETRA
352  typedef typename node_type::execution_space execution_space;
353 #endif
354 #endif
355 
356 public:
357 
359 
360  EpetraCrsGraphT(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const RCP< Teuchos::ParameterList > &/* plist */=Teuchos::null)
362 : graph_(Teuchos::rcp(new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), maxNumEntriesPerRow, toEpetra(pftype)))) { }
363 
364 
366  // Definition not in cpp, so comment out
367  //EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > &params=null);
368 
370  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &/* plist */=null)
371  : graph_(Teuchos::rcp(new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), maxNumEntriesPerRow, toEpetra(pftype)))) { }
372 
374  // Definition not in cpp, so comment out
375  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > &/* params */=null) {
376  Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end()); // convert array of "size_t" to array of "int"
377  graph_ = Teuchos::rcp(new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), numEntriesPerRowToAlloc.getRawPtr(), toEpetra(pftype)));
378  }
379 
380 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
381 #ifdef HAVE_XPETRA_TPETRA
382  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* rowMap */,
384  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* colMap */,
385  const typename local_graph_type::row_map_type& /* rowPointers */,
386  const typename local_graph_type::entries_type::non_const_type& /* columnIndices */,
387  const RCP< Teuchos::ParameterList > &/* plist */=Teuchos::null) {
389  "Epetra does not support CrsGraph constructors using Kokkos Views!");
390  }
391 
393  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* rowMap */,
394  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* colMap */,
395  const local_graph_type& /* lclGraph */,
396  const RCP< Teuchos::ParameterList > &/* plist */=Teuchos::null) {
398  "Epetra does not support CrsGraph constructors using a local graph!");
399  }
400 
402  EpetraCrsGraphT(const local_graph_type& /* lclGraph */,
403  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* rowMap */,
404  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* colMap */,
405  const Teuchos::RCP<const map_type>& /* domainMap */ = Teuchos::null,
406  const Teuchos::RCP<const map_type>& /* rangeMap */ = Teuchos::null,
407  const RCP< Teuchos::ParameterList > &/* plist */=Teuchos::null) {
409  "Epetra does not support CrsGraph constructors using a local graph!");
410  }
411 #endif
412 #endif
413 
415  virtual ~EpetraCrsGraphT() { }
416 
418 
420 
421 
424  XPETRA_MONITOR("EpetraCrsGraphT::insertGlobalIndices");
425 
426  GlobalOrdinal* indices_rawPtr = const_cast<GlobalOrdinal*>(indices.getRawPtr()); // there is no const in the Epetra interface :(
427  XPETRA_ERR_CHECK(graph_->InsertGlobalIndices(globalRow, indices.size(), indices_rawPtr));
428  }
429 
431  void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal> &indices) {
432  XPETRA_MONITOR("EpetraCrsGraphT::insertLocalIndices");
433 
434  int* indices_rawPtr = const_cast<int*>(indices.getRawPtr()); // there is no const in the Epetra interface :(
435  XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr));
436  }
437 
439  void removeLocalIndices(LocalOrdinal localRow) { XPETRA_MONITOR("EpetraCrsGraphT::removeLocalIndices"); graph_->RemoveMyIndices(localRow); }
440 
442 
444 
445 
447  void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null){
448  XPETRA_MONITOR("EpetraCrsGraphT::fillComplete");
449 
450  graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
451  bool doOptimizeStorage = true;
452  if (params != null && params->get("Optimize Storage",true) == false) doOptimizeStorage = false;
453  if (doOptimizeStorage) graph_->OptimizeStorage();
454  }
455 
457  void fillComplete(const RCP< ParameterList > &params=null) {
458  XPETRA_MONITOR("EpetraCrsGraphT::fillComplete");
459 
460  graph_->FillComplete();
461  bool doOptimizeStorage = true;
462  if (params != null && params->get("Optimize Storage",true) == false) doOptimizeStorage = false;
463  if (doOptimizeStorage) graph_->OptimizeStorage();
464  }
466 
468 
469 
472  XPETRA_MONITOR("EpetraCrsGraphT::getComm");
473  return toXpetra (graph_->Comm ());
474  }
475 
477  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getRowMap"); return toXpetra<GlobalOrdinal,Node>(graph_->RowMap()); }
478 
480  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getColMap"); return toXpetra<GlobalOrdinal,Node>(graph_->ColMap()); }
481 
483  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getDomainMap"); return toXpetra<GlobalOrdinal,Node>(graph_->DomainMap()); }
484 
486  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getRangeMap"); return toXpetra<GlobalOrdinal,Node>(graph_->RangeMap()); }
487 
489  RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const { XPETRA_MONITOR("EpetraCrsGraphT::getImporter"); return toXpetra<GlobalOrdinal,Node>(graph_->Importer()); }
490 
492  RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const { XPETRA_MONITOR("EpetraCrsGraphT::getExporter"); return toXpetra<GlobalOrdinal,Node>(graph_->Exporter()); }
493 
495  global_size_t getGlobalNumRows() const { XPETRA_MONITOR("EpetraCrsGraphT::getGlobalNumRows"); return graph_->NumGlobalRows64(); }
496 
498  global_size_t getGlobalNumCols() const { XPETRA_MONITOR("EpetraCrsGraphT::getGlobalNumCols"); return graph_->NumGlobalCols64(); }
499 
501  size_t getNodeNumRows() const { XPETRA_MONITOR("EpetraCrsGraphT::getNodeNumRows"); return graph_->NumMyRows(); }
502 
504  size_t getNodeNumCols() const { XPETRA_MONITOR("EpetraCrsGraphT::getNodeNumCols"); return graph_->NumMyCols(); }
505 
507  GlobalOrdinal getIndexBase() const { XPETRA_MONITOR("EpetraCrsGraphT::getIndexBase"); return (GlobalOrdinal) graph_->IndexBase64(); }
508 
510  global_size_t getGlobalNumEntries() const { XPETRA_MONITOR("EpetraCrsGraphT::getGlobalNumEntries"); return graph_->NumGlobalEntries64(); }
511 
513  size_t getNodeNumEntries() const { XPETRA_MONITOR("EpetraCrsGraphT::getNodeNumEntries"); return graph_->NumMyEntries(); }
514 
516  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { XPETRA_MONITOR("EpetraCrsGraphT::getNumEntriesInGlobalRow"); return graph_->NumGlobalIndices(globalRow); }
517 
519  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { XPETRA_MONITOR("EpetraCrsGraphT::getNumEntriesInLocalRow"); return graph_->NumMyIndices(localRow); }
520 
522  size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { XPETRA_MONITOR("EpetraCrsGraphT::getNumAllocatedEntriesInGlobalRow"); return graph_->NumAllocatedGlobalIndices(globalRow); }
523 
525  size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { XPETRA_MONITOR("EpetraCrsGraphT::getNumAllocatedEntriesInLocalRow"); return graph_->NumAllocatedMyIndices(localRow); }
526 
528  size_t getGlobalMaxNumRowEntries() const { XPETRA_MONITOR("EpetraCrsGraphT::getGlobalMaxNumRowEntries"); return graph_->GlobalMaxNumIndices(); }
529 
531  size_t getNodeMaxNumRowEntries() const { XPETRA_MONITOR("EpetraCrsGraphT::getNodeMaxNumRowEntries"); return graph_->MaxNumIndices(); }
532 
534  bool hasColMap() const { XPETRA_MONITOR("EpetraCrsGraphT::hasColMap"); return graph_->HaveColMap(); }
535 
537  bool isLocallyIndexed() const { XPETRA_MONITOR("EpetraCrsGraphT::isLocallyIndexed"); return graph_->IndicesAreLocal(); }
538 
540  bool isGloballyIndexed() const { XPETRA_MONITOR("EpetraCrsGraphT::isGloballyIndexed"); return graph_->IndicesAreGlobal(); }
541 
543  bool isFillComplete() const { XPETRA_MONITOR("EpetraCrsGraphT::isFillComplete"); return graph_->Filled(); }
544 
546  bool isStorageOptimized() const { XPETRA_MONITOR("EpetraCrsGraphT::isStorageOptimized"); return graph_->StorageOptimized(); }
547 
550  XPETRA_MONITOR("EpetraCrsGraphT::getGlobalRowView");
551 
552  int numEntries;
553  GlobalOrdinal * eIndices;
554 
555  XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices));
556  if (numEntries == 0) { eIndices = NULL; } // Cf. TEUCHOS_TEST_FOR_EXCEPT( p == 0 && size_in != 0 ) in Teuchos ArrayView constructor.
557 
558  Indices = ArrayView<const GlobalOrdinal>(eIndices, numEntries);
559  }
560 
563  XPETRA_MONITOR("EpetraCrsGraphT::getLocalRowView");
564 
565  int numEntries;
566  int * eIndices;
567 
568  XPETRA_ERR_CHECK(graph_->ExtractMyRowView(LocalRow, numEntries, eIndices));
569  if (numEntries == 0) { eIndices = NULL; } // Cf. TEUCHOS_TEST_FOR_EXCEPT( p == 0 && size_in != 0 ) in Teuchos ArrayView constructor.
570 
571  indices = ArrayView<const int>(eIndices, numEntries);
572  }
573 
574 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
575 #ifdef HAVE_XPETRA_TPETRA
576  local_graph_type getLocalGraph () const {
578  "Epetra does not support Kokkos::StaticCrsGraph!");
579  TEUCHOS_UNREACHABLE_RETURN((Kokkos::StaticCrsGraph<LocalOrdinal, Kokkos::LayoutLeft, execution_space>()));
580  }
581 #else
582 #ifdef __GNUC__
583 #warning "Xpetra Kokkos interface for CrsGraph is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
584 #endif
585 #endif
586 #endif
587 
590 
591 
593 
594 
595 
597 
598 
600  std::string description() const { XPETRA_MONITOR("EpetraCrsGraphT::description"); return "NotImplemented"; }
601 
604  XPETRA_MONITOR("EpetraCrsGraphT::describe");
605 
606  out << "EpetraCrsGraphT::describe : Warning, verbosity level is ignored by this method." << std::endl;
607  const Epetra_BlockMap rowmap = graph_->RowMap();
608  if (rowmap.Comm().MyPID() == 0) out << "** EpetraCrsGraphT **\n\nrowmap" << std::endl;
609  rowmap.Print(out);
610  graph_->Print(out);
611  }
612 
614 
616  //{@
617 
619  Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getMap"); return toXpetra<GlobalOrdinal,Node>(graph_->Map()); }
620 
624  XPETRA_MONITOR("EpetraCrsGraphT::doImport");
625 
626  XPETRA_DYNAMIC_CAST(const EpetraCrsGraphT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraCrsGraphT as input arguments.");
627  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraImportT as input arguments.");
628 
629  RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
630  int err = graph_->Import(*v, *tImporter.getEpetra_Import(), toEpetra(CM));
631  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
632  }
633 
637  XPETRA_MONITOR("EpetraCrsGraphT::doExport");
638 
639  XPETRA_DYNAMIC_CAST(const EpetraCrsGraphT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraCrsGraphT as input arguments.");
640  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraImportT as input arguments.");
641 
642  RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
643  int err = graph_->Export(*v, *tImporter.getEpetra_Import(), toEpetra(CM));
644  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
645  }
646 
650  XPETRA_MONITOR("EpetraCrsGraphT::doImport");
651 
652  XPETRA_DYNAMIC_CAST(const EpetraCrsGraphT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraCrsGraphT as input arguments.");
653  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraImportT as input arguments.");
654 
655  RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
656  int err = graph_->Import(*v, *tExporter.getEpetra_Export(), toEpetra(CM));
657  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
658 
659  }
660 
664  XPETRA_MONITOR("EpetraCrsGraphT::doExport");
665 
666  XPETRA_DYNAMIC_CAST(const EpetraCrsGraphT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraCrsGraphT as input arguments.");
667  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraImportT as input arguments.");
668 
669  RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
670  int err = graph_->Export(*v, *tExporter.getEpetra_Export(), toEpetra(CM));
671  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
672  }
674 
676 
677 
679  EpetraCrsGraphT(const Teuchos::RCP<Epetra_CrsGraph> &graph) : graph_(graph) {
680  TEUCHOS_TEST_FOR_EXCEPTION(!graph->RowMap().GlobalIndicesIsType<GlobalOrdinal>(), std::runtime_error, "Xpetra::EpetraCrsGraphT: GlobalOrdinal mismatch.");
681  }
682 
685 
687 
688 private:
689 
691 
692 
693 };
694 
695 #endif // specialization on Node=EpetraNode and GO=int
696 
697 // specialization on GO=long long and Node=EpetraNode
698 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
699 template<>
700 class EpetraCrsGraphT<long long, EpetraNode>
701 : public virtual CrsGraph<int, long long, EpetraNode>
702 {
703  typedef int LocalOrdinal;
704  typedef long long GlobalOrdinal;
705  typedef EpetraNode Node;
706 
709 
710 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
711 #ifdef HAVE_XPETRA_TPETRA
714  typedef typename node_type::execution_space execution_space;
715 #endif
716 #endif
717 
718 public:
719 
721 
722  EpetraCrsGraphT(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const RCP< Teuchos::ParameterList > &/* plist */=Teuchos::null)
724 : graph_(Teuchos::rcp(new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), maxNumEntriesPerRow, toEpetra(pftype)))) { }
725 
726 
728  // Definition not in cpp, so comment out
729  //EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > &params=null);
730 
732  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &/* plist */=null)
733  : graph_(Teuchos::rcp(new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), maxNumEntriesPerRow, toEpetra(pftype)))) { }
734 
736  // Definition not in cpp, so comment out
737  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > &/* params */=null) {
738  Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end()); // convert array of "size_t" to array of "int"
739  graph_ = Teuchos::rcp(new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), numEntriesPerRowToAlloc.getRawPtr(), toEpetra(pftype)));
740  }
741 
742 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
743 #ifdef HAVE_XPETRA_TPETRA
744  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* rowMap */,
746  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* colMap */,
747  const typename local_graph_type::row_map_type& /* rowPointers */,
748  const typename local_graph_type::entries_type::non_const_type& /* columnIndices */,
749  const RCP< Teuchos::ParameterList > &/* plist */=Teuchos::null) {
751  "Epetra does not support CrsGraph constructors using Kokkos Views!");
752  }
753 
755  EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* rowMap */,
756  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* colMap */,
757  const local_graph_type& /* lclGraph */,
758  const RCP< Teuchos::ParameterList > &/* plist */=Teuchos::null) {
760  "Epetra does not support CrsGraph constructors using a local graph!");
761  }
762 
764  EpetraCrsGraphT(const local_graph_type& /* lclGraph */,
765  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* rowMap */,
766  const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &/* colMap */,
767  const Teuchos::RCP<const map_type>& /* domainMap */ = Teuchos::null,
768  const Teuchos::RCP<const map_type>& /* rangeMap */ = Teuchos::null,
769  const RCP< Teuchos::ParameterList > &/* plist */=Teuchos::null) {
771  "Epetra does not support CrsGraph constructors using a local graph!");
772  }
773 #endif
774 #endif
775 
777  virtual ~EpetraCrsGraphT() { }
778 
780 
782 
783 
786  XPETRA_MONITOR("EpetraCrsGraphT::insertGlobalIndices");
787 
788  GlobalOrdinal* indices_rawPtr = const_cast<GlobalOrdinal*>(indices.getRawPtr()); // there is no const in the Epetra interface :(
789  XPETRA_ERR_CHECK(graph_->InsertGlobalIndices(globalRow, indices.size(), indices_rawPtr));
790  }
791 
793  void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal> &indices) {
794  XPETRA_MONITOR("EpetraCrsGraphT::insertLocalIndices");
795 
796  int* indices_rawPtr = const_cast<int*>(indices.getRawPtr()); // there is no const in the Epetra interface :(
797  XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr));
798  }
799 
801  void removeLocalIndices(LocalOrdinal localRow) { XPETRA_MONITOR("EpetraCrsGraphT::removeLocalIndices"); graph_->RemoveMyIndices(localRow); }
802 
804 
806 
807 
809  void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null){
810  XPETRA_MONITOR("EpetraCrsGraphT::fillComplete");
811 
812  graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
813  bool doOptimizeStorage = true;
814  if (params != null && params->get("Optimize Storage",true) == false) doOptimizeStorage = false;
815  if (doOptimizeStorage) graph_->OptimizeStorage();
816  }
817 
819  void fillComplete(const RCP< ParameterList > &params=null) {
820  XPETRA_MONITOR("EpetraCrsGraphT::fillComplete");
821 
822  graph_->FillComplete();
823  bool doOptimizeStorage = true;
824  if (params != null && params->get("Optimize Storage",true) == false) doOptimizeStorage = false;
825  if (doOptimizeStorage) graph_->OptimizeStorage();
826  }
828 
830 
831 
834  XPETRA_MONITOR("EpetraCrsGraphT::getComm");
835  return toXpetra (graph_->Comm ());
836  }
837 
839  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getRowMap"); return toXpetra<GlobalOrdinal,Node>(graph_->RowMap()); }
840 
842  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getColMap"); return toXpetra<GlobalOrdinal,Node>(graph_->ColMap()); }
843 
845  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getDomainMap"); return toXpetra<GlobalOrdinal,Node>(graph_->DomainMap()); }
846 
848  RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getRangeMap"); return toXpetra<GlobalOrdinal,Node>(graph_->RangeMap()); }
849 
851  RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const { XPETRA_MONITOR("EpetraCrsGraphT::getImporter"); return toXpetra<GlobalOrdinal,Node>(graph_->Importer()); }
852 
854  RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const { XPETRA_MONITOR("EpetraCrsGraphT::getExporter"); return toXpetra<GlobalOrdinal,Node>(graph_->Exporter()); }
855 
857  global_size_t getGlobalNumRows() const { XPETRA_MONITOR("EpetraCrsGraphT::getGlobalNumRows"); return graph_->NumGlobalRows64(); }
858 
860  global_size_t getGlobalNumCols() const { XPETRA_MONITOR("EpetraCrsGraphT::getGlobalNumCols"); return graph_->NumGlobalCols64(); }
861 
863  size_t getNodeNumRows() const { XPETRA_MONITOR("EpetraCrsGraphT::getNodeNumRows"); return graph_->NumMyRows(); }
864 
866  size_t getNodeNumCols() const { XPETRA_MONITOR("EpetraCrsGraphT::getNodeNumCols"); return graph_->NumMyCols(); }
867 
869  GlobalOrdinal getIndexBase() const { XPETRA_MONITOR("EpetraCrsGraphT::getIndexBase"); return (GlobalOrdinal) graph_->IndexBase64(); }
870 
872  global_size_t getGlobalNumEntries() const { XPETRA_MONITOR("EpetraCrsGraphT::getGlobalNumEntries"); return graph_->NumGlobalEntries64(); }
873 
875  size_t getNodeNumEntries() const { XPETRA_MONITOR("EpetraCrsGraphT::getNodeNumEntries"); return graph_->NumMyEntries(); }
876 
878  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { XPETRA_MONITOR("EpetraCrsGraphT::getNumEntriesInGlobalRow"); return graph_->NumGlobalIndices(globalRow); }
879 
881  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { XPETRA_MONITOR("EpetraCrsGraphT::getNumEntriesInLocalRow"); return graph_->NumMyIndices(localRow); }
882 
884  size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { XPETRA_MONITOR("EpetraCrsGraphT::getNumAllocatedEntriesInGlobalRow"); return graph_->NumAllocatedGlobalIndices(globalRow); }
885 
887  size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { XPETRA_MONITOR("EpetraCrsGraphT::getNumAllocatedEntriesInLocalRow"); return graph_->NumAllocatedMyIndices(localRow); }
888 
890  size_t getGlobalMaxNumRowEntries() const { XPETRA_MONITOR("EpetraCrsGraphT::getGlobalMaxNumRowEntries"); return graph_->GlobalMaxNumIndices(); }
891 
893  size_t getNodeMaxNumRowEntries() const { XPETRA_MONITOR("EpetraCrsGraphT::getNodeMaxNumRowEntries"); return graph_->MaxNumIndices(); }
894 
896  bool hasColMap() const { XPETRA_MONITOR("EpetraCrsGraphT::hasColMap"); return graph_->HaveColMap(); }
897 
899  bool isLocallyIndexed() const { XPETRA_MONITOR("EpetraCrsGraphT::isLocallyIndexed"); return graph_->IndicesAreLocal(); }
900 
902  bool isGloballyIndexed() const { XPETRA_MONITOR("EpetraCrsGraphT::isGloballyIndexed"); return graph_->IndicesAreGlobal(); }
903 
905  bool isFillComplete() const { XPETRA_MONITOR("EpetraCrsGraphT::isFillComplete"); return graph_->Filled(); }
906 
908  bool isStorageOptimized() const { XPETRA_MONITOR("EpetraCrsGraphT::isStorageOptimized"); return graph_->StorageOptimized(); }
909 
912  XPETRA_MONITOR("EpetraCrsGraphT::getGlobalRowView");
913 
914  int numEntries;
915  GlobalOrdinal * eIndices;
916 
917  XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices));
918  if (numEntries == 0) { eIndices = NULL; } // Cf. TEUCHOS_TEST_FOR_EXCEPT( p == 0 && size_in != 0 ) in Teuchos ArrayView constructor.
919 
920  Indices = ArrayView<const GlobalOrdinal>(eIndices, numEntries);
921  }
922 
925  XPETRA_MONITOR("EpetraCrsGraphT::getLocalRowView");
926 
927  int numEntries;
928  int * eIndices;
929 
930  XPETRA_ERR_CHECK(graph_->ExtractMyRowView(LocalRow, numEntries, eIndices));
931  if (numEntries == 0) { eIndices = NULL; } // Cf. TEUCHOS_TEST_FOR_EXCEPT( p == 0 && size_in != 0 ) in Teuchos ArrayView constructor.
932 
933  indices = ArrayView<const int>(eIndices, numEntries);
934  }
935 
936 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
937 #ifdef HAVE_XPETRA_TPETRA
938  local_graph_type getLocalGraph () const {
940  "Epetra does not support Kokkos::StaticCrsGraph!");
941  TEUCHOS_UNREACHABLE_RETURN((Kokkos::StaticCrsGraph<LocalOrdinal, Kokkos::LayoutLeft, execution_space>()));
942  }
943 #else
944 #ifdef __GNUC__
945 #warning "Xpetra Kokkos interface for CrsGraph is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
946 #endif
947 #endif
948 #endif
949 
952 
953 
955 
957 
958 
960  std::string description() const { XPETRA_MONITOR("EpetraCrsGraphT::description"); return "NotImplemented"; }
961 
964  XPETRA_MONITOR("EpetraCrsGraphT::describe");
965 
966  out << "EpetraCrsGraphT::describe : Warning, verbosity level is ignored by this method." << std::endl;
967  const Epetra_BlockMap rowmap = graph_->RowMap();
968  if (rowmap.Comm().MyPID() == 0) out << "** EpetraCrsGraphT **\n\nrowmap" << std::endl;
969  rowmap.Print(out);
970  graph_->Print(out);
971  }
972 
974 
976  //{@
977 
979  Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const { XPETRA_MONITOR("EpetraCrsGraphT::getMap"); return toXpetra<GlobalOrdinal,Node>(graph_->Map()); }
980 
984  XPETRA_MONITOR("EpetraCrsGraphT::doImport");
985 
986  XPETRA_DYNAMIC_CAST(const EpetraCrsGraphT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraCrsGraphT as input arguments.");
987  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraImportT as input arguments.");
988 
989  RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
990  int err = graph_->Import(*v, *tImporter.getEpetra_Import(), toEpetra(CM));
991  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
992  }
993 
997  XPETRA_MONITOR("EpetraCrsGraphT::doExport");
998 
999  XPETRA_DYNAMIC_CAST(const EpetraCrsGraphT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraCrsGraphT as input arguments.");
1000  XPETRA_DYNAMIC_CAST(const EpetraImportT<GlobalOrdinal XPETRA_COMMA Node>, importer, tImporter, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1001 
1002  RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
1003  int err = graph_->Export(*v, *tImporter.getEpetra_Import(), toEpetra(CM));
1004  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1005  }
1006 
1010  XPETRA_MONITOR("EpetraCrsGraphT::doImport");
1011 
1012  XPETRA_DYNAMIC_CAST(const EpetraCrsGraphT<GlobalOrdinal XPETRA_COMMA Node>, source, tSource, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraCrsGraphT as input arguments.");
1013  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1014 
1015  RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
1016  int err = graph_->Import(*v, *tExporter.getEpetra_Export(), toEpetra(CM));
1017  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1018 
1019  }
1020 
1024  XPETRA_MONITOR("EpetraCrsGraphT::doExport");
1025 
1026  XPETRA_DYNAMIC_CAST(const EpetraCrsGraphT<GlobalOrdinal XPETRA_COMMA Node>, dest, tDest, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraCrsGraphT as input arguments.");
1027  XPETRA_DYNAMIC_CAST(const EpetraExportT<GlobalOrdinal XPETRA_COMMA Node>, exporter, tExporter, "Xpetra::EpetraCrsGraphT::doImport only accept Xpetra::EpetraImportT as input arguments.");
1028 
1029  RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
1030  int err = graph_->Export(*v, *tExporter.getEpetra_Export(), toEpetra(CM));
1031  TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error, "Catch error code returned by Epetra.");
1032  }
1034 
1036 
1037 
1039  EpetraCrsGraphT(const Teuchos::RCP<Epetra_CrsGraph> &graph) : graph_(graph) {
1040  TEUCHOS_TEST_FOR_EXCEPTION(!graph->RowMap().GlobalIndicesIsType<GlobalOrdinal>(), std::runtime_error, "Xpetra::EpetraCrsGraphT: GlobalOrdinal mismatch.");
1041  }
1042 
1045 
1047 
1048 private:
1049 
1051 
1052 
1053 };
1054 #endif // specialization on Node=EpetraNode and GO=int
1055 
1056 } // Xpetra namespace
1057 
1058 #endif // XPETRA_EPETRACRSGRAPH_HPP
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getNodeMaxNumRowEntries
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:893
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getNumEntriesInLocalRow
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:881
Xpetra::EpetraCrsGraphT::describe
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.
Definition: Xpetra_EpetraCrsGraph.hpp:290
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getEpetra_CrsGraph
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
Definition: Xpetra_EpetraCrsGraph.hpp:684
Kokkos::Compat::KokkosSerialWrapperNode
Definition: Kokkos_SerialNode.hpp:57
Xpetra_EpetraMap.hpp
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::EpetraCrsGraphT
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &=null)
Constructor specifying column Map and fixed number of entries for each row.
Definition: Xpetra_EpetraCrsGraph.hpp:732
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::isLocallyIndexed
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:899
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getMap
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
Definition: Xpetra_EpetraCrsGraph.hpp:979
Epetra_BlockMap::Comm
const Epetra_Comm & Comm() const
Xpetra::EpetraCrsGraphT::getGlobalNumEntries
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:219
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::insertGlobalIndices
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:785
Xpetra::EpetraCrsGraphT< int, EpetraNode >::~EpetraCrsGraphT
virtual ~EpetraCrsGraphT()
Destructor.
Definition: Xpetra_EpetraCrsGraph.hpp:415
Xpetra::EpetraCrsGraphT< int, EpetraNode >::insertGlobalIndices
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:423
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getExporter
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:492
Xpetra::EpetraCrsGraphT< int, EpetraNode >::GlobalOrdinal
int GlobalOrdinal
Definition: Xpetra_EpetraCrsGraph.hpp:342
Xpetra
Xpetra namespace
Definition: Xpetra_BlockedCrsMatrix.hpp:88
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::doImport
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
Definition: Xpetra_EpetraCrsGraph.hpp:982
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::computeGlobalConstants
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
Definition: Xpetra_EpetraCrsGraph.hpp:951
Xpetra::EpetraCrsGraphT::getComm
RCP< const Comm< int > > getComm() const
Returns the communicator.
Definition: Xpetra_EpetraCrsGraph.hpp:181
Xpetra::EpetraCrsGraphT< int, EpetraNode >::LocalOrdinal
int LocalOrdinal
Definition: Xpetra_EpetraCrsGraph.hpp:341
Xpetra::EpetraCrsGraphT::~EpetraCrsGraphT
virtual ~EpetraCrsGraphT()
Destructor.
Definition: Xpetra_EpetraCrsGraph.hpp:149
Xpetra::EpetraCrsGraphT< int, EpetraNode >::isFillComplete
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
Definition: Xpetra_EpetraCrsGraph.hpp:543
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::graph_
RCP< Epetra_CrsGraph > graph_
Definition: Xpetra_EpetraCrsGraph.hpp:1050
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getNodeNumCols
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:504
Xpetra::global_size_t
size_t global_size_t
Global size_t object.
Definition: Xpetra_ConfigDefs.hpp:174
Xpetra_CrsGraph.hpp
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::doExport
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
Definition: Xpetra_EpetraCrsGraph.hpp:1022
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getNumEntriesInLocalRow
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:519
Xpetra::EpetraCrsGraphT< int, EpetraNode >::doImport
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
Definition: Xpetra_EpetraCrsGraph.hpp:648
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getGlobalMaxNumRowEntries
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
Definition: Xpetra_EpetraCrsGraph.hpp:528
Xpetra::EpetraCrsGraphT::getNumEntriesInLocalRow
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:228
Xpetra::EpetraCrsGraphT< int, EpetraNode >::hasColMap
bool hasColMap() const
Whether the graph has a column Map.
Definition: Xpetra_EpetraCrsGraph.hpp:534
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getGlobalNumRows
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:857
Xpetra::EpetraCrsGraphT::doImport
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
Definition: Xpetra_EpetraCrsGraph.hpp:309
Xpetra::DistObject
Definition: Xpetra_DistObject.hpp:66
Xpetra::EpetraCrsGraphT::removeLocalIndices
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:163
Xpetra::DynamicProfile
@ DynamicProfile
Definition: Xpetra_ConfigDefs.hpp:191
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::removeLocalIndices
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:801
Xpetra::EpetraCrsGraphT< int, EpetraNode >::removeLocalIndices
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:439
Epetra_BlockMap::Print
virtual void Print(std::ostream &os) const
XPETRA_DYNAMIC_CAST
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
Definition: Xpetra_Exceptions.hpp:58
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::description
std::string description() const
Return a simple one-line description of this object.
Definition: Xpetra_EpetraCrsGraph.hpp:960
Xpetra::EpetraCrsGraphT< int, EpetraNode >::EpetraCrsGraphT
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > &=null)
Definition: Xpetra_EpetraCrsGraph.hpp:375
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::map_type
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
Definition: Xpetra_EpetraCrsGraph.hpp:708
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getNodeNumCols
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:866
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::isGloballyIndexed
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:902
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getDomainMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:483
Xpetra::EpetraCrsGraphT::insertLocalIndices
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:160
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::EpetraCrsGraphT
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
Definition: Xpetra_EpetraCrsGraph.hpp:1039
Xpetra::Export
Definition: Xpetra_Export.hpp:64
Xpetra::EpetraCrsGraphT::fillComplete
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.
Definition: Xpetra_EpetraCrsGraph.hpp:171
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::~EpetraCrsGraphT
virtual ~EpetraCrsGraphT()
Destructor.
Definition: Xpetra_EpetraCrsGraph.hpp:777
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getColMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:842
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getIndexBase
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:507
Xpetra::EpetraCrsGraphT::getNumAllocatedEntriesInLocalRow
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:234
Xpetra::toXpetra
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
Definition: Xpetra_EpetraCrsGraph.cpp:168
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getRowMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:477
Xpetra::CrsGraph::node_type
Node node_type
Definition: Xpetra_CrsGraph.hpp:90
Xpetra::EpetraCrsGraphT::getNodeNumCols
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:213
rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::EVerbosityLevel
EVerbosityLevel
Xpetra::EpetraCrsGraphT::getRowMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:186
Xpetra::EpetraCrsGraphT< int, EpetraNode >::insertLocalIndices
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:431
Xpetra::EpetraCrsGraphT::computeGlobalConstants
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
Definition: Xpetra_EpetraCrsGraph.hpp:279
Xpetra::EpetraCrsGraphT::map_type
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
Definition: Xpetra_EpetraCrsGraph.hpp:81
Xpetra::EpetraCrsGraphT::getMap
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
Definition: Xpetra_EpetraCrsGraph.hpp:298
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getGlobalRowView
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
Definition: Xpetra_EpetraCrsGraph.hpp:549
Xpetra::EpetraCrsGraphT< int, EpetraNode >::EpetraCrsGraphT
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &=null)
Constructor specifying column Map and fixed number of entries for each row.
Definition: Xpetra_EpetraCrsGraph.hpp:370
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getNumAllocatedEntriesInLocalRow
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:525
Teuchos::ArrayView
Xpetra_EpetraImport.hpp
Xpetra::EpetraCrsGraphT::getNodeNumEntries
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:222
Xpetra::Map
Definition: Xpetra_Map_decl.hpp:91
Xpetra::EpetraCrsGraphT::getColMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:189
Xpetra::Import
Definition: Xpetra_Import.hpp:64
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getImporter
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:851
Xpetra::CombineMode
CombineMode
Xpetra::Combine Mode enumerable type.
Definition: Xpetra_ConfigDefs.hpp:218
Teuchos::RCP
Xpetra::EpetraCrsGraphT< int, EpetraNode >::describe
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
Definition: Xpetra_EpetraCrsGraph.hpp:603
Xpetra::EpetraCrsGraphT::getNodeMaxNumRowEntries
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:240
Xpetra::EpetraCrsGraphT
Definition: Xpetra_EpetraCrsGraph.hpp:77
Teuchos::Array
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getGlobalNumCols
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:860
Xpetra::EpetraCrsGraphT::getDomainMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:192
Xpetra::EpetraCrsGraphT::getNumEntriesInGlobalRow
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
Definition: Xpetra_EpetraCrsGraph.hpp:225
Xpetra::EpetraCrsGraphT< int, EpetraNode >::map_type
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
Definition: Xpetra_EpetraCrsGraph.hpp:346
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::insertLocalIndices
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:793
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getNumEntriesInGlobalRow
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
Definition: Xpetra_EpetraCrsGraph.hpp:878
Xpetra::EpetraCrsGraphT< int, EpetraNode >::computeGlobalConstants
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
Definition: Xpetra_EpetraCrsGraph.hpp:589
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getGlobalNumCols
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:498
Teuchos::ArrayRCP
Xpetra::EpetraCrsGraphT::getLocalRowView
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
Definition: Xpetra_EpetraCrsGraph.hpp:261
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::doImport
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
Definition: Xpetra_EpetraCrsGraph.hpp:1008
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getRangeMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:848
Xpetra_EpetraUtils.hpp
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getRowMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:839
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getNodeNumEntries
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:513
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getGlobalNumRows
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:495
Xpetra::Exceptions::RuntimeError
Exception throws to report errors in the internal logical of the program.
Definition: Xpetra_Exceptions.hpp:102
Xpetra::EpetraCrsGraphT< int, EpetraNode >::doExport
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
Definition: Xpetra_EpetraCrsGraph.hpp:662
Xpetra::EpetraCrsGraphT::getGlobalNumCols
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:207
Teuchos::basic_FancyOStream
Teuchos::ArrayView::size
size_type size() const
Xpetra::EpetraCrsGraphT::isLocallyIndexed
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:246
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::doExport
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
Definition: Xpetra_EpetraCrsGraph.hpp:995
Xpetra::EpetraCrsGraphT< int, EpetraNode >::EpetraCrsGraphT
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
Definition: Xpetra_EpetraCrsGraph.hpp:679
Xpetra::CrsGraph
Definition: Xpetra_CrsGraph.hpp:86
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getNodeNumRows
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
Definition: Xpetra_EpetraCrsGraph.hpp:501
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getGlobalMaxNumRowEntries
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
Definition: Xpetra_EpetraCrsGraph.hpp:890
Xpetra::EpetraCrsGraphT::isFillComplete
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
Definition: Xpetra_EpetraCrsGraph.hpp:252
Xpetra::EpetraCrsGraphT::getExporter
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:201
Xpetra::EpetraCrsGraphT::hasColMap
bool hasColMap() const
Whether the graph has a column Map.
Definition: Xpetra_EpetraCrsGraph.hpp:243
Xpetra::Exceptions::NotImplemented
Exception throws when you call an unimplemented method of Xpetra.
Definition: Xpetra_Exceptions.hpp:95
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getNumAllocatedEntriesInGlobalRow
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row .
Definition: Xpetra_EpetraCrsGraph.hpp:522
Xpetra::EpetraCrsGraphT< int, EpetraNode >::isGloballyIndexed
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:540
Xpetra::EpetraCrsGraphT::LocalOrdinal
int LocalOrdinal
Definition: Xpetra_EpetraCrsGraph.hpp:78
Xpetra::EpetraCrsGraphT::getEpetra_CrsGraph
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
Definition: Xpetra_EpetraCrsGraph.hpp:327
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getLocalRowView
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
Definition: Xpetra_EpetraCrsGraph.hpp:562
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getEpetra_CrsGraph
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
Definition: Xpetra_EpetraCrsGraph.hpp:1044
Xpetra::EpetraCrsGraphT::isStorageOptimized
bool isStorageOptimized() const
Returns true if storage has been optimized.
Definition: Xpetra_EpetraCrsGraph.hpp:255
Teuchos::ArrayView::getRawPtr
T * getRawPtr() const
Xpetra::EpetraCrsGraphT::insertGlobalIndices
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:157
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getNodeNumEntries
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:875
Xpetra::EpetraCrsGraphT::getGlobalRowView
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
Definition: Xpetra_EpetraCrsGraph.hpp:258
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getDomainMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:845
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::isFillComplete
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
Definition: Xpetra_EpetraCrsGraph.hpp:905
Epetra_BlockMap
Xpetra::EpetraCrsGraphT::EpetraCrsGraphT
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
Definition: Xpetra_EpetraCrsGraph.hpp:321
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getImporter
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:489
Xpetra::EpetraCrsGraphT::getNodeNumRows
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
Definition: Xpetra_EpetraCrsGraph.hpp:210
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getComm
RCP< const Comm< int > > getComm() const
Returns the communicator.
Definition: Xpetra_EpetraCrsGraph.hpp:833
Xpetra::EpetraCrsGraphT::getNumAllocatedEntriesInGlobalRow
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row .
Definition: Xpetra_EpetraCrsGraph.hpp:231
Xpetra::EpetraCrsGraphT< int, EpetraNode >::description
std::string description() const
Return a simple one-line description of this object.
Definition: Xpetra_EpetraCrsGraph.hpp:600
Xpetra::EpetraCrsGraphT::EpetraCrsGraphT
EpetraCrsGraphT(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying fixed number of entries for each row.
Definition: Xpetra_EpetraCrsGraph.hpp:96
Xpetra::EpetraCrsGraphT::doExport
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
Definition: Xpetra_EpetraCrsGraph.hpp:313
Xpetra::EpetraCrsGraphT< int, EpetraNode >::doExport
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
Definition: Xpetra_EpetraCrsGraph.hpp:635
Xpetra::EpetraImportT
Definition: Xpetra_EpetraImport.hpp:68
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::Node
EpetraNode Node
Definition: Xpetra_EpetraCrsGraph.hpp:705
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::GlobalOrdinal
long long GlobalOrdinal
Definition: Xpetra_EpetraCrsGraph.hpp:704
Xpetra::toEpetra
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
Definition: Xpetra_EpetraCrsGraph.cpp:57
Xpetra::EpetraCrsGraphT::EpetraCrsGraphT
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > &params=null)
Definition: Xpetra_EpetraCrsGraph.hpp:109
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::fillComplete
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
Definition: Xpetra_EpetraCrsGraph.hpp:819
Xpetra::EpetraExportT
Definition: Xpetra_EpetraExport.hpp:70
Xpetra::EpetraCrsGraphT::EpetraCrsGraphT
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=null)
Constructor specifying column Map and fixed number of entries for each row.
Definition: Xpetra_EpetraCrsGraph.hpp:102
Xpetra::EpetraCrsGraphT::doExport
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
Definition: Xpetra_EpetraCrsGraph.hpp:305
Teuchos::ArrayRCP::end
iterator end() const
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getNumAllocatedEntriesInLocalRow
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row.
Definition: Xpetra_EpetraCrsGraph.hpp:887
Epetra_CrsGraph
Xpetra::EpetraCrsGraphT< int, EpetraNode >::fillComplete
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.
Definition: Xpetra_EpetraCrsGraph.hpp:447
Teuchos::Array::getRawPtr
T * getRawPtr()
Xpetra::EpetraCrsGraphT< int, EpetraNode >::graph_
RCP< Epetra_CrsGraph > graph_
Definition: Xpetra_EpetraCrsGraph.hpp:690
Xpetra::EpetraCrsGraphT< int, EpetraNode >::doImport
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
Definition: Xpetra_EpetraCrsGraph.hpp:622
Xpetra::EpetraCrsGraphT::getGlobalMaxNumRowEntries
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
Definition: Xpetra_EpetraCrsGraph.hpp:237
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getGlobalNumEntries
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:510
Xpetra_Exceptions.hpp
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::isStorageOptimized
bool isStorageOptimized() const
Returns true if storage has been optimized.
Definition: Xpetra_EpetraCrsGraph.hpp:908
Xpetra::EpetraCrsGraphT::fillComplete
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
Definition: Xpetra_EpetraCrsGraph.hpp:174
Teuchos::ArrayRCP::begin
iterator begin() const
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getColMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:480
Xpetra::EpetraCrsGraphT::getGlobalNumRows
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:204
Xpetra::EpetraCrsGraphT< int, EpetraNode >::fillComplete
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
Definition: Xpetra_EpetraCrsGraph.hpp:457
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getNodeNumRows
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
Definition: Xpetra_EpetraCrsGraph.hpp:863
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getNumAllocatedEntriesInGlobalRow
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row .
Definition: Xpetra_EpetraCrsGraph.hpp:884
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getMap
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
Definition: Xpetra_EpetraCrsGraph.hpp:619
Xpetra::EpetraCrsGraphT::doImport
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
Definition: Xpetra_EpetraCrsGraph.hpp:301
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getNodeMaxNumRowEntries
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:531
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::fillComplete
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.
Definition: Xpetra_EpetraCrsGraph.hpp:809
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getNumEntriesInGlobalRow
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
Definition: Xpetra_EpetraCrsGraph.hpp:516
XPETRA_ERR_CHECK
#define XPETRA_ERR_CHECK(arg)
Definition: Xpetra_ConfigDefs.hpp:275
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getRangeMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:486
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getExporter
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:854
Xpetra::EpetraCrsGraphT::getImporter
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:198
Teuchos
Xpetra_EpetraConfigDefs.hpp
Xpetra::EpetraCrsGraphT< int, EpetraNode >::getComm
RCP< const Comm< int > > getComm() const
Returns the communicator.
Definition: Xpetra_EpetraCrsGraph.hpp:471
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::LocalOrdinal
int LocalOrdinal
Definition: Xpetra_EpetraCrsGraph.hpp:703
Xpetra::EpetraCrsGraphT< int, EpetraNode >::Node
EpetraNode Node
Definition: Xpetra_EpetraCrsGraph.hpp:343
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::EpetraCrsGraphT
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > &=null)
Definition: Xpetra_EpetraCrsGraph.hpp:737
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getIndexBase
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:869
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getGlobalNumEntries
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
Definition: Xpetra_EpetraCrsGraph.hpp:872
Teuchos::Describable::verbLevel_default
static const EVerbosityLevel verbLevel_default
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getLocalRowView
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
Definition: Xpetra_EpetraCrsGraph.hpp:924
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::hasColMap
bool hasColMap() const
Whether the graph has a column Map.
Definition: Xpetra_EpetraCrsGraph.hpp:896
Xpetra_EpetraExport.hpp
TEUCHOS_TEST_FOR_EXCEPTION
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::getGlobalRowView
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
Definition: Xpetra_EpetraCrsGraph.hpp:911
XPETRA_MONITOR
#define XPETRA_MONITOR(funcName)
Definition: Xpetra_ConfigDefs.hpp:132
Copy
Copy
Xpetra::EpetraCrsGraphT::isGloballyIndexed
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:249
Epetra_Comm::MyPID
virtual int MyPID() const=0
Xpetra::EpetraCrsGraphT::getRangeMap
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:195
Xpetra::EpetraCrsGraphT< long long, EpetraNode >::describe
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
Definition: Xpetra_EpetraCrsGraph.hpp:963
Xpetra::EpetraCrsGraphT< int, EpetraNode >::isLocallyIndexed
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
Definition: Xpetra_EpetraCrsGraph.hpp:537
Xpetra::EpetraCrsGraphT::description
std::string description() const
Return a simple one-line description of this object.
Definition: Xpetra_EpetraCrsGraph.hpp:287
Xpetra::ProfileType
ProfileType
Definition: Xpetra_ConfigDefs.hpp:189
Xpetra::EpetraCrsGraphT< int, EpetraNode >::isStorageOptimized
bool isStorageOptimized() const
Returns true if storage has been optimized.
Definition: Xpetra_EpetraCrsGraph.hpp:546
Xpetra::EpetraCrsGraphT::getIndexBase
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
Definition: Xpetra_EpetraCrsGraph.hpp:216
TEUCHOS_UNREACHABLE_RETURN
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)