46 #ifndef XPETRA_EPETRACRSGRAPH_HPP
47 #define XPETRA_EPETRACRSGRAPH_HPP
61 #include <Epetra_CrsGraph.h>
66 template<
class GlobalOrdinal,
class Node>
67 RCP< const CrsGraph<int, GlobalOrdinal, Node> >
68 toXpetra (
const Epetra_CrsGraph& graph);
70 template<
class GlobalOrdinal,
class Node>
71 const Epetra_CrsGraph&
72 toEpetra (
const RCP<
const CrsGraph<int, GlobalOrdinal, Node> > &graph);
74 template<
class GlobalOrdinal,
class Node>
76 :
public CrsGraph<int, GlobalOrdinal, Node>
83 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
84 #ifdef HAVE_XPETRA_TPETRA
87 typedef typename node_type::execution_space execution_space;
95 EpetraCrsGraphT(
const RCP< const map_type > &rowMap,
const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
98 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
102 EpetraCrsGraphT(
const RCP< const map_type > &rowMap,
size_t maxNumEntriesPerRow,
const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
104 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
110 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
117 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
120 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
121 #ifdef HAVE_XPETRA_TPETRA
125 const typename local_graph_type::row_map_type& rowPointers,
126 const typename local_graph_type::entries_type::non_const_type& columnIndices,
127 const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
129 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
133 EpetraCrsGraphT(
const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
134 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
135 const local_graph_type& lclGraph,
136 const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
138 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
143 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
144 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
145 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
146 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
147 const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
149 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
188 return Teuchos::null;
192 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
return Teuchos::null; }
195 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
return Teuchos::null; }
198 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
return Teuchos::null; }
201 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
return Teuchos::null; }
204 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
return Teuchos::null; }
207 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
return Teuchos::null; }
264 void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &Indices)
const { }
269 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
270 #ifdef HAVE_XPETRA_TPETRA
271 local_graph_type getLocalGraph ()
const {
273 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
274 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
278 #warning "Xpetra Kokkos interface for CrsGraph is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
296 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
304 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
return Teuchos::null; }
329 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
342 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
345 :
public virtual CrsGraph<int, int, EpetraNode>
354 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
355 #ifdef HAVE_XPETRA_TPETRA
358 typedef typename node_type::execution_space execution_space;
372 EpetraCrsGraphT(
const RCP< const map_type > &rowMap,
size_t maxNumEntriesPerRow,
const RCP< Teuchos::ParameterList > &=Teuchos::null)
387 Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end());
388 graph_ = Teuchos::rcp(
new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), numEntriesPerRowToAlloc.getRawPtr(),
true));
391 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
392 #ifdef HAVE_XPETRA_TPETRA
396 const typename local_graph_type::row_map_type& ,
397 const typename local_graph_type::entries_type::non_const_type& ,
398 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
400 "Epetra does not support CrsGraph constructors using Kokkos Views!");
404 EpetraCrsGraphT(
const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
405 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
406 const local_graph_type& ,
407 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
409 "Epetra does not support CrsGraph constructors using a local graph!");
414 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
415 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
416 const Teuchos::RCP<const map_type>& = Teuchos::null,
417 const Teuchos::RCP<const map_type>& = Teuchos::null,
418 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
420 "Epetra does not support CrsGraph constructors using a local graph!");
438 XPETRA_ERR_CHECK(graph_->InsertGlobalIndices(globalRow, indices.size(), indices_rawPtr));
445 int* indices_rawPtr =
const_cast<int*
>(indices.getRawPtr());
446 XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr));
461 graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
462 bool doOptimizeStorage =
true;
463 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
464 if (doOptimizeStorage) graph_->OptimizeStorage();
471 graph_->FillComplete();
472 bool doOptimizeStorage =
true;
473 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
474 if (doOptimizeStorage) graph_->OptimizeStorage();
488 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRowMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RowMap()); }
491 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getColMap");
return toXpetra<GlobalOrdinal,Node>(graph_->ColMap()); }
494 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getDomainMap");
return toXpetra<GlobalOrdinal,Node>(graph_->DomainMap()); }
497 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRangeMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RangeMap()); }
500 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getImporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Importer()); }
503 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getExporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Exporter()); }
566 XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices));
567 if (numEntries == 0) { eIndices = NULL; }
569 Indices = ArrayView<const GlobalOrdinal>(eIndices, numEntries);
580 if (numEntries == 0) { eIndices = NULL; }
582 indices = ArrayView<const int>(eIndices, numEntries);
585 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
586 #ifdef HAVE_XPETRA_TPETRA
587 local_graph_type getLocalGraph ()
const {
589 "Epetra does not support Kokkos::StaticCrsGraph!");
590 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
594 #warning "Xpetra Kokkos interface for CrsGraph is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
614 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel =Teuchos::Describable::verbLevel_default)
const {
617 out <<
"EpetraCrsGraphT::describe : Warning, verbosity level is ignored by this method." << std::endl;
618 const Epetra_BlockMap rowmap = graph_->RowMap();
619 if (rowmap.Comm().MyPID() == 0) out <<
"** EpetraCrsGraphT **\n\nrowmap" << std::endl;
630 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getMap");
return toXpetra<GlobalOrdinal,Node>(graph_->Map()); }
640 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
641 int err = graph_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
642 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
653 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
654 int err = graph_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
655 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
666 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
667 int err = graph_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
668 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
680 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
681 int err = graph_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
682 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
691 TEUCHOS_TEST_FOR_EXCEPTION(!graph->RowMap().GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraCrsGraphT: GlobalOrdinal mismatch.");
706 #endif // specialization on Node=EpetraNode and GO=int
709 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
712 :
public virtual CrsGraph<int, long long, EpetraNode>
721 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
722 #ifdef HAVE_XPETRA_TPETRA
725 typedef typename node_type::execution_space execution_space;
739 EpetraCrsGraphT(
const RCP< const map_type > &rowMap,
size_t maxNumEntriesPerRow,
const RCP< Teuchos::ParameterList > &=Teuchos::null)
754 Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end());
755 graph_ = Teuchos::rcp(
new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), numEntriesPerRowToAlloc.getRawPtr(),
true));
758 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
759 #ifdef HAVE_XPETRA_TPETRA
763 const typename local_graph_type::row_map_type& ,
764 const typename local_graph_type::entries_type::non_const_type& ,
765 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
767 "Epetra does not support CrsGraph constructors using Kokkos Views!");
771 EpetraCrsGraphT(
const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
772 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
773 const local_graph_type& ,
774 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
776 "Epetra does not support CrsGraph constructors using a local graph!");
781 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
782 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
783 const Teuchos::RCP<const map_type>& = Teuchos::null,
784 const Teuchos::RCP<const map_type>& = Teuchos::null,
785 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
787 "Epetra does not support CrsGraph constructors using a local graph!");
805 XPETRA_ERR_CHECK(graph_->InsertGlobalIndices(globalRow, indices.size(), indices_rawPtr));
812 int* indices_rawPtr =
const_cast<int*
>(indices.getRawPtr());
813 XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr));
828 graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
829 bool doOptimizeStorage =
true;
830 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
831 if (doOptimizeStorage) graph_->OptimizeStorage();
838 graph_->FillComplete();
839 bool doOptimizeStorage =
true;
840 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
841 if (doOptimizeStorage) graph_->OptimizeStorage();
855 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRowMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RowMap()); }
858 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getColMap");
return toXpetra<GlobalOrdinal,Node>(graph_->ColMap()); }
861 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getDomainMap");
return toXpetra<GlobalOrdinal,Node>(graph_->DomainMap()); }
864 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRangeMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RangeMap()); }
867 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getImporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Importer()); }
870 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getExporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Exporter()); }
933 XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices));
934 if (numEntries == 0) { eIndices = NULL; }
936 Indices = ArrayView<const GlobalOrdinal>(eIndices, numEntries);
947 if (numEntries == 0) { eIndices = NULL; }
949 indices = ArrayView<const int>(eIndices, numEntries);
952 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
953 #ifdef HAVE_XPETRA_TPETRA
954 local_graph_type getLocalGraph ()
const {
956 "Epetra does not support Kokkos::StaticCrsGraph!");
957 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
961 #warning "Xpetra Kokkos interface for CrsGraph is enabled (HAVE_XPETRA_KOKKOS_REFACTOR) but Tpetra is disabled. The Kokkos interface needs Tpetra to be enabled, too."
979 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel =Teuchos::Describable::verbLevel_default)
const {
982 out <<
"EpetraCrsGraphT::describe : Warning, verbosity level is ignored by this method." << std::endl;
983 const Epetra_BlockMap rowmap = graph_->RowMap();
984 if (rowmap.Comm().MyPID() == 0) out <<
"** EpetraCrsGraphT **\n\nrowmap" << std::endl;
995 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getMap");
return toXpetra<GlobalOrdinal,Node>(graph_->Map()); }
1005 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
1006 int err = graph_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1007 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1018 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
1019 int err = graph_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1020 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1031 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
1032 int err = graph_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1033 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1045 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
1046 int err = graph_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1047 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1056 TEUCHOS_TEST_FOR_EXCEPTION(!graph->RowMap().GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraCrsGraphT: GlobalOrdinal mismatch.");
1070 #endif // specialization on Node=EpetraNode and GO=int
1074 #endif // XPETRA_EPETRACRSGRAPH_HPP
EpetraCrsGraphT(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)
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.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &=null)
Constructor specifying column Map and fixed number of entries for each row.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
EpetraCrsGraphT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty DynamicProfile graph (no space is preallocated).
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 isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
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 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.
EpetraCrsGraphT(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 > &=null)
virtual ~EpetraCrsGraphT()
Destructor.
size_t getNodeNumEntries() const
Returns the local number of entries in the graph.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
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.
size_t getGlobalMaxNumRowEntries() const
Maximum number of entries in all rows over all processes.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
bool hasColMap() const
Whether the graph has a column Map.
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)
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into the graph.
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &=null)
Constructor specifying column Map and fixed number of entries for each row.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert global indices into 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 getNodeNumEntries() const
Returns the local number of entries in the graph.
RCP< const Comm< int > > getComm() const
Returns the communicator.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
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.
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
EpetraCrsGraphT(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< Teuchos::ParameterList > &=Teuchos::null)
Constructor specifying fixed number of entries for each row.
size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of allocated entries for this node in the specified global row ...
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
global_size_t getGlobalNumRows() const
Returns the number of global rows in the graph.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert local indices into the graph.
EpetraCrsGraphT(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< Teuchos::ParameterList > &=Teuchos::null)
Constructor specifying fixed number of entries for each row.
RCP< const Comm< int > > getComm() const
Returns the communicator.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
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.
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_type > &rowMap, const RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor for empty DynamicProfile graph (no space is preallocated).
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
bool hasColMap() const
Whether the graph has a column Map.
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
size_t getNodeNumRows() const
Returns the number of graph rows owned on the calling node.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
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.
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 getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries on this node in the specified global row.
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
void fillComplete(const RCP< ParameterList > ¶ms=null)
Signal that data entry is complete.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in the graph.
bool isLocallyIndexed() const
Whether column indices are stored using local indices on the calling process.
bool isStorageOptimized() const
Returns true if storage has been optimized.
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.
RCP< const Comm< int > > getComm() const
Returns the communicator.
Exception throws when you call an unimplemented method of Xpetra.
bool isGloballyIndexed() const
Whether column indices are stored using global indices on the calling process.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
RCP< Epetra_CrsGraph > graph_
EpetraCrsGraphT(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 > &=null)
size_t global_size_t
Global size_t object.
std::string description() const
Return a simple one-line description of this object.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local row.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Return a const, nonpersisting view of local indices in the given row.
virtual ~EpetraCrsGraphT()
Destructor.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
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.
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)
RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const
Returns the exporter associated with this graph.
std::string description() const
Return a simple one-line description of this object.
bool isFillComplete() const
Whether fillComplete() has been called and the graph is in compute mode.
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
GlobalOrdinal getIndexBase() const
Returns the index base for global indices for this graph.
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
virtual ~EpetraCrsGraphT()
Destructor.
size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of allocated entries on this node in the specified local row...
RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const
Returns the importer associated with this graph.
size_t getNodeNumCols() const
Returns the number of columns connected to the locally owned rows of this graph.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The specialization of Map used by this class.
global_size_t getGlobalNumCols() const
Returns the number of global columns in the graph.
bool hasColMap() const
Whether the graph has a column Map.
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).
#define XPETRA_MONITOR(funcName)
void computeGlobalConstants()
Force the computation of global constants if we don't have them.
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.
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
EpetraCrsGraphT(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, const RCP< Teuchos::ParameterList > &plist=Teuchos::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.
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.
EpetraCrsGraphT(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=null)
Constructor specifying column Map and fixed number of entries for each row.
EpetraCrsGraphT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty DynamicProfile graph (no space is preallocated).
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this graph.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the domain of this graph.
bool isStorageOptimized() const
Returns true if storage has been optimized.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel=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< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
EpetraCrsGraphT(const Teuchos::RCP< Epetra_CrsGraph > &graph)
EpetraCrsGraphT constructor to wrap a Epetra_CrsGraph object.
void doImport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
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.
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 getNodeNumEntries() const
Returns the local number of entries in the graph.
bool isStorageOptimized() const
Returns true if storage has been optimized.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.