46 #ifndef XPETRA_EPETRACRSGRAPH_HPP 47 #define XPETRA_EPETRACRSGRAPH_HPP 60 #include <Epetra_CrsGraph.h> 65 template<
class GlobalOrdinal,
class Node>
66 RCP< const CrsGraph<int, GlobalOrdinal, Node> >
69 template<
class GlobalOrdinal,
class Node>
71 toEpetra (
const RCP<
const CrsGraph<int, GlobalOrdinal, Node> > &graph);
73 template<
class GlobalOrdinal,
class Node>
75 :
public CrsGraph<int, GlobalOrdinal, Node>
89 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
95 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
102 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
139 return Teuchos::null;
143 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
return Teuchos::null; }
146 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
return Teuchos::null; }
149 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
return Teuchos::null; }
152 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
return Teuchos::null; }
155 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
return Teuchos::null; }
158 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
return Teuchos::null; }
215 void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &Indices)
const { }
233 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
241 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
return Teuchos::null; }
266 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
279 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 282 :
public virtual CrsGraph<int, int, EpetraNode>
311 Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end());
312 graph_ = Teuchos::rcp(
new Epetra_CrsGraph(
Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), numEntriesPerRowToAlloc.getRawPtr(),
toEpetra(pftype)));
328 XPETRA_ERR_CHECK(graph_->InsertGlobalIndices(globalRow, indices.size(), indices_rawPtr));
335 int* indices_rawPtr =
const_cast<int*
>(indices.getRawPtr());
336 XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr));
351 graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
352 bool doOptimizeStorage =
true;
353 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
354 if (doOptimizeStorage) graph_->OptimizeStorage();
361 graph_->FillComplete();
362 bool doOptimizeStorage =
true;
363 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
364 if (doOptimizeStorage) graph_->OptimizeStorage();
378 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRowMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RowMap()); }
381 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getColMap");
return toXpetra<GlobalOrdinal,Node>(graph_->ColMap()); }
384 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getDomainMap");
return toXpetra<GlobalOrdinal,Node>(graph_->DomainMap()); }
387 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRangeMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RangeMap()); }
390 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getImporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Importer()); }
393 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getExporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Exporter()); }
456 XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices));
457 if (numEntries == 0) { eIndices = NULL; }
459 Indices = ArrayView<const GlobalOrdinal>(eIndices, numEntries);
470 if (numEntries == 0) { eIndices = NULL; }
472 indices = ArrayView<const int>(eIndices, numEntries);
490 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
493 out <<
"EpetraCrsGraphT::describe : Warning, verbosity level is ignored by this method." << std::endl;
495 if (rowmap.
Comm().
MyPID() == 0) out <<
"** EpetraCrsGraphT **\n\nrowmap" << std::endl;
506 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getMap");
return toXpetra<GlobalOrdinal,Node>(graph_->Map()); }
516 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
517 int err = graph_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
518 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
529 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
530 int err = graph_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
531 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
542 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
543 int err = graph_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
544 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
556 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
557 int err = graph_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
558 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
567 TEUCHOS_TEST_FOR_EXCEPTION(!graph->RowMap().GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraCrsGraphT: GlobalOrdinal mismatch.");
582 #endif // specialization on Node=EpetraNode and GO=int 585 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 588 :
public virtual CrsGraph<int, long long, EpetraNode>
617 Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end());
618 graph_ = Teuchos::rcp(
new Epetra_CrsGraph(
Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), numEntriesPerRowToAlloc.getRawPtr(),
toEpetra(pftype)));
634 XPETRA_ERR_CHECK(graph_->InsertGlobalIndices(globalRow, indices.size(), indices_rawPtr));
641 int* indices_rawPtr =
const_cast<int*
>(indices.getRawPtr());
642 XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr));
657 graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
658 bool doOptimizeStorage =
true;
659 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
660 if (doOptimizeStorage) graph_->OptimizeStorage();
667 graph_->FillComplete();
668 bool doOptimizeStorage =
true;
669 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
670 if (doOptimizeStorage) graph_->OptimizeStorage();
684 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRowMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RowMap()); }
687 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getColMap");
return toXpetra<GlobalOrdinal,Node>(graph_->ColMap()); }
690 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getDomainMap");
return toXpetra<GlobalOrdinal,Node>(graph_->DomainMap()); }
693 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRangeMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RangeMap()); }
696 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getImporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Importer()); }
699 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getExporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Exporter()); }
762 XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices));
763 if (numEntries == 0) { eIndices = NULL; }
765 Indices = ArrayView<const GlobalOrdinal>(eIndices, numEntries);
776 if (numEntries == 0) { eIndices = NULL; }
778 indices = ArrayView<const int>(eIndices, numEntries);
794 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const {
797 out <<
"EpetraCrsGraphT::describe : Warning, verbosity level is ignored by this method." << std::endl;
799 if (rowmap.
Comm().
MyPID() == 0) out <<
"** EpetraCrsGraphT **\n\nrowmap" << std::endl;
810 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getMap");
return toXpetra<GlobalOrdinal,Node>(graph_->Map()); }
820 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
821 int err = graph_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
822 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
833 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
834 int err = graph_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
835 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
846 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
847 int err = graph_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
848 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
860 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
861 int err = graph_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
862 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
871 TEUCHOS_TEST_FOR_EXCEPTION(!graph->RowMap().GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraCrsGraphT: GlobalOrdinal mismatch.");
885 #endif // specialization on Node=EpetraNode and GO=int 889 #endif // XPETRA_EPETRACRSGRAPH_HPP EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=null)
Constructor specifying column Map and fixed number of entries for each row.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
bool hasColMap() const
Whether the graph has a column Map.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
bool isStorageOptimized() const
Returns true if storage has been optimized.
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.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
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 getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
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 getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
RCP< Epetra_CrsGraph > graph_
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
virtual ~EpetraCrsGraphT()
Destructor.
RCP< const Comm< int > > getComm() const
Returns the communicator.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=null)
Constructor specifying column Map and fixed number of entries for each row.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > ¶ms=null)
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
Exception throws to report errors in the internal logical of the program.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, GlobalOrdinal, Node > > &graph)
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
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 getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=null)
Constructor specifying column Map and fixed number of entries for each row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
virtual int MyPID() const=0
RCP< const Comm< int > > getComm() const
Returns the communicator.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
bool isStorageOptimized() const
Returns true if storage has been optimized.
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
#define XPETRA_ERR_CHECK(arg)
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > ¶ms=null)
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const RCP< ParameterList > ¶ms=null)
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
const Epetra_Comm & Comm() const
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.
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...
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this 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.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
size_t getNodeMaxNumRowEntries() 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.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
RCP< Epetra_CrsGraph > graph_
size_t global_size_t
Global size_t object.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
std::string description() const
Return a simple one-line description of this object.
virtual ~EpetraCrsGraphT()
Destructor.
RCP< const Comm< int > > getComm() const
Returns the communicator.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
virtual void Print(std::ostream &os) const
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
EpetraCrsGraphT(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying fixed number of entries for each row.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
virtual ~EpetraCrsGraphT()
Destructor.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
bool hasColMap() const
Whether the graph has a column Map.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
CombineMode
Xpetra::Combine Mode enumerable type.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
#define XPETRA_MONITOR(funcName)
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
std::string description() const
Return a simple one-line description of this object.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
bool hasColMap() const
Whether the graph has a column Map.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Return a const, nonpersisting view of global indices in the given row.
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 > > getColMap() const
Returns the Map that describes the column distribution in this graph.
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 Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row 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).
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...