Xpetra Version of the Day
Loading...
Searching...
No Matches
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, params))) { }
67
68template<class LocalOrdinal, class GlobalOrdinal, class Node>
70: graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), NumEntriesPerRowToAlloc(), params))) { }
71
72template<class LocalOrdinal, class GlobalOrdinal, class Node>
74: graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), toTpetra(colMap), maxNumEntriesPerRow, params))) { }
75
76template<class LocalOrdinal, class GlobalOrdinal, class Node>
78: graph_(Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(toTpetra(rowMap), toTpetra(colMap), NumEntriesPerRowToAlloc(), 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
103template<class LocalOrdinal, class GlobalOrdinal, class Node>
106 const Teuchos::RCP< const Map > &colMap,
107 const typename local_graph_type::row_map_type& rowPointers,
108 const typename local_graph_type::entries_type::non_const_type& columnIndices,
110 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, plist))) { }
111
112
113template<class LocalOrdinal, class GlobalOrdinal, class Node>
116 const Teuchos::RCP<const map_type>& colMap,
117 const local_graph_type& lclGraph,
119 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), lclGraph, params))) { }
120
121template<class LocalOrdinal, class GlobalOrdinal, class Node>
123TpetraCrsGraph(const local_graph_type& lclGraph,
124 const Teuchos::RCP<const map_type>& rowMap,
125 const Teuchos::RCP<const map_type>& colMap,
126 const Teuchos::RCP<const map_type>& domainMap,
127 const Teuchos::RCP<const map_type>& rangeMap,
129 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph, toTpetra(rowMap), toTpetra(colMap), toTpetra(domainMap), toTpetra(rangeMap), params))) { }
130
131template<class LocalOrdinal, class GlobalOrdinal, class Node>
134 const Teuchos::RCP< const Map > &colMap,
135 const Teuchos::ArrayRCP<size_t>& rowPointers,
136 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
138 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, params))) { }
139
140
141template<class LocalOrdinal, class GlobalOrdinal, class Node>
143
144template<class LocalOrdinal, class GlobalOrdinal, class Node>
146{ XPETRA_MONITOR("TpetraCrsGraph::insertGlobalIndices"); graph_->insertGlobalIndices(globalRow, indices); }
147
148template<class LocalOrdinal, class GlobalOrdinal, class Node>
150{ XPETRA_MONITOR("TpetraCrsGraph::insertLocalIndices"); graph_->insertLocalIndices(localRow, indices); }
151
152template<class LocalOrdinal, class GlobalOrdinal, class Node>
154{ XPETRA_MONITOR("TpetraCrsGraph::removeLocalIndices"); graph_->removeLocalIndices(localRow); }
155
156template<class LocalOrdinal, class GlobalOrdinal, class Node>
158allocateAllIndices(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind) {
159 rowptr.resize(getLocalNumRows()+1); colind.resize(numNonZeros);
160}
161
162template<class LocalOrdinal, class GlobalOrdinal, class Node>
164setAllIndices(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind) {
165 graph_->setAllIndices(rowptr,colind);
166}
167
168template<class LocalOrdinal, class GlobalOrdinal, class Node>
171 rowptr = Kokkos::Compat::persistingView(graph_->getLocalRowPtrsHost());
172 colind = Kokkos::Compat::persistingView(graph_->getLocalIndicesHost());
173}
174
175template<class LocalOrdinal, class GlobalOrdinal, class Node>
177{ XPETRA_MONITOR("TpetraCrsGraph::fillComplete"); graph_->fillComplete(toTpetra(domainMap), toTpetra(rangeMap), params); }
178
179template<class LocalOrdinal, class GlobalOrdinal, class Node>
181{ XPETRA_MONITOR("TpetraCrsGraph::fillComplete"); graph_->fillComplete(params); }
182
183template<class LocalOrdinal, class GlobalOrdinal, class Node>
186 const Teuchos::RCP<const map_type>& rangeMap,
187 const Teuchos::RCP<const Import>& importer,
188 const Teuchos::RCP<const Export>& exporter,
190 XPETRA_MONITOR("TpetraCrsGraph::expertStaticFillComplete");
193
194 if(importer!=Teuchos::null) {
195 XPETRA_DYNAMIC_CAST( const TpetraImportClass , *importer, tImporter, "Xpetra::TpetraCrsGraph::expertStaticFillComplete only accepts Xpetra::TpetraImport.");
196 myImport = tImporter.getTpetra_Import();
197 }
198 if(exporter!=Teuchos::null) {
199 XPETRA_DYNAMIC_CAST( const TpetraExportClass , *exporter, tExporter, "Xpetra::TpetraCrsGraph::expertStaticFillComplete only accepts Xpetra::TpetraExport.");
200 myExport = tExporter.getTpetra_Export();
201 }
202
203 graph_->expertStaticFillComplete(toTpetra(domainMap),toTpetra(rangeMap),myImport,myExport,params);
204}
205
206
207template<class LocalOrdinal, class GlobalOrdinal, class Node>
209{ XPETRA_MONITOR("TpetraCrsGraph::getComm"); return graph_->getComm(); }
210
211template<class LocalOrdinal, class GlobalOrdinal, class Node>
213{ XPETRA_MONITOR("TpetraCrsGraph::getRowMap"); return toXpetra(graph_->getRowMap()); }
214
215template<class LocalOrdinal, class GlobalOrdinal, class Node>
217{ XPETRA_MONITOR("TpetraCrsGraph::getColMap"); return toXpetra(graph_->getColMap()); }
218
219template<class LocalOrdinal, class GlobalOrdinal, class Node>
221{ XPETRA_MONITOR("TpetraCrsGraph::getDomainMap"); return toXpetra(graph_->getDomainMap()); }
222
223template<class LocalOrdinal, class GlobalOrdinal, class Node>
225{ XPETRA_MONITOR("TpetraCrsGraph::getRangeMap"); return toXpetra(graph_->getRangeMap()); }
226
227template<class LocalOrdinal, class GlobalOrdinal, class Node>
229{ XPETRA_MONITOR("TpetraCrsGraph::getImporter"); return toXpetra(graph_->getImporter()); }
230
231template<class LocalOrdinal, class GlobalOrdinal, class Node>
233{ XPETRA_MONITOR("TpetraCrsGraph::getExporter"); return toXpetra(graph_->getExporter()); }
234
235template<class LocalOrdinal, class GlobalOrdinal, class Node>
237{ XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumRows"); return graph_->getGlobalNumRows(); }
238
239template<class LocalOrdinal, class GlobalOrdinal, class Node>
241{ XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumCols"); return graph_->getGlobalNumCols(); }
242
243template<class LocalOrdinal, class GlobalOrdinal, class Node>
245{ XPETRA_MONITOR("TpetraCrsGraph::getLocalNumRows"); return graph_->getLocalNumRows(); }
246
247template<class LocalOrdinal, class GlobalOrdinal, class Node>
249{ XPETRA_MONITOR("TpetraCrsGraph::getLocalNumCols"); return graph_->getLocalNumCols(); }
250
251template<class LocalOrdinal, class GlobalOrdinal, class Node>
253{ XPETRA_MONITOR("TpetraCrsGraph::getIndexBase"); return graph_->getIndexBase(); }
254
255template<class LocalOrdinal, class GlobalOrdinal, class Node>
257{ XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumEntries"); return graph_->getGlobalNumEntries(); }
258
259template<class LocalOrdinal, class GlobalOrdinal, class Node>
261{ XPETRA_MONITOR("TpetraCrsGraph::getLocalNumEntries"); return graph_->getLocalNumEntries(); }
262
263template<class LocalOrdinal, class GlobalOrdinal, class Node>
265{ XPETRA_MONITOR("TpetraCrsGraph::getNumEntriesInGlobalRow"); return graph_->getNumEntriesInGlobalRow(globalRow); }
266
267template<class LocalOrdinal, class GlobalOrdinal, class Node>
269{ XPETRA_MONITOR("TpetraCrsGraph::getNumEntriesInLocalRow"); return graph_->getNumEntriesInLocalRow(localRow); }
270
271template<class LocalOrdinal, class GlobalOrdinal, class Node>
273{ XPETRA_MONITOR("TpetraCrsGraph::getNumAllocatedEntriesInGlobalRow"); return graph_->getNumAllocatedEntriesInGlobalRow(globalRow); }
274
275template<class LocalOrdinal, class GlobalOrdinal, class Node>
277{ XPETRA_MONITOR("TpetraCrsGraph::getNumAllocatedEntriesInLocalRow"); return graph_->getNumAllocatedEntriesInLocalRow(localRow); }
278
279template<class LocalOrdinal, class GlobalOrdinal, class Node>
281{ XPETRA_MONITOR("TpetraCrsGraph::getGlobalMaxNumRowEntries"); return graph_->getGlobalMaxNumRowEntries(); }
282
283template<class LocalOrdinal, class GlobalOrdinal, class Node>
285{ XPETRA_MONITOR("TpetraCrsGraph::getLocalMaxNumRowEntries"); return graph_->getLocalMaxNumRowEntries(); }
286
287template<class LocalOrdinal, class GlobalOrdinal, class Node>
289{ XPETRA_MONITOR("TpetraCrsGraph::hasColMap"); return graph_->hasColMap(); }
290
291template<class LocalOrdinal, class GlobalOrdinal, class Node>
293{ XPETRA_MONITOR("TpetraCrsGraph::isLocallyIndexed"); return graph_->isLocallyIndexed(); }
294
295template<class LocalOrdinal, class GlobalOrdinal, class Node>
297{ XPETRA_MONITOR("TpetraCrsGraph::isGloballyIndexed"); return graph_->isGloballyIndexed(); }
298
299template<class LocalOrdinal, class GlobalOrdinal, class Node>
301{ XPETRA_MONITOR("TpetraCrsGraph::isFillComplete"); return graph_->isFillComplete(); }
302
303template<class LocalOrdinal, class GlobalOrdinal, class Node>
305{ XPETRA_MONITOR("TpetraCrsGraph::isStorageOptimized"); return graph_->isStorageOptimized(); }
306
307template<class LocalOrdinal, class GlobalOrdinal, class Node>
309{
310 XPETRA_MONITOR("TpetraCrsGraph::getGlobalRowView");
311 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::global_inds_host_view_type indices;
312 graph_->getGlobalRowView(GlobalRow, indices);
313 Indices = ArrayView<const GlobalOrdinal> (indices.data(), indices.extent(0));
314}
315
316template<class LocalOrdinal, class GlobalOrdinal, class Node>
318{
319 XPETRA_MONITOR("TpetraCrsGraph::getLocalRowView");
320 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::local_inds_host_view_type indices;
321 graph_->getLocalRowView(LocalRow, indices);
322 Indices = ArrayView<const LocalOrdinal> (indices.data(), indices.extent(0));
323}
324
325template<class LocalOrdinal, class GlobalOrdinal, class Node>
327 return getTpetra_CrsGraph()->getLocalGraphHost();
328}
329
330template<class LocalOrdinal, class GlobalOrdinal, class Node>
332 return getTpetra_CrsGraph()->getLocalGraphDevice();
333}
334
335template<class LocalOrdinal, class GlobalOrdinal, class Node>
337 // mfh 07 May 2018: See GitHub Issue #2565.
338 graph_->computeGlobalConstants();
339 }
340
341template<class LocalOrdinal, class GlobalOrdinal, class Node>
343{ XPETRA_MONITOR("TpetraCrsGraph::description"); return graph_->description(); }
344
345template<class LocalOrdinal, class GlobalOrdinal, class Node>
347{ XPETRA_MONITOR("TpetraCrsGraph::describe"); graph_->describe(out, verbLevel); }
348
349template<class LocalOrdinal, class GlobalOrdinal, class Node>
351{ XPETRA_MONITOR("TpetraCrsGraph::getNodeRowPtrs"); return Kokkos::Compat::persistingView(graph_->getLocalRowPtrsHost()); }
352
353template<class LocalOrdinal, class GlobalOrdinal, class Node>
355{ XPETRA_MONITOR("TpetraCrsGraph::getMap"); return rcp( new TpetraMap(graph_->getMap()) ); }
356
357template<class LocalOrdinal, class GlobalOrdinal, class Node>
359 const Import &importer, CombineMode CM){
360 XPETRA_MONITOR("TpetraCrsGraph::doImport");
361
362 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, source, tSource, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
364 //graph_->doImport(toTpetraCrsGraph(source), *tImporter.getTpetra_Import(), toTpetra(CM));
365
366 graph_->doImport(*v, toTpetra(importer), toTpetra(CM));
367}
368
369template<class LocalOrdinal, class GlobalOrdinal, class Node>
371 const Import& importer, CombineMode CM) {
372 XPETRA_MONITOR("TpetraCrsGraph::doExport");
373
374 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, dest, tDest, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
376 graph_->doExport(*v, toTpetra(importer), toTpetra(CM));
377
378}
379
380template<class LocalOrdinal, class GlobalOrdinal, class Node>
382 const Export& exporter, CombineMode CM){
383 XPETRA_MONITOR("TpetraCrsGraph::doImport");
384
385 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, source, tSource, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
387
388 graph_->doImport(*v, toTpetra(exporter), toTpetra(CM));
389
390}
391
392template<class LocalOrdinal, class GlobalOrdinal, class Node>
394 const Export& exporter, CombineMode CM) {
395 XPETRA_MONITOR("TpetraCrsGraph::doExport");
396
397 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, dest, tDest, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments.");//TODO: remove and use toTpetra()
399
400 graph_->doExport(*v, toTpetra(exporter), toTpetra(CM));
401
402}
403
404template<class LocalOrdinal, class GlobalOrdinal, class Node>
405TpetraCrsGraph<LocalOrdinal,GlobalOrdinal,Node>::TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) : graph_(graph)
406{ }
407
408template<class LocalOrdinal, class GlobalOrdinal, class Node>
410{ return graph_; }
411
412
413
414
415#ifdef HAVE_XPETRA_EPETRA
416
417#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
418 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
419
420 // specialization of TpetraCrsGraph for GO=LO=int
421 template <>
423 : public CrsGraph<int,int,EpetraNode>
424 {
425 typedef int LocalOrdinal;
426 typedef int GlobalOrdinal;
428
429 // The following typedef is used by the XPETRA_DYNAMIC_CAST() macro.
432
433 public:
434
436
437
439 TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null) {
441 }
442
444 TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null) {
446 }
447
449 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) {
451 }
452
454 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) {
456 }
457
479 const typename local_graph_type::row_map_type& rowPointers,
480 const typename local_graph_type::entries_type::non_const_type& columnIndices,
481 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
484 "int",
485 typeid(EpetraNode).name());
486 }
487
507 const Teuchos::RCP<const map_type>& colMap,
508 const local_graph_type& lclGraph,
512 "int",
513 typeid(EpetraNode).name());
514 }
515
541 const Teuchos::RCP<const map_type>& rowMap,
542 const Teuchos::RCP<const map_type>& colMap,
543 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
544 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
545 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
548 "int",
549 typeid(EpetraNode).name());
550 }
551
553 virtual ~TpetraCrsGraph() { }
554
556
558
559
562
564 void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices) { }
565
568
570 void allocateAllIndices(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind){ }
571
573 void setAllIndices(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind){ }
574
577
578
580
582
583
585 void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null) { }
586
588 void fillComplete(const RCP< ParameterList > &params=null) { }
589
592 const Teuchos::RCP<const map_type>& rangeMap,
593 const Teuchos::RCP<const Import< LocalOrdinal, GlobalOrdinal, Node > >& importer = null,
594 const Teuchos::RCP<const Export< LocalOrdinal, GlobalOrdinal, Node > >& exporter = null,
595 const Teuchos::RCP<Teuchos::ParameterList>& params=null){ }
596
598
600
601
603 RCP< const Comm< int > > getComm() const { return Teuchos::null; }
604
607
610
613
616
619
622
624 global_size_t getGlobalNumRows() const { return 0; }
625
627 global_size_t getGlobalNumCols() const { return 0; }
628
630 size_t getLocalNumRows() const { return 0; }
631
633 size_t getLocalNumCols() const { return 0; }
634
636 GlobalOrdinal getIndexBase() const { return 0; }
637
639 global_size_t getGlobalNumEntries() const { return 0; }
640
642 size_t getLocalNumEntries() const { return 0; }
643
645 size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
646
648 size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
649
651 size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
652
654 size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
655
657 size_t getGlobalMaxNumRowEntries() const { return 0; }
658
660 size_t getLocalMaxNumRowEntries() const { return 0; }
661
663 bool hasColMap() const { return false; }
664
666 bool isLocallyIndexed() const { return false; }
667
669 bool isGloballyIndexed() const { return false; }
670
672 bool isFillComplete() const { return false; }
673
675 bool isStorageOptimized() const { return false; }
676
679
682
686 "Epetra does not support Kokkos::StaticCrsGraph!");
688 }
689
692
694
696
697
699 std::string description() const { return std::string(""); }
700
703
705
707
708
711
713
715 //{@
716
719
723
727
731
735
736 // @}
737
739
740
742 TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
744 }
745
748
750 }; // TpetraCrsGraph class (specialization for LO=GO=int and NO=EpetraNode)
751#endif
752
753#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
754 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
755
756 // specialization of TpetraCrsGraph for GO=long long and NO=EpetraNode
757 template <>
758 class TpetraCrsGraph<int,long long,EpetraNode>
759 : public CrsGraph<int,long long,EpetraNode>
760 {
761 typedef int LocalOrdinal;
762 typedef long long GlobalOrdinal;
764
765 // The following typedef is used by the XPETRA_DYNAMIC_CAST() macro.
768
769 public:
770
772
773
775 TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null) {
777 }
778
780 TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > &params=null) {
782 }
783
785 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) {
787 }
788
790 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) {
792 }
793
815 const typename local_graph_type::row_map_type& rowPointers,
816 const typename local_graph_type::entries_type::non_const_type& columnIndices,
817 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
820 "int",
821 typeid(EpetraNode).name());
822 }
823
843 const Teuchos::RCP<const map_type>& colMap,
844 const local_graph_type& lclGraph,
848 "int",
849 typeid(EpetraNode).name());
850 }
851
877 const Teuchos::RCP<const map_type>& rowMap,
878 const Teuchos::RCP<const map_type>& colMap,
879 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
880 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
881 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
884 "int",
885 typeid(EpetraNode).name());
886 }
887
908 const Teuchos::RCP< const map_type > &colMap,
909 const Teuchos::ArrayRCP<size_t>& rowPointers,
910 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
914 "int",
915 typeid(EpetraNode).name())
916 }
917
918
920 virtual ~TpetraCrsGraph() { }
921
923
925
926
929
931 void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices) { }
932
935
936
938 void allocateAllIndices(size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind){ }
939
941 void setAllIndices(const ArrayRCP<size_t> & rowptr, const ArrayRCP<LocalOrdinal> & colind){ }
942
945
946
948
950
951
953 void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null) { }
954
956 void fillComplete(const RCP< ParameterList > &params=null) { }
957
960 const Teuchos::RCP<const map_type>& rangeMap,
961 const Teuchos::RCP<const Import< LocalOrdinal, GlobalOrdinal, Node > >& importer = null,
962 const Teuchos::RCP<const Export< LocalOrdinal, GlobalOrdinal, Node > >& exporter = null,
963 const Teuchos::RCP<Teuchos::ParameterList>& params=null){ }
964
966
968
969
971 RCP< const Comm< int > > getComm() const { return Teuchos::null; }
972
975
978
981
984
987
990
992 global_size_t getGlobalNumRows() const { return 0; }
993
995 global_size_t getGlobalNumCols() const { return 0; }
996
998 size_t getLocalNumRows() const { return 0; }
999
1001 size_t getLocalNumCols() const { return 0; }
1002
1004 GlobalOrdinal getIndexBase() const { return 0; }
1005
1008
1010 size_t getLocalNumEntries() const { return 0; }
1011
1013 size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1014
1016 size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1017
1019 size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1020
1022 size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1023
1025 size_t getGlobalMaxNumRowEntries() const { return 0; }
1026
1028 size_t getLocalMaxNumRowEntries() const { return 0; }
1029
1031 bool hasColMap() const { return false; }
1032
1034 bool isLocallyIndexed() const { return false; }
1035
1037 bool isGloballyIndexed() const { return false; }
1038
1040 bool isFillComplete() const { return false; }
1041
1043 bool isStorageOptimized() const { return false; }
1044
1047
1050
1053 "Epetra does not support Kokkos::StaticCrsGraph!");
1055 }
1056
1057 typename local_graph_type::HostMirror getLocalGraphHost () const {
1059 "Epetra does not support Kokkos::StaticCrsGraph!");
1060 TEUCHOS_UNREACHABLE_RETURN((local_graph_type::HostMirror()));
1061 }
1062
1065
1067
1069
1070
1072 std::string description() const { return std::string(""); }
1073
1076
1078
1080
1081
1084
1086
1088 //{@
1089
1092
1096
1100
1104
1108
1109 // @}
1110
1112
1113
1115 TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
1117 }
1118
1121
1123 }; // TpetraCrsGraph class (specialization for GO=long long and NO=EpetraNode)
1124#endif
1125
1126#endif // HAVE_XPETRA_EPETRA
1127
1128
1129} // Xpetra namespace
1130#endif //XPETRA_TPETRACRSGRAPH_DEF_HPP
1131
#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
Kokkos::StaticCrsGraph< LocalOrdinal, Kokkos::LayoutLeft, device_type, void, size_t > local_graph_type
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.
TpetraCrsGraph(const local_graph_type &lclGraph, const Teuchos::RCP< const map_type > &rowMap, const Teuchos::RCP< const map_type > &colMap, const Teuchos::RCP< const map_type > &domainMap=Teuchos::null, const Teuchos::RCP< const map_type > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
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 .
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
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(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const typename local_graph_type::row_map_type &rowPointers, const typename local_graph_type::entries_type::non_const_type &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
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.
size_t getLocalNumEntries() const
Returns the local number of entries in the graph.
TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > &params=null)
Constructor specifying fixed number of entries for each row.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
void 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).
local_graph_type getLocalGraph() const
Access the local KokkosSparse::StaticCrsGraph data.
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.
size_t getLocalNumRows() const
Returns the number of graph rows owned on the calling node.
size_t getLocalMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
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.
TpetraCrsGraph(const Teuchos::RCP< const map_type > &rowMap, const Teuchos::RCP< const map_type > &colMap, const local_graph_type &lclGraph, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
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 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 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.
size_t getLocalMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
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.
local_graph_type::HostMirror getLocalGraphHost() const
Get the local graph.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
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 local_graph_type &lclGraph, const Teuchos::RCP< const map_type > &rowMap, const Teuchos::RCP< const map_type > &colMap, const Teuchos::RCP< const map_type > &domainMap=Teuchos::null, const Teuchos::RCP< const map_type > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
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.
size_t getLocalNumRows() const
Returns the number of graph rows owned on the calling node.
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.
size_t getLocalNumEntries() const
Returns the local number of entries in the graph.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
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.
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.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
TpetraCrsGraph(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const typename local_graph_type::row_map_type &rowPointers, const typename local_graph_type::entries_type::non_const_type &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
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.
TpetraCrsGraph(const Teuchos::RCP< const map_type > &rowMap, const Teuchos::RCP< const map_type > &colMap, const local_graph_type &lclGraph, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views.
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.
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.
size_t getLocalMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
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.
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.
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 getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
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.
local_graph_type getLocalGraphDevice() const
Access the local KokkosSparse::StaticCrsGraph data for device use.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row .
size_t getLocalNumRows() const
Returns the number of graph rows owned on the calling node.
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.
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.
size_t getLocalNumEntries() const
Returns the local number of entries in the 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.
local_graph_type::HostMirror getLocalGraphHost() const
Access the local KokkosSparse::StaticCrsGraph data for host use.
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.
Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type local_graph_type
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.