Xpetra Version of the Day
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
61namespace Xpetra {
62
63
64template<class LocalOrdinal, class GlobalOrdinal, class Node>
65TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params)
66: graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), maxNumEntriesPerRow, Tpetra::StaticProfile, params))) { }
67
68template<class LocalOrdinal, class GlobalOrdinal, class Node>
70: graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), NumEntriesPerRowToAlloc(), Tpetra::StaticProfile, params))) { }
71
72template<class LocalOrdinal, class GlobalOrdinal, class Node>
74: graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), toTpetra(colMap), maxNumEntriesPerRow, Tpetra::StaticProfile, params))) { }
75
76template<class LocalOrdinal, class GlobalOrdinal, class Node>
78: graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), toTpetra(colMap), NumEntriesPerRowToAlloc(), Tpetra::StaticProfile, params))) { }
79
80
81template <class LocalOrdinal, class GlobalOrdinal, class Node>
84 const Import & importer,
85 const Teuchos::RCP<const Map >& domainMap,
86 const Teuchos::RCP<const Map >& rangeMap,
88{
89 typedef Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node> MyTpetraCrsGraph;
90 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, *sourceGraph, tSourceGraph, "Xpetra::TpetraCrsMatrix constructor only accepts Xpetra::TpetraCrsMatrix as the input argument.");//TODO: remove and use toTpetra()
91 RCP< const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSourceGraph.getTpetra_CrsGraph();
92
93 RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > myDomainMap = domainMap!=Teuchos::null ? toTpetra(domainMap) : Teuchos::null;
94 RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > myRangeMap = rangeMap!=Teuchos::null ? toTpetra(rangeMap) : Teuchos::null;
95 graph_=Tpetra::importAndFillCompleteCrsGraph<MyTpetraCrsGraph>(v,toTpetra(importer),myDomainMap,myRangeMap,params);
96 bool restrictComm=false;
97 if(!params.is_null()) restrictComm = params->get("Restrict Communicator",restrictComm);
98 if(restrictComm && graph_->getRowMap().is_null()) graph_=Teuchos::null;
99
100}
101
102
103#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
104template<class LocalOrdinal, class GlobalOrdinal, class Node>
107 const Teuchos::RCP< const Map > &colMap,
108 const typename local_graph_type::row_map_type& rowPointers,
109 const typename local_graph_type::entries_type::non_const_type& columnIndices,
111 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, plist))) { }
112
113
114template<class LocalOrdinal, class GlobalOrdinal, class Node>
117 const Teuchos::RCP<const map_type>& colMap,
118 const local_graph_type& lclGraph,
120 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), lclGraph, params))) { }
121
122template<class LocalOrdinal, class GlobalOrdinal, class Node>
124TpetraCrsGraph(const local_graph_type& lclGraph,
125 const Teuchos::RCP<const map_type>& rowMap,
126 const Teuchos::RCP<const map_type>& colMap,
127 const Teuchos::RCP<const map_type>& domainMap,
128 const Teuchos::RCP<const map_type>& rangeMap,
130 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph, toTpetra(rowMap), toTpetra(colMap), toTpetra(domainMap), toTpetra(rangeMap), params))) { }
131#endif
132
133template<class LocalOrdinal, class GlobalOrdinal, class Node>
136 const Teuchos::RCP< const Map > &colMap,
137 const Teuchos::ArrayRCP<size_t>& rowPointers,
138 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
140 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, params))) { }
141
142
143template<class LocalOrdinal, class GlobalOrdinal, class Node>
145
146template<class LocalOrdinal, class GlobalOrdinal, class Node>
148{ XPETRA_MONITOR("TpetraCrsGraph::insertGlobalIndices"); graph_->insertGlobalIndices(globalRow, indices); }
149
150template<class LocalOrdinal, class GlobalOrdinal, class Node>
152{ XPETRA_MONITOR("TpetraCrsGraph::insertLocalIndices"); graph_->insertLocalIndices(localRow, indices); }
153
154template<class LocalOrdinal, class GlobalOrdinal, class Node>
156{ XPETRA_MONITOR("TpetraCrsGraph::removeLocalIndices"); graph_->removeLocalIndices(localRow); }
157
158template<class LocalOrdinal, class GlobalOrdinal, class Node>
160allocateAllIndices(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind) {
161 rowptr.resize(getNodeNumRows()+1); colind.resize(numNonZeros);
162}
163
164template<class LocalOrdinal, class GlobalOrdinal, class Node>
166setAllIndices(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind) {
167 graph_->setAllIndices(rowptr,colind);
168}
169
170template<class LocalOrdinal, class GlobalOrdinal, class Node>
173 rowptr = graph_->getNodeRowPtrs();
174 colind = graph_->getNodePackedIndices();
175}
176
177template<class LocalOrdinal, class GlobalOrdinal, class Node>
179{ XPETRA_MONITOR("TpetraCrsGraph::fillComplete"); graph_->fillComplete(toTpetra(domainMap), toTpetra(rangeMap), params); }
180
181template<class LocalOrdinal, class GlobalOrdinal, class Node>
183{ XPETRA_MONITOR("TpetraCrsGraph::fillComplete"); graph_->fillComplete(params); }
184
185template<class LocalOrdinal, class GlobalOrdinal, class Node>
188 const Teuchos::RCP<const map_type>& rangeMap,
189 const Teuchos::RCP<const Import>& importer,
190 const Teuchos::RCP<const Export>& exporter,
192 XPETRA_MONITOR("TpetraCrsGraph::expertStaticFillComplete");
195
196 if(importer!=Teuchos::null) {
197 XPETRA_DYNAMIC_CAST( const TpetraImportClass , *importer, tImporter, "Xpetra::TpetraCrsGraph::expertStaticFillComplete only accepts Xpetra::TpetraImport.");
198 myImport = tImporter.getTpetra_Import();
199 }
200 if(exporter!=Teuchos::null) {
201 XPETRA_DYNAMIC_CAST( const TpetraExportClass , *exporter, tExporter, "Xpetra::TpetraCrsGraph::expertStaticFillComplete only accepts Xpetra::TpetraExport.");
202 myExport = tExporter.getTpetra_Export();
203 }
204
205 graph_->expertStaticFillComplete(toTpetra(domainMap),toTpetra(rangeMap),myImport,myExport,params);
206}
207
208
209template<class LocalOrdinal, class GlobalOrdinal, class Node>
211{ XPETRA_MONITOR("TpetraCrsGraph::getComm"); return graph_->getComm(); }
212
213template<class LocalOrdinal, class GlobalOrdinal, class Node>
215{ XPETRA_MONITOR("TpetraCrsGraph::getRowMap"); return toXpetra(graph_->getRowMap()); }
216
217template<class LocalOrdinal, class GlobalOrdinal, class Node>
219{ XPETRA_MONITOR("TpetraCrsGraph::getColMap"); return toXpetra(graph_->getColMap()); }
220
221template<class LocalOrdinal, class GlobalOrdinal, class Node>
223{ XPETRA_MONITOR("TpetraCrsGraph::getDomainMap"); return toXpetra(graph_->getDomainMap()); }
224
225template<class LocalOrdinal, class GlobalOrdinal, class Node>
227{ XPETRA_MONITOR("TpetraCrsGraph::getRangeMap"); return toXpetra(graph_->getRangeMap()); }
228
229template<class LocalOrdinal, class GlobalOrdinal, class Node>
231{ XPETRA_MONITOR("TpetraCrsGraph::getImporter"); return toXpetra(graph_->getImporter()); }
232
233template<class LocalOrdinal, class GlobalOrdinal, class Node>
235{ XPETRA_MONITOR("TpetraCrsGraph::getExporter"); return toXpetra(graph_->getExporter()); }
236
237template<class LocalOrdinal, class GlobalOrdinal, class Node>
239{ XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumRows"); return graph_->getGlobalNumRows(); }
240
241template<class LocalOrdinal, class GlobalOrdinal, class Node>
243{ XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumCols"); return graph_->getGlobalNumCols(); }
244
245template<class LocalOrdinal, class GlobalOrdinal, class Node>
247{ XPETRA_MONITOR("TpetraCrsGraph::getNodeNumRows"); return graph_->getNodeNumRows(); }
248
249template<class LocalOrdinal, class GlobalOrdinal, class Node>
251{ XPETRA_MONITOR("TpetraCrsGraph::getNodeNumCols"); return graph_->getNodeNumCols(); }
252
253template<class LocalOrdinal, class GlobalOrdinal, class Node>
255{ XPETRA_MONITOR("TpetraCrsGraph::getIndexBase"); return graph_->getIndexBase(); }
256
257template<class LocalOrdinal, class GlobalOrdinal, class Node>
259{ XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumEntries"); return graph_->getGlobalNumEntries(); }
260
261template<class LocalOrdinal, class GlobalOrdinal, class Node>
263{ XPETRA_MONITOR("TpetraCrsGraph::getNodeNumEntries"); return graph_->getNodeNumEntries(); }
264
265template<class LocalOrdinal, class GlobalOrdinal, class Node>
267{ XPETRA_MONITOR("TpetraCrsGraph::getNumEntriesInGlobalRow"); return graph_->getNumEntriesInGlobalRow(globalRow); }
268
269template<class LocalOrdinal, class GlobalOrdinal, class Node>
271{ XPETRA_MONITOR("TpetraCrsGraph::getNumEntriesInLocalRow"); return graph_->getNumEntriesInLocalRow(localRow); }
272
273template<class LocalOrdinal, class GlobalOrdinal, class Node>
275{ XPETRA_MONITOR("TpetraCrsGraph::getNumAllocatedEntriesInGlobalRow"); return graph_->getNumAllocatedEntriesInGlobalRow(globalRow); }
276
277template<class LocalOrdinal, class GlobalOrdinal, class Node>
279{ XPETRA_MONITOR("TpetraCrsGraph::getNumAllocatedEntriesInLocalRow"); return graph_->getNumAllocatedEntriesInLocalRow(localRow); }
280
281template<class LocalOrdinal, class GlobalOrdinal, class Node>
283{ XPETRA_MONITOR("TpetraCrsGraph::getGlobalMaxNumRowEntries"); return graph_->getGlobalMaxNumRowEntries(); }
284
285template<class LocalOrdinal, class GlobalOrdinal, class Node>
287{ XPETRA_MONITOR("TpetraCrsGraph::getNodeMaxNumRowEntries"); return graph_->getNodeMaxNumRowEntries(); }
288
289template<class LocalOrdinal, class GlobalOrdinal, class Node>
291{ XPETRA_MONITOR("TpetraCrsGraph::hasColMap"); return graph_->hasColMap(); }
292
293template<class LocalOrdinal, class GlobalOrdinal, class Node>
295{ XPETRA_MONITOR("TpetraCrsGraph::isLocallyIndexed"); return graph_->isLocallyIndexed(); }
296
297template<class LocalOrdinal, class GlobalOrdinal, class Node>
299{ XPETRA_MONITOR("TpetraCrsGraph::isGloballyIndexed"); return graph_->isGloballyIndexed(); }
300
301template<class LocalOrdinal, class GlobalOrdinal, class Node>
303{ XPETRA_MONITOR("TpetraCrsGraph::isFillComplete"); return graph_->isFillComplete(); }
304
305template<class LocalOrdinal, class GlobalOrdinal, class Node>
307{ XPETRA_MONITOR("TpetraCrsGraph::isStorageOptimized"); return graph_->isStorageOptimized(); }
308
309template<class LocalOrdinal, class GlobalOrdinal, class Node>
311{
312 XPETRA_MONITOR("TpetraCrsGraph::getGlobalRowView");
313 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::global_inds_host_view_type indices;
314 graph_->getGlobalRowView(GlobalRow, indices);
315 Indices = ArrayView<const GlobalOrdinal> (indices.data(), indices.extent(0));
316}
317
318template<class LocalOrdinal, class GlobalOrdinal, class Node>
320{
321 XPETRA_MONITOR("TpetraCrsGraph::getLocalRowView");
322 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::local_inds_host_view_type indices;
323 graph_->getLocalRowView(LocalRow, indices);
324 Indices = ArrayView<const LocalOrdinal> (indices.data(), indices.extent(0));
325}
326
327#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
328template<class LocalOrdinal, class GlobalOrdinal, class Node>
330 return getTpetra_CrsGraph()->getLocalGraphHost();
331}
332
333template<class LocalOrdinal, class GlobalOrdinal, class Node>
334typename Xpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::local_graph_type TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::getLocalGraphDevice () const {
335 return getTpetra_CrsGraph()->getLocalGraphDevice();
336}
337#endif
338
339template<class LocalOrdinal, class GlobalOrdinal, class Node>
341 // mfh 07 May 2018: See GitHub Issue #2565.
342 graph_->computeGlobalConstants();
343 }
344
345template<class LocalOrdinal, class GlobalOrdinal, class Node>
347{ XPETRA_MONITOR("TpetraCrsGraph::description"); return graph_->description(); }
348
349template<class LocalOrdinal, class GlobalOrdinal, class Node>
351{ XPETRA_MONITOR("TpetraCrsGraph::describe"); graph_->describe(out, verbLevel); }
352
353template<class LocalOrdinal, class GlobalOrdinal, class Node>
355{ XPETRA_MONITOR("TpetraCrsGraph::getNodeRowPtrs"); return graph_->getNodeRowPtrs(); }
356
357template<class LocalOrdinal, class GlobalOrdinal, class Node>
359{ XPETRA_MONITOR("TpetraCrsGraph::getMap"); return rcp( new TpetraMap(graph_->getMap()) ); }
360
361template<class LocalOrdinal, class GlobalOrdinal, class Node>
363 const Import &importer, CombineMode CM){
364 XPETRA_MONITOR("TpetraCrsGraph::doImport");
365
366 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, source, tSource, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
368 //graph_->doImport(toTpetraCrsGraph(source), *tImporter.getTpetra_Import(), toTpetra(CM));
369
370 graph_->doImport(*v, toTpetra(importer), toTpetra(CM));
371}
372
373template<class LocalOrdinal, class GlobalOrdinal, class Node>
375 const Import& importer, CombineMode CM) {
376 XPETRA_MONITOR("TpetraCrsGraph::doExport");
377
378 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, dest, tDest, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
380 graph_->doExport(*v, toTpetra(importer), toTpetra(CM));
381
382}
383
384template<class LocalOrdinal, class GlobalOrdinal, class Node>
386 const Export& exporter, CombineMode CM){
387 XPETRA_MONITOR("TpetraCrsGraph::doImport");
388
389 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, source, tSource, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
391
392 graph_->doImport(*v, toTpetra(exporter), toTpetra(CM));
393
394}
395
396template<class LocalOrdinal, class GlobalOrdinal, class Node>
398 const Export& exporter, CombineMode CM) {
399 XPETRA_MONITOR("TpetraCrsGraph::doExport");
400
401 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, dest, tDest, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
403
404 graph_->doExport(*v, toTpetra(exporter), toTpetra(CM));
405
406}
407
408template<class LocalOrdinal, class GlobalOrdinal, class Node>
409TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) : graph_(graph)
410{ }
411
412template<class LocalOrdinal, class GlobalOrdinal, class Node>
414{ return graph_; }
415
416
417
418
419#ifdef HAVE_XPETRA_EPETRA
420
421#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
422 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
423
424 // specialization of TpetraCrsGraph for GO=LO=int
425 template <>
427 : public CrsGraph<int,int,EpetraNode>
428 {
429 typedef int LocalOrdinal;
430 typedef int GlobalOrdinal;
432
433 // The following typedef is used by the XPETRA_DYNAMIC_CAST() macro.
436
437 public:
438
440
441
443 TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null) {
445 }
446
448 TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null) {
450 }
451
453 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) {
455 }
456
458 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) {
460 }
461
462#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
484 const typename local_graph_type::row_map_type& rowPointers,
485 const typename local_graph_type::entries_type::non_const_type& columnIndices,
486 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
489 "int",
490 typeid(EpetraNode).name());
491 }
492
512 const Teuchos::RCP<const map_type>& colMap,
513 const local_graph_type& lclGraph,
515 XPETRA_TPETRA_ETI_EXCEPTION( typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
516 typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
517 "int",
518 typeid(EpetraNode).name());
519 }
520
545 TpetraCrsGraph(const local_graph_type& lclGraph,
546 const Teuchos::RCP<const map_type>& rowMap,
547 const Teuchos::RCP<const map_type>& colMap,
548 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
549 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
550 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
551 XPETRA_TPETRA_ETI_EXCEPTION( typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
552 typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
553 "int",
554 typeid(EpetraNode).name());
555 }
556#endif
557
559 virtual ~TpetraCrsGraph() { }
560
562
564
565
568
570 void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices) { }
571
574
576 void allocateAllIndices(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind){ }
577
579 void setAllIndices(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind){ }
580
583
584
586
588
589
591 void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null) { }
592
594 void fillComplete(const RCP< ParameterList > &params=null) { }
595
598 const Teuchos::RCP<const map_type>& rangeMap,
599 const Teuchos::RCP<const Import< LocalOrdinal, GlobalOrdinal, Node > >& importer = null,
600 const Teuchos::RCP<const Export< LocalOrdinal, GlobalOrdinal, Node > >& exporter = null,
601 const Teuchos::RCP<Teuchos::ParameterList>& params=null){ }
602
604
606
607
609 RCP< const Comm< int > > getComm() const { return Teuchos::null; }
610
613
616
619
622
625
628
630 global_size_t getGlobalNumRows() const { return 0; }
631
633 global_size_t getGlobalNumCols() const { return 0; }
634
636 size_t getNodeNumRows() const { return 0; }
637
639 size_t getNodeNumCols() const { return 0; }
640
642 GlobalOrdinal getIndexBase() const { return 0; }
643
645 global_size_t getGlobalNumEntries() const { return 0; }
646
648 size_t getNodeNumEntries() const { return 0; }
649
651 size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
652
654 size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
655
657 size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
658
660 size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
661
663 size_t getGlobalMaxNumRowEntries() const { return 0; }
664
666 size_t getNodeMaxNumRowEntries() const { return 0; }
667
669 bool hasColMap() const { return false; }
670
672 bool isLocallyIndexed() const { return false; }
673
675 bool isGloballyIndexed() const { return false; }
676
678 bool isFillComplete() const { return false; }
679
681 bool isStorageOptimized() const { return false; }
682
685
688
689#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
691 local_graph_type getLocalGraph () const {
693 "Epetra does not support Kokkos::StaticCrsGraph!");
694 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
695 }
696#endif
697
700
702
704
705
707 std::string description() const { return std::string(""); }
708
711
713
715
716
719
721
723 //{@
724
727
731
735
739
743
744 // @}
745
747
748
750 TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
752 }
753
756
758 }; // TpetraCrsGraph class (specialization for LO=GO=int and NO=EpetraNode)
759#endif
760
761#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
762 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
763
764 // specialization of TpetraCrsGraph for GO=long long and NO=EpetraNode
765 template <>
766 class TpetraCrsGraph<int,long long,EpetraNode>
767 : public CrsGraph<int,long long,EpetraNode>
768 {
769 typedef int LocalOrdinal;
770 typedef long long GlobalOrdinal;
772
773 // The following typedef is used by the XPETRA_DYNAMIC_CAST() macro.
776
777 public:
778
780
781
783 TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null) {
785 }
786
788 TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null) {
790 }
791
793 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) {
795 }
796
798 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) {
800 }
801
802#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
824 const typename local_graph_type::row_map_type& rowPointers,
825 const typename local_graph_type::entries_type::non_const_type& columnIndices,
826 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
829 "int",
830 typeid(EpetraNode).name());
831 }
832
852 const Teuchos::RCP<const map_type>& colMap,
853 const local_graph_type& lclGraph,
855 XPETRA_TPETRA_ETI_EXCEPTION( typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
856 typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
857 "int",
858 typeid(EpetraNode).name());
859 }
860
885 TpetraCrsGraph(const local_graph_type& lclGraph,
886 const Teuchos::RCP<const map_type>& rowMap,
887 const Teuchos::RCP<const map_type>& colMap,
888 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
889 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
890 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
891 XPETRA_TPETRA_ETI_EXCEPTION( typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
892 typeid(TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,EpetraNode>).name(),
893 "int",
894 typeid(EpetraNode).name());
895 }
896#endif
897
918 const Teuchos::RCP< const map_type > &colMap,
919 const Teuchos::ArrayRCP<size_t>& rowPointers,
920 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
924 "int",
925 typeid(EpetraNode).name())
926 }
927
928
930 virtual ~TpetraCrsGraph() { }
931
933
935
936
939
941 void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices) { }
942
945
946
948 void allocateAllIndices(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind){ }
949
951 void setAllIndices(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind){ }
952
955
956
958
960
961
963 void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null) { }
964
966 void fillComplete(const RCP< ParameterList > &params=null) { }
967
970 const Teuchos::RCP<const map_type>& rangeMap,
971 const Teuchos::RCP<const Import< LocalOrdinal, GlobalOrdinal, Node > >& importer = null,
972 const Teuchos::RCP<const Export< LocalOrdinal, GlobalOrdinal, Node > >& exporter = null,
973 const Teuchos::RCP<Teuchos::ParameterList>& params=null){ }
974
976
978
979
981 RCP< const Comm< int > > getComm() const { return Teuchos::null; }
982
985
988
991
994
997
1000
1002 global_size_t getGlobalNumRows() const { return 0; }
1003
1005 global_size_t getGlobalNumCols() const { return 0; }
1006
1008 size_t getNodeNumRows() const { return 0; }
1009
1011 size_t getNodeNumCols() const { return 0; }
1012
1014 GlobalOrdinal getIndexBase() const { return 0; }
1015
1018
1020 size_t getNodeNumEntries() const { return 0; }
1021
1023 size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1024
1026 size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1027
1029 size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1030
1032 size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1033
1035 size_t getGlobalMaxNumRowEntries() const { return 0; }
1036
1038 size_t getNodeMaxNumRowEntries() const { return 0; }
1039
1041 bool hasColMap() const { return false; }
1042
1044 bool isLocallyIndexed() const { return false; }
1045
1047 bool isGloballyIndexed() const { return false; }
1048
1050 bool isFillComplete() const { return false; }
1051
1053 bool isStorageOptimized() const { return false; }
1054
1057
1060
1061#ifdef HAVE_XPETRA_KOKKOS_REFACTOR
1062#ifdef TPETRA_ENABLE_DEPRECATED_CODE
1064 typename local_graph_type::HostMirror getLocalGraph () const {
1066 "Epetra does not support Kokkos::StaticCrsGraph!");
1067 TEUCHOS_UNREACHABLE_RETURN((local_graph_type::HostMirror()));
1068 }
1069#endif
1070 local_graph_type getLocalGraphDevice () const {
1072 "Epetra does not support Kokkos::StaticCrsGraph!");
1073 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
1074 }
1075
1076 typename local_graph_type::HostMirror getLocalGraphHost () const {
1078 "Epetra does not support Kokkos::StaticCrsGraph!");
1079 TEUCHOS_UNREACHABLE_RETURN((local_graph_type::HostMirror()));
1080 }
1081
1082#endif
1083
1086
1088
1090
1091
1093 std::string description() const { return std::string(""); }
1094
1097
1099
1101
1102
1105
1107
1109 //{@
1110
1113
1117
1121
1125
1129
1130 // @}
1131
1133
1134
1136 TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
1138 }
1139
1142
1144 }; // TpetraCrsGraph class (specialization for GO=long long and NO=EpetraNode)
1145#endif
1146
1147#endif // HAVE_XPETRA_EPETRA
1148
1149
1150} // Xpetra namespace
1151#endif //XPETRA_TPETRACRSGRAPH_DEF_HPP
1152
#define XPETRA_MONITOR(funcName)
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
void resize(const size_type n, const T &val=T())
static const EVerbosityLevel verbLevel_default
bool is_null() const
T * get() const
Exception throws to report errors in the internal logical of the program.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
bool isStorageOptimized() const
Returns true if storage has been optimized.
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.
void computeGlobalConstants()
Dummy implementation for computeGlobalConstants.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row .
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets the 1D pointer arrays of the graph.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
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.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates the 1D pointer arrays of the graph.
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
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_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 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 ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null)
Constructor specifying (possibly different) number of entries in each row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
global_size_t getGlobalNumCols() const
Returns the number of global columns 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.
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
TpetraCrsGraph(const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
TpetraCrsGraph constructor to wrap a Tpetra::CrsGraph object.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
std::string description() const
Return a simple one-line description of this object.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
void expertStaticFillComplete(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=null, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=null, const Teuchos::RCP< Teuchos::ParameterList > &params=null)
Expert version of fillComplete.
bool hasColMap() const
Whether the graph has a column Map.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
RCP< const Comm< int > > getComm() const
Returns the communicator.
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
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.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets the 1D pointer arrays of the graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
global_size_t getGlobalNumEntries() const
Returns the global 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.
void expertStaticFillComplete(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=null, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=null, const Teuchos::RCP< Teuchos::ParameterList > &params=null)
Expert version of fillComplete.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
bool hasColMap() const
Whether the graph has a column Map.
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
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.
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the graph.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
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 Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
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.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null)
Constructor specifying fixed number of entries for each row.
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates the 1D pointer arrays of 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.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
TpetraCrsGraph(const Teuchos::RCP< const map_type > &rowMap, const Teuchos::RCP< const map_type > &colMap, const Teuchos::ArrayRCP< size_t > &rowPointers, const Teuchos::ArrayRCP< LocalOrdinal > &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row .
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
TpetraCrsGraph(const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
TpetraCrsGraph constructor to wrap a Tpetra::CrsGraph object.
RCP< const Comm< int > > getComm() const
Returns the communicator.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
std::string description() const
Return a simple one-line description of this object.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
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.
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.
void computeGlobalConstants()
Dummy implementation for computeGlobalConstants.
bool isStorageOptimized() const
Returns true if storage has been optimized.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets the 1D pointer arrays of the graph.
void fillComplete(const RCP< const Map > &domainMap, const RCP< const Map > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
RCP< const Comm< int > > getComm() const
Returns the communicator.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates the 1D pointer arrays of the graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
void expertStaticFillComplete(const Teuchos::RCP< const map_type > &domainMap, const Teuchos::RCP< const map_type > &rangeMap, const Teuchos::RCP< const Import > &importer=Teuchos::null, const Teuchos::RCP< const Export > &exporter=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Expert version of fillComplete.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
TpetraCrsGraph(const RCP< const Map > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null)
Constructor specifying fixed number of entries for each row.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
RCP< const Import > getImporter() const
Returns the importer associated with this graph.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row.
virtual ~TpetraCrsGraph()
Destructor.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row .
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
bool hasColMap() const
Whether the graph has a column Map.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import &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.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
RCP< const Map > getRowMap() const
Returns the Map that describes the row distribution in this graph.
RCP< const Map > getRangeMap() const
Returns the Map associated with the domain of this graph.
bool isStorageOptimized() const
Returns true if storage has been optimized.
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the graph.
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.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import &importer, CombineMode CM)
Import.
Teuchos::RCP< const Map > getMap() const
Implements DistObject interface.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
std::string description() const
Return a simple one-line description of this object.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
RCP< const Export > getExporter() const
Returns the exporter associated with this graph.
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.
RCP< const Map > getDomainMap() const
Returns the Map associated with the domain of this graph.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
RCP< const Map > getColMap() const
Returns the Map that describes the column distribution in this graph.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Xpetra namespace
size_t global_size_t
Global size_t object.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
CombineMode
Xpetra::Combine Mode enumerable type.