Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_TpetraCrsGraph_def.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Xpetra: A linear algebra interface package
4//
5// Copyright 2012 NTESS and the Xpetra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef XPETRA_TPETRACRSGRAPH_DEF_HPP
11#define XPETRA_TPETRACRSGRAPH_DEF_HPP
13#include "Xpetra_Exceptions.hpp"
14
15#include "Tpetra_CrsGraph.hpp"
16
17#include "Xpetra_CrsGraph.hpp"
19#include "Xpetra_Utils.hpp"
20#include "Xpetra_TpetraMap.hpp"
21#include "Xpetra_TpetraImport.hpp"
22#include "Xpetra_TpetraExport.hpp"
23
24namespace Xpetra {
25
26template <class LocalOrdinal, class GlobalOrdinal, class Node>
28 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), maxNumEntriesPerRow, params))) {}
29
30template <class LocalOrdinal, class GlobalOrdinal, class Node>
32 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), NumEntriesPerRowToAlloc(), params))) {}
33
34template <class LocalOrdinal, class GlobalOrdinal, class Node>
35TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>::TpetraCrsGraph(const RCP<const Map> &rowMap, const RCP<const Map> &colMap, size_t maxNumEntriesPerRow, const RCP<ParameterList> &params)
36 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), maxNumEntriesPerRow, params))) {}
37
38template <class LocalOrdinal, class GlobalOrdinal, class Node>
40 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), NumEntriesPerRowToAlloc(), params))) {}
41
42template <class LocalOrdinal, class GlobalOrdinal, class Node>
45 const Import &importer,
46 const Teuchos::RCP<const Map> &domainMap,
47 const Teuchos::RCP<const Map> &rangeMap,
49 typedef Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> MyTpetraCrsGraph;
50 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, *sourceGraph, tSourceGraph, "Xpetra::TpetraCrsMatrix constructor only accepts Xpetra::TpetraCrsMatrix as the input argument."); // TODO: remove and use toTpetra()
51 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSourceGraph.getTpetra_CrsGraph();
52
53 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > myDomainMap = domainMap != Teuchos::null ? toTpetra(domainMap) : Teuchos::null;
54 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > myRangeMap = rangeMap != Teuchos::null ? toTpetra(rangeMap) : Teuchos::null;
55 graph_ = Tpetra::importAndFillCompleteCrsGraph<MyTpetraCrsGraph>(v, toTpetra(importer), myDomainMap, myRangeMap, params);
56 bool restrictComm = false;
57 if (!params.is_null()) restrictComm = params->get("Restrict Communicator", restrictComm);
58 if (restrictComm && graph_->getRowMap().is_null()) graph_ = Teuchos::null;
59}
60
61template <class LocalOrdinal, class GlobalOrdinal, class Node>
64 const Teuchos::RCP<const Map> &colMap,
65 const typename local_graph_type::row_map_type &rowPointers,
66 const typename local_graph_type::entries_type::non_const_type &columnIndices,
68 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, plist))) {}
69
70template <class LocalOrdinal, class GlobalOrdinal, class Node>
73 const Teuchos::RCP<const map_type> &colMap,
74 const local_graph_type &lclGraph,
76 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), lclGraph, params))) {}
77
78template <class LocalOrdinal, class GlobalOrdinal, class Node>
80 TpetraCrsGraph(const local_graph_type &lclGraph,
81 const Teuchos::RCP<const map_type> &rowMap,
82 const Teuchos::RCP<const map_type> &colMap,
83 const Teuchos::RCP<const map_type> &domainMap,
84 const Teuchos::RCP<const map_type> &rangeMap,
86 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph, toTpetra(rowMap), toTpetra(colMap), toTpetra(domainMap), toTpetra(rangeMap), params))) {}
87
88template <class LocalOrdinal, class GlobalOrdinal, class Node>
91 const Teuchos::RCP<const Map> &colMap,
92 const Teuchos::ArrayRCP<size_t> &rowPointers,
93 const Teuchos::ArrayRCP<LocalOrdinal> &columnIndices,
95 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, params))) {}
96
97template <class LocalOrdinal, class GlobalOrdinal, class Node>
99
100template <class LocalOrdinal, class GlobalOrdinal, class Node>
102 XPETRA_MONITOR("TpetraCrsGraph::insertGlobalIndices");
103 graph_->insertGlobalIndices(globalRow, indices);
104}
105
106template <class LocalOrdinal, class GlobalOrdinal, class Node>
108 XPETRA_MONITOR("TpetraCrsGraph::insertLocalIndices");
109 graph_->insertLocalIndices(localRow, indices);
110}
111
112template <class LocalOrdinal, class GlobalOrdinal, class Node>
114 XPETRA_MONITOR("TpetraCrsGraph::removeLocalIndices");
115 graph_->removeLocalIndices(localRow);
116}
117
118template <class LocalOrdinal, class GlobalOrdinal, class Node>
120 allocateAllIndices(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind) {
121 rowptr.resize(getLocalNumRows() + 1);
122 colind.resize(numNonZeros);
123}
124
125template <class LocalOrdinal, class GlobalOrdinal, class Node>
127 setAllIndices(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind) {
128 graph_->setAllIndices(rowptr, colind);
129}
130
131template <class LocalOrdinal, class GlobalOrdinal, class Node>
134 rowptr = Kokkos::Compat::persistingView(graph_->getLocalRowPtrsHost());
135 colind = Kokkos::Compat::persistingView(graph_->getLocalIndicesHost());
136}
137
138template <class LocalOrdinal, class GlobalOrdinal, class Node>
140 XPETRA_MONITOR("TpetraCrsGraph::fillComplete");
141 graph_->fillComplete(toTpetra(domainMap), toTpetra(rangeMap), params);
142}
143
144template <class LocalOrdinal, class GlobalOrdinal, class Node>
146 XPETRA_MONITOR("TpetraCrsGraph::fillComplete");
147 graph_->fillComplete(params);
148}
149
150template <class LocalOrdinal, class GlobalOrdinal, class Node>
153 const Teuchos::RCP<const map_type> &rangeMap,
154 const Teuchos::RCP<const Import> &importer,
155 const Teuchos::RCP<const Export> &exporter,
157 XPETRA_MONITOR("TpetraCrsGraph::expertStaticFillComplete");
160
161 if (importer != Teuchos::null) {
162 XPETRA_DYNAMIC_CAST(const TpetraImportClass, *importer, tImporter, "Xpetra::TpetraCrsGraph::expertStaticFillComplete only accepts Xpetra::TpetraImport.");
163 myImport = tImporter.getTpetra_Import();
164 }
165 if (exporter != Teuchos::null) {
166 XPETRA_DYNAMIC_CAST(const TpetraExportClass, *exporter, tExporter, "Xpetra::TpetraCrsGraph::expertStaticFillComplete only accepts Xpetra::TpetraExport.");
167 myExport = tExporter.getTpetra_Export();
168 }
169
170 graph_->expertStaticFillComplete(toTpetra(domainMap), toTpetra(rangeMap), myImport, myExport, params);
171}
172
173template <class LocalOrdinal, class GlobalOrdinal, class Node>
175 XPETRA_MONITOR("TpetraCrsGraph::getComm");
176 return graph_->getComm();
177}
178
179template <class LocalOrdinal, class GlobalOrdinal, class Node>
184
185template <class LocalOrdinal, class GlobalOrdinal, class Node>
190
191template <class LocalOrdinal, class GlobalOrdinal, class Node>
196
197template <class LocalOrdinal, class GlobalOrdinal, class Node>
202
203template <class LocalOrdinal, class GlobalOrdinal, class Node>
208
209template <class LocalOrdinal, class GlobalOrdinal, class Node>
214
215template <class LocalOrdinal, class GlobalOrdinal, class Node>
217 XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumRows");
218 return graph_->getGlobalNumRows();
219}
220
221template <class LocalOrdinal, class GlobalOrdinal, class Node>
223 XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumCols");
224 return graph_->getGlobalNumCols();
225}
226
227template <class LocalOrdinal, class GlobalOrdinal, class Node>
229 XPETRA_MONITOR("TpetraCrsGraph::getLocalNumRows");
230 return graph_->getLocalNumRows();
231}
232
233template <class LocalOrdinal, class GlobalOrdinal, class Node>
235 XPETRA_MONITOR("TpetraCrsGraph::getLocalNumCols");
236 return graph_->getLocalNumCols();
237}
238
239template <class LocalOrdinal, class GlobalOrdinal, class Node>
241 XPETRA_MONITOR("TpetraCrsGraph::getIndexBase");
242 return graph_->getIndexBase();
243}
244
245template <class LocalOrdinal, class GlobalOrdinal, class Node>
247 XPETRA_MONITOR("TpetraCrsGraph::getGlobalNumEntries");
248 return graph_->getGlobalNumEntries();
249}
250
251template <class LocalOrdinal, class GlobalOrdinal, class Node>
253 XPETRA_MONITOR("TpetraCrsGraph::getLocalNumEntries");
254 return graph_->getLocalNumEntries();
255}
256
257template <class LocalOrdinal, class GlobalOrdinal, class Node>
259 XPETRA_MONITOR("TpetraCrsGraph::getNumEntriesInGlobalRow");
260 return graph_->getNumEntriesInGlobalRow(globalRow);
261}
262
263template <class LocalOrdinal, class GlobalOrdinal, class Node>
265 XPETRA_MONITOR("TpetraCrsGraph::getNumEntriesInLocalRow");
266 return graph_->getNumEntriesInLocalRow(localRow);
267}
268
269template <class LocalOrdinal, class GlobalOrdinal, class Node>
271 XPETRA_MONITOR("TpetraCrsGraph::getNumAllocatedEntriesInGlobalRow");
272 return graph_->getNumAllocatedEntriesInGlobalRow(globalRow);
273}
274
275template <class LocalOrdinal, class GlobalOrdinal, class Node>
277 XPETRA_MONITOR("TpetraCrsGraph::getNumAllocatedEntriesInLocalRow");
278 return graph_->getNumAllocatedEntriesInLocalRow(localRow);
279}
280
281template <class LocalOrdinal, class GlobalOrdinal, class Node>
283 XPETRA_MONITOR("TpetraCrsGraph::getGlobalMaxNumRowEntries");
284 return graph_->getGlobalMaxNumRowEntries();
286
287template <class LocalOrdinal, class GlobalOrdinal, class Node>
289 XPETRA_MONITOR("TpetraCrsGraph::getLocalMaxNumRowEntries");
290 return graph_->getLocalMaxNumRowEntries();
292
293template <class LocalOrdinal, class GlobalOrdinal, class Node>
295 XPETRA_MONITOR("TpetraCrsGraph::hasColMap");
296 return graph_->hasColMap();
297}
298
299template <class LocalOrdinal, class GlobalOrdinal, class Node>
301 XPETRA_MONITOR("TpetraCrsGraph::isLocallyIndexed");
302 return graph_->isLocallyIndexed();
303}
304
305template <class LocalOrdinal, class GlobalOrdinal, class Node>
307 XPETRA_MONITOR("TpetraCrsGraph::isGloballyIndexed");
308 return graph_->isGloballyIndexed();
309}
310
311template <class LocalOrdinal, class GlobalOrdinal, class Node>
313 XPETRA_MONITOR("TpetraCrsGraph::isFillComplete");
314 return graph_->isFillComplete();
315}
316
317template <class LocalOrdinal, class GlobalOrdinal, class Node>
319 XPETRA_MONITOR("TpetraCrsGraph::isStorageOptimized");
320 return graph_->isStorageOptimized();
321}
322
323template <class LocalOrdinal, class GlobalOrdinal, class Node>
325 XPETRA_MONITOR("TpetraCrsGraph::getGlobalRowView");
326 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::global_inds_host_view_type indices;
327 graph_->getGlobalRowView(GlobalRow, indices);
328 Indices = ArrayView<const GlobalOrdinal>(indices.data(), indices.extent(0));
329}
330
331template <class LocalOrdinal, class GlobalOrdinal, class Node>
333 XPETRA_MONITOR("TpetraCrsGraph::getLocalRowView");
334 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::local_inds_host_view_type indices;
335 graph_->getLocalRowView(LocalRow, indices);
336 Indices = ArrayView<const LocalOrdinal>(indices.data(), indices.extent(0));
337}
338
339template <class LocalOrdinal, class GlobalOrdinal, class Node>
343
344template <class LocalOrdinal, class GlobalOrdinal, class Node>
348
349template <class LocalOrdinal, class GlobalOrdinal, class Node>
350void TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>::getLocalDiagOffsets(const Kokkos::View<size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets) const {
351 getTpetra_CrsGraph()->getLocalDiagOffsets(offsets);
352}
353
354template <class LocalOrdinal, class GlobalOrdinal, class Node>
356 // mfh 07 May 2018: See GitHub Issue #2565.
357 graph_->computeGlobalConstants();
358}
359
360template <class LocalOrdinal, class GlobalOrdinal, class Node>
362 XPETRA_MONITOR("TpetraCrsGraph::description");
363 return graph_->description();
364}
365
366template <class LocalOrdinal, class GlobalOrdinal, class Node>
368 XPETRA_MONITOR("TpetraCrsGraph::describe");
369 graph_->describe(out, verbLevel);
370}
371
372template <class LocalOrdinal, class GlobalOrdinal, class Node>
374 XPETRA_MONITOR("TpetraCrsGraph::getNodeRowPtrs");
375 return Kokkos::Compat::persistingView(graph_->getLocalRowPtrsHost());
376}
377
378template <class LocalOrdinal, class GlobalOrdinal, class Node>
383
384template <class LocalOrdinal, class GlobalOrdinal, class Node>
386 const Import &importer, 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()
390 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_CrsGraph();
391 // graph_->doImport(toTpetraCrsGraph(source), *tImporter.getTpetra_Import(), toTpetra(CM));
392
393 graph_->doImport(*v, toTpetra(importer), toTpetra(CM));
394}
395
396template <class LocalOrdinal, class GlobalOrdinal, class Node>
398 const Import &importer, 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 graph_->doExport(*v, toTpetra(importer), toTpetra(CM));
404}
405
406template <class LocalOrdinal, class GlobalOrdinal, class Node>
408 const Export &exporter, CombineMode CM) {
409 XPETRA_MONITOR("TpetraCrsGraph::doImport");
410
411 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, source, tSource, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments."); // TODO: remove and use toTpetra()
412 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_CrsGraph();
413
414 graph_->doImport(*v, toTpetra(exporter), toTpetra(CM));
415}
416
417template <class LocalOrdinal, class GlobalOrdinal, class Node>
419 const Export &exporter, CombineMode CM) {
420 XPETRA_MONITOR("TpetraCrsGraph::doExport");
421
422 XPETRA_DYNAMIC_CAST(const TpetraCrsGraphClass, dest, tDest, "Xpetra::TpetraCrsGraph::doImport only accept Xpetra::TpetraCrsGraph as input arguments."); // TODO: remove and use toTpetra()
424
425 graph_->doExport(*v, toTpetra(exporter), toTpetra(CM));
426}
427
428template <class LocalOrdinal, class GlobalOrdinal, class Node>
429TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>::TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph)
430 : graph_(graph) {}
431
432template <class LocalOrdinal, class GlobalOrdinal, class Node>
434
435#ifdef HAVE_XPETRA_EPETRA
436
437#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
438 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
439
440// specialization of TpetraCrsGraph for GO=LO=int
441template <>
443 : public CrsGraph<int, int, EpetraNode> {
444 typedef int LocalOrdinal;
445 typedef int GlobalOrdinal;
447
448 // The following typedef is used by the XPETRA_DYNAMIC_CAST() macro.
451
452 public:
454
455
457 TpetraCrsGraph(const RCP<const map_type> &rowMap, size_t maxNumEntriesPerRow, const RCP<ParameterList> &params = null) {
459 }
460
465
470
475
497 const typename local_graph_type::row_map_type &rowPointers,
498 const typename local_graph_type::entries_type::non_const_type &columnIndices,
499 const Teuchos::RCP<Teuchos::ParameterList> &plist = Teuchos::null) {
502 "int",
503 typeid(EpetraNode).name());
504 }
505
533
559 const Teuchos::RCP<const map_type> &rowMap,
560 const Teuchos::RCP<const map_type> &colMap,
561 const Teuchos::RCP<const map_type> &domainMap = Teuchos::null,
562 const Teuchos::RCP<const map_type> &rangeMap = Teuchos::null,
563 const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
566 "int",
567 typeid(EpetraNode).name());
568 }
569
571 virtual ~TpetraCrsGraph() {}
572
574
576
577
580
582 void insertLocalIndices(const LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &indices) {}
583
586
588 void allocateAllIndices(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind) {}
589
591 void setAllIndices(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind) {}
592
595
597
599
600
602 void fillComplete(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap, const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap, const RCP<ParameterList> &params = null) {}
603
605 void fillComplete(const RCP<ParameterList> &params = null) {}
606
609 const Teuchos::RCP<const map_type> &rangeMap,
610 const Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importer = null,
611 const Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > &exporter = null,
612 const Teuchos::RCP<Teuchos::ParameterList> &params = null) {}
613
615
617
618
620 RCP<const Comm<int> > getComm() const { return Teuchos::null; }
621
624
627
630
633
636
639
641 global_size_t getGlobalNumRows() const { return 0; }
642
644 global_size_t getGlobalNumCols() const { return 0; }
645
647 size_t getLocalNumRows() const { return 0; }
648
650 size_t getLocalNumCols() const { return 0; }
651
653 GlobalOrdinal getIndexBase() const { return 0; }
654
656 global_size_t getGlobalNumEntries() const { return 0; }
657
659 size_t getLocalNumEntries() const { return 0; }
660
662 size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
663
665 size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
666
668 size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
669
671 size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
672
674 size_t getGlobalMaxNumRowEntries() const { return 0; }
675
677 size_t getLocalMaxNumRowEntries() const { return 0; }
678
680 bool hasColMap() const { return false; }
681
683 bool isLocallyIndexed() const { return false; }
684
686 bool isGloballyIndexed() const { return false; }
687
689 bool isFillComplete() const { return false; }
690
692 bool isStorageOptimized() const { return false; }
693
696
699
703 "Epetra does not support Kokkos::StaticCrsGraph!");
705 }
706
709
711
713
714
716 std::string description() const { return std::string(""); }
717
720
722
724
725
728
730
732 //{@
733
736
740
744
748
752
753 // @}
754
756
757
759 TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
761 }
762
765
767}; // TpetraCrsGraph class (specialization for LO=GO=int and NO=EpetraNode)
768#endif
769
770#if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
771 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
772
773// specialization of TpetraCrsGraph for GO=long long and NO=EpetraNode
774template <>
775class TpetraCrsGraph<int, long long, EpetraNode>
776 : public CrsGraph<int, long long, EpetraNode> {
777 typedef int LocalOrdinal;
778 typedef long long GlobalOrdinal;
780
781 // The following typedef is used by the XPETRA_DYNAMIC_CAST() macro.
784
785 public:
787
788
790 TpetraCrsGraph(const RCP<const map_type> &rowMap, size_t maxNumEntriesPerRow, const RCP<ParameterList> &params = null) {
792 }
793
798
800 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) {
802 }
803
808
830 const typename local_graph_type::row_map_type &rowPointers,
831 const typename local_graph_type::entries_type::non_const_type &columnIndices,
832 const Teuchos::RCP<Teuchos::ParameterList> &plist = Teuchos::null) {
835 "int",
836 typeid(EpetraNode).name());
837 }
838
866
892 const Teuchos::RCP<const map_type> &rowMap,
893 const Teuchos::RCP<const map_type> &colMap,
894 const Teuchos::RCP<const map_type> &domainMap = Teuchos::null,
895 const Teuchos::RCP<const map_type> &rangeMap = Teuchos::null,
896 const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
899 "int",
900 typeid(EpetraNode).name());
901 }
902
932
934 virtual ~TpetraCrsGraph() {}
935
937
939
940
943
945 void insertLocalIndices(const LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &indices) {}
946
949
951 void allocateAllIndices(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind) {}
952
954 void setAllIndices(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind) {}
955
958
960
962
963
965 void fillComplete(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap, const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap, const RCP<ParameterList> &params = null) {}
966
968 void fillComplete(const RCP<ParameterList> &params = null) {}
969
972 const Teuchos::RCP<const map_type> &rangeMap,
973 const Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importer = null,
974 const Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > &exporter = null,
975 const Teuchos::RCP<Teuchos::ParameterList> &params = null) {}
976
978
980
981
983 RCP<const Comm<int> > getComm() const { return Teuchos::null; }
984
987
990
993
996
999
1002
1004 global_size_t getGlobalNumRows() const { return 0; }
1005
1007 global_size_t getGlobalNumCols() const { return 0; }
1008
1010 size_t getLocalNumRows() const { return 0; }
1011
1013 size_t getLocalNumCols() const { return 0; }
1014
1016 GlobalOrdinal getIndexBase() const { return 0; }
1017
1020
1022 size_t getLocalNumEntries() const { return 0; }
1023
1025 size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1026
1028 size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1029
1031 size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1032
1034 size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1035
1037 size_t getGlobalMaxNumRowEntries() const { return 0; }
1038
1040 size_t getLocalMaxNumRowEntries() const { return 0; }
1041
1043 bool hasColMap() const { return false; }
1044
1046 bool isLocallyIndexed() const { return false; }
1047
1049 bool isGloballyIndexed() const { return false; }
1050
1052 bool isFillComplete() const { return false; }
1053
1055 bool isStorageOptimized() const { return false; }
1056
1059
1062
1065 "Epetra does not support Kokkos::StaticCrsGraph!");
1067 }
1068
1069 void getLocalDiagOffsets(const Kokkos::View<size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets) const {
1071 "Epetra does not support getLocalDiagOffsets!");
1072 }
1073
1074 typename local_graph_type::HostMirror getLocalGraphHost() const {
1076 "Epetra does not support Kokkos::StaticCrsGraph!");
1077 TEUCHOS_UNREACHABLE_RETURN((local_graph_type::HostMirror()));
1078 }
1079
1082
1084
1086
1087
1089 std::string description() const { return std::string(""); }
1090
1093
1095
1097
1098
1101
1103
1105 //{@
1106
1109
1113
1117
1121
1125
1126 // @}
1127
1129
1130
1132 TpetraCrsGraph(const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
1134 }
1135
1138
1140}; // TpetraCrsGraph class (specialization for GO=long long and NO=EpetraNode)
1141#endif
1142
1143#endif // HAVE_XPETRA_EPETRA
1144
1145} // namespace Xpetra
1146#endif // XPETRA_TPETRACRSGRAPH_DEF_HPP
#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 .
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
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.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
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.
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.
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 getLocalDiagOffsets(const Kokkos::View< size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged > &offsets) const
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.
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.
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
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< Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > graph_
RCP< const Import > getImporter() const
Returns the importer associated with this graph.
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
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.
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.
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
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.
void getLocalDiagOffsets(const Kokkos::View< size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get offsets of the diagonal entries in the matrix.
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
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
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)
basic_FancyOStream< char > FancyOStream
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
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)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
CombineMode
Xpetra::Combine Mode enumerable type.