46 #ifndef XPETRA_TPETRACRSGRAPH_DEF_HPP
47 #define XPETRA_TPETRACRSGRAPH_DEF_HPP
51 #include "Tpetra_CrsGraph.hpp"
56 #include "Xpetra_TpetraMap.hpp"
57 #include "Xpetra_TpetraImport.hpp"
58 #include "Xpetra_TpetraExport.hpp"
62 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
64 : graph_(Teuchos::rcp(new Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(rowMap), maxNumEntriesPerRow, params))) {}
66 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
68 : graph_(Teuchos::rcp(new Tpetra::
CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(rowMap), NumEntriesPerRowToAlloc(), params))) {}
70 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
72 : graph_(Teuchos::rcp(new Tpetra::
CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(rowMap),
toTpetra(colMap), maxNumEntriesPerRow, params))) {}
74 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76 : graph_(Teuchos::rcp(new Tpetra::
CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(rowMap),
toTpetra(colMap), NumEntriesPerRowToAlloc(), params))) {}
78 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
82 const Teuchos::RCP<const Map> &domainMap,
83 const Teuchos::RCP<const Map> &rangeMap,
84 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
85 typedef Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> MyTpetraCrsGraph;
86 XPETRA_DYNAMIC_CAST(
const TpetraCrsGraphClass, *sourceGraph, tSourceGraph,
"Xpetra::TpetraCrsMatrix constructor only accepts Xpetra::TpetraCrsMatrix as the input argument.");
87 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSourceGraph.getTpetra_CrsGraph();
89 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > myDomainMap = domainMap != Teuchos::null ?
toTpetra(domainMap) : Teuchos::null;
90 RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > myRangeMap = rangeMap != Teuchos::null ?
toTpetra(rangeMap) : Teuchos::null;
91 graph_ = Tpetra::importAndFillCompleteCrsGraph<MyTpetraCrsGraph>(v,
toTpetra(importer), myDomainMap, myRangeMap, params);
92 bool restrictComm =
false;
93 if (!params.is_null()) restrictComm = params->get(
"Restrict Communicator", restrictComm);
94 if (restrictComm && graph_->getRowMap().is_null()) graph_ = Teuchos::null;
97 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
100 const Teuchos::RCP<const Map> &colMap,
101 const typename local_graph_type::row_map_type &rowPointers,
102 const typename local_graph_type::entries_type::non_const_type &columnIndices,
103 const Teuchos::RCP<Teuchos::ParameterList> &plist)
104 : graph_(Teuchos::rcp(new Tpetra::
CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, plist))) {}
106 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
109 const Teuchos::RCP<const map_type> &colMap,
111 const Teuchos::RCP<Teuchos::ParameterList> ¶ms)
112 : graph_(Teuchos::rcp(new Tpetra::
CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), lclGraph, params))) {}
114 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
117 const Teuchos::RCP<const map_type> &rowMap,
118 const Teuchos::RCP<const map_type> &colMap,
119 const Teuchos::RCP<const map_type> &domainMap,
120 const Teuchos::RCP<const map_type> &rangeMap,
121 const Teuchos::RCP<Teuchos::ParameterList> ¶ms)
122 : graph_(Teuchos::rcp(new Tpetra::
CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph, toTpetra(rowMap), toTpetra(colMap), toTpetra(domainMap), toTpetra(rangeMap), params))) {}
124 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
127 const Teuchos::RCP<const Map> &colMap,
128 const Teuchos::ArrayRCP<size_t> &rowPointers,
129 const Teuchos::ArrayRCP<LocalOrdinal> &columnIndices,
130 const Teuchos::RCP<Teuchos::ParameterList> ¶ms)
131 : graph_(Teuchos::rcp(new Tpetra::
CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(toTpetra(rowMap), toTpetra(colMap), rowPointers, columnIndices, params))) {}
133 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
136 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
139 graph_->insertGlobalIndices(globalRow, indices);
142 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
145 graph_->insertLocalIndices(localRow, indices);
148 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
151 graph_->removeLocalIndices(localRow);
154 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
157 rowptr.resize(getLocalNumRows() + 1);
158 colind.resize(numNonZeros);
161 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
163 setAllIndices(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind) {
164 graph_->setAllIndices(rowptr, colind);
167 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
169 getAllIndices(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind)
const {
170 rowptr = Kokkos::Compat::persistingView(graph_->getLocalRowPtrsHost());
171 colind = Kokkos::Compat::persistingView(graph_->getLocalIndicesHost());
174 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
180 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
183 graph_->fillComplete(params);
186 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
189 const Teuchos::RCP<const map_type> &rangeMap,
190 const Teuchos::RCP<const Import> &importer,
191 const Teuchos::RCP<const Export> &exporter,
192 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
194 RCP<const Tpetra::Import<LocalOrdinal, GlobalOrdinal, Node> > myImport;
195 RCP<const Tpetra::Export<LocalOrdinal, GlobalOrdinal, Node> > myExport;
197 if (importer != Teuchos::null) {
199 myImport = tImporter.getTpetra_Import();
201 if (exporter != Teuchos::null) {
203 myExport = tExporter.getTpetra_Export();
206 graph_->expertStaticFillComplete(
toTpetra(domainMap),
toTpetra(rangeMap), myImport, myExport, params);
209 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
212 return graph_->getComm();
215 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
218 return toXpetra(graph_->getRowMap());
221 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
224 return toXpetra(graph_->getColMap());
227 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
230 return toXpetra(graph_->getDomainMap());
233 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
236 return toXpetra(graph_->getRangeMap());
239 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
242 return toXpetra(graph_->getImporter());
245 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
248 return toXpetra(graph_->getExporter());
251 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
254 return graph_->getGlobalNumRows();
257 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
260 return graph_->getGlobalNumCols();
263 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
266 return graph_->getLocalNumRows();
269 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
272 return graph_->getLocalNumCols();
275 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
278 return graph_->getIndexBase();
281 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
284 return graph_->getGlobalNumEntries();
287 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
290 return graph_->getLocalNumEntries();
293 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
296 return graph_->getNumEntriesInGlobalRow(globalRow);
299 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
302 return graph_->getNumEntriesInLocalRow(localRow);
305 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
307 XPETRA_MONITOR(
"TpetraCrsGraph::getNumAllocatedEntriesInGlobalRow");
308 return graph_->getNumAllocatedEntriesInGlobalRow(globalRow);
311 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
313 XPETRA_MONITOR(
"TpetraCrsGraph::getNumAllocatedEntriesInLocalRow");
314 return graph_->getNumAllocatedEntriesInLocalRow(localRow);
317 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
320 return graph_->getGlobalMaxNumRowEntries();
323 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
326 return graph_->getLocalMaxNumRowEntries();
329 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
332 return graph_->hasColMap();
335 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
338 return graph_->isLocallyIndexed();
341 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
344 return graph_->isGloballyIndexed();
347 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
350 return graph_->isFillComplete();
353 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
356 return graph_->isStorageOptimized();
359 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
362 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::global_inds_host_view_type indices;
363 graph_->getGlobalRowView(GlobalRow, indices);
364 Indices = ArrayView<const GlobalOrdinal>(indices.data(), indices.extent(0));
367 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
370 typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::local_inds_host_view_type indices;
371 graph_->getLocalRowView(LocalRow, indices);
372 Indices = ArrayView<const LocalOrdinal>(indices.data(), indices.extent(0));
375 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
377 return getTpetra_CrsGraph()->getLocalGraphHost();
380 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
382 return getTpetra_CrsGraph()->getLocalGraphDevice();
385 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
387 getTpetra_CrsGraph()->getLocalDiagOffsets(offsets);
390 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
393 graph_->computeGlobalConstants();
396 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
399 return graph_->description();
402 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
405 graph_->describe(out, verbLevel);
408 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
411 return Kokkos::Compat::persistingView(graph_->getLocalRowPtrsHost());
414 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
417 return rcp(
new TpetraMap(graph_->getMap()));
420 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
426 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_CrsGraph();
432 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
438 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_CrsGraph();
442 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
448 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tSource.getTpetra_CrsGraph();
453 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
459 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > v = tDest.getTpetra_CrsGraph();
464 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
468 template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
471 #ifdef HAVE_XPETRA_EPETRA
473 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
474 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
479 :
public CrsGraph<int, int, EpetraNode> {
493 TpetraCrsGraph(
const RCP<const map_type> &rowMap,
size_t maxNumEntriesPerRow,
const RCP<ParameterList> ¶ms = null) {
533 const typename local_graph_type::row_map_type &rowPointers,
534 const typename local_graph_type::entries_type::non_const_type &columnIndices,
535 const Teuchos::RCP<Teuchos::ParameterList> &plist = Teuchos::null) {
561 const Teuchos::RCP<const map_type> &colMap,
563 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
595 const Teuchos::RCP<const map_type> &rowMap,
596 const Teuchos::RCP<const map_type> &colMap,
597 const Teuchos::RCP<const map_type> &domainMap = Teuchos::null,
598 const Teuchos::RCP<const map_type> &rangeMap = Teuchos::null,
599 const Teuchos::RCP<Teuchos::ParameterList> ¶ms = Teuchos::null) {
624 void allocateAllIndices(
size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind) {}
627 void setAllIndices(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind) {}
630 void getAllIndices(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind)
const {}
645 const Teuchos::RCP<const map_type> &rangeMap,
648 const Teuchos::RCP<Teuchos::ParameterList> ¶ms = null) {}
656 RCP<const Comm<int> >
getComm()
const {
return Teuchos::null; }
659 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRowMap()
const {
return Teuchos::null; }
662 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getColMap()
const {
return Teuchos::null; }
665 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
return Teuchos::null; }
668 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
return Teuchos::null; }
671 RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
getImporter()
const {
return Teuchos::null; }
674 RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> >
getExporter()
const {
return Teuchos::null; }
739 "Epetra does not support Kokkos::StaticCrsGraph!");
755 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
763 ArrayRCP<const size_t>
getNodeRowPtrs()
const {
return Teuchos::ArrayRCP<const size_t>(); }
771 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getMap()
const {
return Teuchos::null; }
795 TpetraCrsGraph(
const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
800 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_CrsGraph()
const {
return Teuchos::null; }
806 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
807 (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
812 :
public CrsGraph<int, long long, EpetraNode> {
826 TpetraCrsGraph(
const RCP<const map_type> &rowMap,
size_t maxNumEntriesPerRow,
const RCP<ParameterList> ¶ms = null) {
866 const typename local_graph_type::row_map_type &rowPointers,
867 const typename local_graph_type::entries_type::non_const_type &columnIndices,
868 const Teuchos::RCP<Teuchos::ParameterList> &plist = Teuchos::null) {
894 const Teuchos::RCP<const map_type> &colMap,
896 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
928 const Teuchos::RCP<const map_type> &rowMap,
929 const Teuchos::RCP<const map_type> &colMap,
930 const Teuchos::RCP<const map_type> &domainMap = Teuchos::null,
931 const Teuchos::RCP<const map_type> &rangeMap = Teuchos::null,
932 const Teuchos::RCP<Teuchos::ParameterList> ¶ms = Teuchos::null) {
959 const Teuchos::RCP<const map_type> &colMap,
960 const Teuchos::ArrayRCP<size_t> &rowPointers,
961 const Teuchos::ArrayRCP<LocalOrdinal> &columnIndices,
962 const Teuchos::RCP<Teuchos::ParameterList> ¶ms) {
987 void allocateAllIndices(
size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind) {}
990 void setAllIndices(
const ArrayRCP<size_t> &rowptr,
const ArrayRCP<LocalOrdinal> &colind) {}
993 void getAllIndices(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind)
const {}
1008 const Teuchos::RCP<const map_type> &rangeMap,
1011 const Teuchos::RCP<Teuchos::ParameterList> ¶ms = null) {}
1019 RCP<const Comm<int> >
getComm()
const {
return Teuchos::null; }
1022 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRowMap()
const {
return Teuchos::null; }
1025 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getColMap()
const {
return Teuchos::null; }
1028 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getDomainMap()
const {
return Teuchos::null; }
1031 RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getRangeMap()
const {
return Teuchos::null; }
1034 RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> >
getImporter()
const {
return Teuchos::null; }
1037 RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> >
getExporter()
const {
return Teuchos::null; }
1101 "Epetra does not support Kokkos::StaticCrsGraph!");
1105 void getLocalDiagOffsets(
const Kokkos::View<size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets)
const {
1107 "Epetra does not support getLocalDiagOffsets!");
1112 "Epetra does not support Kokkos::StaticCrsGraph!");
1113 TEUCHOS_UNREACHABLE_RETURN((local_graph_type::HostMirror()));
1128 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default)
const {}
1136 ArrayRCP<const size_t>
getNodeRowPtrs()
const {
return Teuchos::ArrayRCP<const size_t>(); }
1144 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
getMap()
const {
return Teuchos::null; }
1168 TpetraCrsGraph(
const Teuchos::RCP<Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph) {
1173 RCP<const Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
getTpetra_CrsGraph()
const {
return Teuchos::null; }
1179 #endif // HAVE_XPETRA_EPETRA
1182 #endif // XPETRA_TPETRACRSGRAPH_DEF_HPP
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > ¶ms=null)
Constructor specifying column Map and fixed number of entries for each row.
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete, specifying domain and range maps.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > ¶ms=null)
Constructor specifying (possibly different) number of entries in each row.
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 getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import &importer, CombineMode CM)
Export.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
Kokkos::StaticCrsGraph< LocalOrdinal, Kokkos::LayoutLeft, device_type, void, size_t > local_graph_type
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
size_t getLocalMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this 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 > ¶ms=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets the 1D pointer arrays of the graph.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
local_graph_type::HostMirror getLocalGraphHost() const
Access the local KokkosSparse::StaticCrsGraph data for host use.
size_t getLocalNumEntries() const
Returns the local number of entries in the graph.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
RCP< const Map > getDomainMap() const
Returns the Map associated with the domain of this 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 > ¶ms=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const RCP< ParameterList > ¶ms=null)
Constructor specifying (possibly different) number of entries in each row.
TpetraCrsGraph< LocalOrdinal, GlobalOrdinal, Node > TpetraCrsGraphClass
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 > ¶ms=null)
Constructor specifying column Map and number of entries in each row.
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 > ¶ms=Teuchos::null)
Expert version of fillComplete.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
RCP< const Map > getColMap() const
Returns the Map that describes the column distribution in this graph.
local_graph_type::HostMirror getLocalGraphHost() const
Get the local graph.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
Exception throws to report errors in the internal logical of the program.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
virtual ~TpetraCrsGraph()
Destructor.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
bool isStorageOptimized() const
Returns true if storage has been optimized.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getTpetra_CrsGraph() const
Get the underlying Tpetra graph.
virtual ~TpetraCrsGraph()
Destructor.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
RCP< const Import > getImporter() const
Returns the importer associated with this graph.
std::string description() const
Return a simple one-line description of this object.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
bool isStorageOptimized() const
Returns true if storage has been optimized.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
RCP< const Comm< int > > getComm() const
Returns the communicator.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
TpetraCrsGraph(const RCP< const Map > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > ¶ms=null)
Constructor specifying fixed number of entries for each row.
TpetraCrsGraph(const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
TpetraCrsGraph constructor to wrap a Tpetra::CrsGraph object.
RCP< const Export > getExporter() const
Returns the exporter associated with this graph.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() 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.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
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 > ¶ms=null)
Expert version of fillComplete.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
size_t getLocalNumRows() const
Returns the number of graph rows owned on the calling node.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import &importer, CombineMode CM)
Import.
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > ¶ms=null)
Constructor specifying fixed number of entries for each row.
bool isStorageOptimized() const
Returns true if storage has been optimized.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
Teuchos::RCP< const Map > getMap() const
Implements DistObject interface.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates the 1D pointer arrays of the graph.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
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 > ¶ms=null)
Expert version of fillComplete.
bool hasColMap() const
Whether the graph has a column Map.
local_graph_type getLocalGraph() const
Access the local KokkosSparse::StaticCrsGraph data.
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the graph.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
local_graph_type getLocalGraphDevice() const
Access the local KokkosSparse::StaticCrsGraph data for device use.
size_t getLocalNumEntries() const
Returns the local number of entries in the graph.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
local_graph_type getLocalGraphDevice() const
size_t getLocalNumEntries() const
Returns the local number of entries in the graph.
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 > ¶ms)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views...
virtual ~TpetraCrsGraph()
Destructor.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
size_t global_size_t
Global size_t object.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
size_t getLocalNumRows() const
Returns the number of graph rows owned on the calling node.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
TpetraCrsGraph(const Teuchos::RCP< Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
TpetraCrsGraph constructor to wrap a Tpetra::CrsGraph object.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
bool hasColMap() const
Whether the graph has a column Map.
size_t getLocalMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
void getLocalDiagOffsets(const Kokkos::View< size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get offsets of the diagonal entries in the matrix.
bool hasColMap() const
Whether the graph has a column Map.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
void fillComplete(const RCP< const Map > &domainMap, const RCP< const Map > &rangeMap, const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete, specifying domain and range maps.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
TpetraCrsGraph(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > ¶ms=null)
Constructor specifying column Map and fixed number of entries for each row.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates the 1D pointer arrays of the graph.
Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type local_graph_type
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
void computeGlobalConstants()
Dummy implementation for computeGlobalConstants.
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 doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete, specifying domain and range maps.
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the graph.
CombineMode
Xpetra::Combine Mode enumerable type.
#define XPETRA_MONITOR(funcName)
RCP< const Comm< int > > getComm() const
Returns the communicator.
void getLocalDiagOffsets(const Kokkos::View< size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged > &offsets) const
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 > ¶ms)
Constructor specifying column Map and arrays containing the graph in sorted, local ids...
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
std::string description() const
Return a simple one-line description of this object.
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 > ¶ms)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views...
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
std::string description() const
Return a simple one-line description of this object.
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the graph.
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets the 1D pointer arrays of the graph.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
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 > ¶ms=null)
Constructor specifying column Map and number of entries in each row.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets 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.
size_t getLocalMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
RCP< const Map > getRowMap() const
Returns the Map that describes the row distribution in this graph.
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates the 1D pointer arrays of the graph.
TpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > ¶ms=null)
Constructor specifying fixed number of entries for each row.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
RCP< const Map > getRangeMap() const
Returns the Map associated with the domain of this graph.
RCP< const Comm< int > > getComm() const
Returns the communicator.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
void computeGlobalConstants()
Dummy implementation for computeGlobalConstants.
ArrayRCP< const size_t > getNodeRowPtrs() const
Get an ArrayRCP of the row-offsets.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
size_t getLocalNumRows() const
Returns the number of graph rows owned on the calling node.