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"
64template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
66: graph_(
Teuchos::rcp(new Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(
toTpetra(rowMap), maxNumEntriesPerRow, params))) { }
68template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
70: graph_(
Teuchos::rcp(new Tpetra::
CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(
toTpetra(rowMap), NumEntriesPerRowToAlloc(), params))) { }
72template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
76template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
78: graph_(
Teuchos::rcp(new Tpetra::
CrsGraph< LocalOrdinal, GlobalOrdinal, Node >(
toTpetra(rowMap),
toTpetra(colMap), NumEntriesPerRowToAlloc(), params))) { }
81template <
class LocalOrdinal,
class GlobalOrdinal,
class Node>
89 typedef Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node> MyTpetraCrsGraph;
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;
103template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
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))) { }
113template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
117 const local_graph_type& lclGraph,
121template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
131template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
138 : graph_(
Teuchos::rcp(new Tpetra::
CrsGraph<LocalOrdinal, GlobalOrdinal, Node>(
toTpetra(rowMap),
toTpetra(colMap), rowPointers, columnIndices, params))) { }
141template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
144template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
146{
XPETRA_MONITOR(
"TpetraCrsGraph::insertGlobalIndices"); graph_->insertGlobalIndices(globalRow, indices); }
148template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
150{
XPETRA_MONITOR(
"TpetraCrsGraph::insertLocalIndices"); graph_->insertLocalIndices(localRow, indices); }
152template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
154{
XPETRA_MONITOR(
"TpetraCrsGraph::removeLocalIndices"); graph_->removeLocalIndices(localRow); }
156template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
159 rowptr.
resize(getLocalNumRows()+1); colind.
resize(numNonZeros);
162template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
165 graph_->setAllIndices(rowptr,colind);
168template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
171 rowptr = Kokkos::Compat::persistingView(graph_->getLocalRowPtrsHost());
172 colind = Kokkos::Compat::persistingView(graph_->getLocalIndicesHost());
175template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
179template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
181{
XPETRA_MONITOR(
"TpetraCrsGraph::fillComplete"); graph_->fillComplete(params); }
183template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
194 if(importer!=Teuchos::null) {
196 myImport = tImporter.getTpetra_Import();
198 if(exporter!=Teuchos::null) {
200 myExport = tExporter.getTpetra_Export();
203 graph_->expertStaticFillComplete(
toTpetra(domainMap),
toTpetra(rangeMap),myImport,myExport,params);
207template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
209{
XPETRA_MONITOR(
"TpetraCrsGraph::getComm");
return graph_->getComm(); }
211template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
215template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
219template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
223template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
227template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
231template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
235template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
237{
XPETRA_MONITOR(
"TpetraCrsGraph::getGlobalNumRows");
return graph_->getGlobalNumRows(); }
239template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
241{
XPETRA_MONITOR(
"TpetraCrsGraph::getGlobalNumCols");
return graph_->getGlobalNumCols(); }
243template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
245{
XPETRA_MONITOR(
"TpetraCrsGraph::getLocalNumRows");
return graph_->getLocalNumRows(); }
247template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
249{
XPETRA_MONITOR(
"TpetraCrsGraph::getLocalNumCols");
return graph_->getLocalNumCols(); }
251template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
253{
XPETRA_MONITOR(
"TpetraCrsGraph::getIndexBase");
return graph_->getIndexBase(); }
255template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
257{
XPETRA_MONITOR(
"TpetraCrsGraph::getGlobalNumEntries");
return graph_->getGlobalNumEntries(); }
259template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
261{
XPETRA_MONITOR(
"TpetraCrsGraph::getLocalNumEntries");
return graph_->getLocalNumEntries(); }
263template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
265{
XPETRA_MONITOR(
"TpetraCrsGraph::getNumEntriesInGlobalRow");
return graph_->getNumEntriesInGlobalRow(globalRow); }
267template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
269{
XPETRA_MONITOR(
"TpetraCrsGraph::getNumEntriesInLocalRow");
return graph_->getNumEntriesInLocalRow(localRow); }
271template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
273{
XPETRA_MONITOR(
"TpetraCrsGraph::getNumAllocatedEntriesInGlobalRow");
return graph_->getNumAllocatedEntriesInGlobalRow(globalRow); }
275template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
277{
XPETRA_MONITOR(
"TpetraCrsGraph::getNumAllocatedEntriesInLocalRow");
return graph_->getNumAllocatedEntriesInLocalRow(localRow); }
279template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
281{
XPETRA_MONITOR(
"TpetraCrsGraph::getGlobalMaxNumRowEntries");
return graph_->getGlobalMaxNumRowEntries(); }
283template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
285{
XPETRA_MONITOR(
"TpetraCrsGraph::getLocalMaxNumRowEntries");
return graph_->getLocalMaxNumRowEntries(); }
287template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
289{
XPETRA_MONITOR(
"TpetraCrsGraph::hasColMap");
return graph_->hasColMap(); }
291template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
293{
XPETRA_MONITOR(
"TpetraCrsGraph::isLocallyIndexed");
return graph_->isLocallyIndexed(); }
295template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
297{
XPETRA_MONITOR(
"TpetraCrsGraph::isGloballyIndexed");
return graph_->isGloballyIndexed(); }
299template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
301{
XPETRA_MONITOR(
"TpetraCrsGraph::isFillComplete");
return graph_->isFillComplete(); }
303template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
305{
XPETRA_MONITOR(
"TpetraCrsGraph::isStorageOptimized");
return graph_->isStorageOptimized(); }
307template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
311 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::global_inds_host_view_type indices;
312 graph_->getGlobalRowView(GlobalRow, indices);
316template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
320 typename Tpetra::CrsGraph<LocalOrdinal,GlobalOrdinal,Node>::local_inds_host_view_type indices;
321 graph_->getLocalRowView(LocalRow, indices);
325template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
330template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
332 return getTpetra_CrsGraph()->getLocalGraphDevice();
335template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
338 graph_->computeGlobalConstants();
341template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
343{
XPETRA_MONITOR(
"TpetraCrsGraph::description");
return graph_->description(); }
345template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
347{
XPETRA_MONITOR(
"TpetraCrsGraph::describe"); graph_->describe(out, verbLevel); }
349template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
351{
XPETRA_MONITOR(
"TpetraCrsGraph::getNodeRowPtrs");
return Kokkos::Compat::persistingView(graph_->getLocalRowPtrsHost()); }
353template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
357template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
369template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
380template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
392template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
404template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
408template<
class LocalOrdinal,
class GlobalOrdinal,
class Node>
415#ifdef HAVE_XPETRA_EPETRA
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))))
423 :
public CrsGraph<int,int,EpetraNode>
479 const typename local_graph_type::row_map_type& rowPointers,
480 const typename local_graph_type::entries_type::non_const_type& columnIndices,
686 "Epetra does not support Kokkos::StaticCrsGraph!");
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))))
759 :
public CrsGraph<int,long long,EpetraNode>
815 const typename local_graph_type::row_map_type& rowPointers,
816 const typename local_graph_type::entries_type::non_const_type& columnIndices,
1053 "Epetra does not support Kokkos::StaticCrsGraph!");
1059 "Epetra does not support Kokkos::StaticCrsGraph!");
#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
virtual local_graph_type::HostMirror getLocalGraphHost() const =0
Get the local graph.
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 > ¶ms=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 > ¶ms=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 > ¶ms=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 > ¶ms=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 > ¶ms=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 > ¶ms=null)
Signal that data entry is complete, specifying domain and range maps.
void fillComplete(const RCP< ParameterList > ¶ms=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.
virtual ~TpetraCrsGraph()
Destructor.
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 > ¶ms=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 > ¶ms)
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.
virtual ~TpetraCrsGraph()
Destructor.
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 > ¶ms=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 > ¶ms=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 > ¶ms=null)
Signal that data entry is complete.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
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 > ¶ms=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.
local_graph_type getLocalGraphDevice() const
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 > ¶ms=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 > ¶ms=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 > ¶ms=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 > ¶ms)
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 > ¶ms=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 > ¶ms)
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 > ¶ms=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 > ¶ms=Teuchos::null)
Expert version of fillComplete.
TpetraCrsGraph(const RCP< const Map > &rowMap, size_t maxNumEntriesPerRow, const RCP< ParameterList > ¶ms=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)
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.