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)");
125 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
127 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
132 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 133 #ifdef HAVE_XPETRA_TPETRA 137 const typename local_graph_type::row_map_type& rowPointers,
138 const typename local_graph_type::entries_type::non_const_type& columnIndices,
139 const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
141 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
145 EpetraCrsGraphT(
const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
146 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
147 const local_graph_type& lclGraph,
148 const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
150 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
155 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap,
156 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap,
157 const Teuchos::RCP<const map_type>& domainMap = Teuchos::null,
158 const Teuchos::RCP<const map_type>& rangeMap = Teuchos::null,
159 const RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
161 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
184 void allocateAllIndices(
size_t numNonZeros,ArrayRCP<size_t> & rowptr, ArrayRCP<LocalOrdinal> & colind) { }
187 void setAllIndices(
const ArrayRCP<size_t> & rowptr,
const ArrayRCP<LocalOrdinal> & colind){ }
190 void getAllIndices(ArrayRCP<const size_t>& rowptr, ArrayRCP<const LocalOrdinal>& colind)
const { }
212 const Teuchos::RCP<Teuchos::ParameterList>& params =
222 return Teuchos::null;
226 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
return Teuchos::null; }
229 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
return Teuchos::null; }
232 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
return Teuchos::null; }
235 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
return Teuchos::null; }
238 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
return Teuchos::null; }
241 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
return Teuchos::null; }
298 void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &Indices)
const { }
303 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 304 #ifdef HAVE_XPETRA_TPETRA 305 typename local_graph_type::HostMirror getLocalGraphHost ()
const {
307 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
308 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
312 #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." 316 #ifdef HAVE_XPETRA_TPETRA 317 local_graph_type getLocalGraphDevice ()
const {
319 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
320 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
324 #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." 343 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default)
const { }
351 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
return Teuchos::null; }
376 "Xpetra::EpetraCrsGraph only available for GO=int or GO=long long with EpetraNode (Serial or OpenMP depending on configuration)");
389 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES 392 :
public virtual CrsGraph<int, int, EpetraNode>
401 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 402 #ifdef HAVE_XPETRA_TPETRA 405 typedef typename node_type::execution_space execution_space;
419 EpetraCrsGraphT(
const RCP< const map_type > &rowMap,
size_t maxNumEntriesPerRow,
const RCP< Teuchos::ParameterList > &=Teuchos::null)
434 Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end());
435 graph_ = Teuchos::rcp(
new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), numEntriesPerRowToAlloc.getRawPtr(),
true));
443 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
447 RCP< const Epetra_CrsGraph> eSourceGraph = tSourceGraph.getEpetra_CrsGraph();
450 graph_ = Teuchos::rcp(
new Epetra_CrsGraph(Copy,eSourceGraph->RowMap(),0,
false));
451 graph_->Import(*eSourceGraph,*tImporter.getEpetra_Import(),Insert);
453 const Epetra_BlockMap & myDomainMap = domainMap!=Teuchos::null ? toEpetra<GlobalOrdinal,Node>(domainMap) : eSourceGraph->ColMap();
454 const Epetra_BlockMap & myRangeMap = rangeMap!=Teuchos::null ? toEpetra<GlobalOrdinal,Node>(rangeMap) : toEpetra<LocalOrdinal,Node>(importer.
getTargetMap());
456 graph_->FillComplete(myDomainMap,myRangeMap);
462 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 463 #ifdef HAVE_XPETRA_TPETRA 467 const typename local_graph_type::row_map_type& ,
468 const typename local_graph_type::entries_type::non_const_type& ,
469 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
471 "Epetra does not support CrsGraph constructors using Kokkos Views!");
475 EpetraCrsGraphT(
const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
476 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
477 const local_graph_type& ,
478 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
480 "Epetra does not support CrsGraph constructors using a local graph!");
485 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
486 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
487 const Teuchos::RCP<const map_type>& = Teuchos::null,
488 const Teuchos::RCP<const map_type>& = Teuchos::null,
489 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
491 "Epetra does not support CrsGraph constructors using a local graph!");
509 XPETRA_ERR_CHECK(graph_->InsertGlobalIndices(globalRow, indices.size(), indices_rawPtr));
516 int* indices_rawPtr =
const_cast<int*
>(indices.getRawPtr());
517 XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr));
525 void allocateAllIndices(
size_t numNonZeros, ArrayRCP<size_t>& rowptr, ArrayRCP<LocalOrdinal>& colind) {
536 bool ownMemory =
false;
540 Epetra_IntSerialDenseVector& myColind = graph_->ExpertExtractIndices();
541 myColind.Resize(numNonZeros);
542 colind = Teuchos::arcp(myColind.Values(), lowerOffset, numNonZeros, ownMemory);
546 void setAllIndices(
const ArrayRCP<size_t>& rowptr,
const ArrayRCP<LocalOrdinal>& colind) {
551 "An exception is thrown to let you know that the size of your rowptr array is incorrect.");
552 if (colind.size() > 0) {
554 "An exception is thrown to let you know that you mismatched your pointers.");
561 Epetra_IntSerialDenseVector& myRowptr = graph_->ExpertExtractIndexOffset();
562 myRowptr.Resize(N+1);
563 for (
size_t i = 0; i < N+1; i++)
564 myRowptr[i] = Teuchos::as<int>(rowptr[i]);
569 void getAllIndices(ArrayRCP<const size_t>& rowptr, ArrayRCP<const LocalOrdinal>& colind)
const {
573 bool ownMemory =
false;
580 Epetra_IntSerialDenseVector& myRowptr = graph_->ExpertExtractIndexOffset();
582 for (
size_t i = 0; i < n+1; i++)
583 (*const_cast<size_t*>(&rowptr[i])) = Teuchos::as<size_t>(myRowptr[i]);
586 colind = Teuchos::arcp(graph_->ExpertExtractIndices().Values(), lowerOffset, nnz, ownMemory);
600 graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
601 bool doOptimizeStorage =
true;
602 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
603 if (doOptimizeStorage) graph_->OptimizeStorage();
610 graph_->FillComplete();
611 bool doOptimizeStorage =
true;
612 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
613 if (doOptimizeStorage) graph_->OptimizeStorage();
624 const Teuchos::RCP<Teuchos::ParameterList>& params =
627 graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
628 graph_->OptimizeStorage();
643 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRowMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RowMap()); }
646 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getColMap");
return toXpetra<GlobalOrdinal,Node>(graph_->ColMap()); }
649 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getDomainMap");
return toXpetra<GlobalOrdinal,Node>(graph_->DomainMap()); }
652 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRangeMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RangeMap()); }
655 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getImporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Importer()); }
658 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getExporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Exporter()); }
721 XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices));
722 if (numEntries == 0) { eIndices = NULL; }
724 Indices = ArrayView<const GlobalOrdinal>(eIndices, numEntries);
735 if (numEntries == 0) { eIndices = NULL; }
737 indices = ArrayView<const int>(eIndices, numEntries);
740 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 741 #ifdef HAVE_XPETRA_TPETRA 742 typename local_graph_type::HostMirror getLocalGraphHost ()
const {
744 "Epetra does not support Kokkos::StaticCrsGraph!");
745 TEUCHOS_UNREACHABLE_RETURN((local_graph_type::HostMirror()));
749 #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." 753 #ifdef HAVE_XPETRA_TPETRA 754 local_graph_type getLocalGraphDevice ()
const {
756 "Epetra does not support Kokkos::StaticCrsGraph!");
757 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
761 #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." 782 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel =Teuchos::Describable::verbLevel_default)
const {
785 out <<
"EpetraCrsGraphT::describe : Warning, verbosity level is ignored by this method." << std::endl;
786 const Epetra_BlockMap rowmap = graph_->RowMap();
787 if (rowmap.Comm().MyPID() == 0) out <<
"** EpetraCrsGraphT **\n\nrowmap" << std::endl;
798 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getMap");
return toXpetra<GlobalOrdinal,Node>(graph_->Map()); }
808 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
809 int err = graph_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
810 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
821 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
822 int err = graph_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
823 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
834 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
835 int err = graph_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
836 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
848 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
849 int err = graph_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
850 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
859 TEUCHOS_TEST_FOR_EXCEPTION(!graph->RowMap().GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraCrsGraphT: GlobalOrdinal mismatch.");
874 #endif // specialization on Node=EpetraNode and GO=int 877 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES 880 :
public virtual CrsGraph<int, long long, EpetraNode>
889 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 890 #ifdef HAVE_XPETRA_TPETRA 893 typedef typename node_type::execution_space execution_space;
907 EpetraCrsGraphT(
const RCP< const map_type > &rowMap,
size_t maxNumEntriesPerRow,
const RCP< Teuchos::ParameterList > &=Teuchos::null)
922 Teuchos::Array<int> numEntriesPerRowToAlloc(NumEntriesPerRowToAlloc.begin(), NumEntriesPerRowToAlloc.end());
923 graph_ = Teuchos::rcp(
new Epetra_CrsGraph(Copy, toEpetra<GlobalOrdinal,Node>(rowMap), toEpetra<GlobalOrdinal,Node>(colMap), numEntriesPerRowToAlloc.getRawPtr(),
true));
926 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 927 #ifdef HAVE_XPETRA_TPETRA 931 const typename local_graph_type::row_map_type& ,
932 const typename local_graph_type::entries_type::non_const_type& ,
933 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
935 "Epetra does not support CrsGraph constructors using Kokkos Views!");
939 EpetraCrsGraphT(
const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
940 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
941 const local_graph_type& ,
942 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
944 "Epetra does not support CrsGraph constructors using a local graph!");
949 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
950 const RCP<
const Map< LocalOrdinal, GlobalOrdinal, Node > > &,
951 const Teuchos::RCP<const map_type>& = Teuchos::null,
952 const Teuchos::RCP<const map_type>& = Teuchos::null,
953 const RCP< Teuchos::ParameterList > &=Teuchos::null) {
955 "Epetra does not support CrsGraph constructors using a local graph!");
973 XPETRA_ERR_CHECK(graph_->InsertGlobalIndices(globalRow, indices.size(), indices_rawPtr));
980 int* indices_rawPtr =
const_cast<int*
>(indices.getRawPtr());
981 XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr));
989 void allocateAllIndices(
size_t numNonZeros, ArrayRCP<size_t>& rowptr, ArrayRCP<LocalOrdinal>& colind) {
1000 bool ownMemory =
false;
1004 Epetra_IntSerialDenseVector& myColind = graph_->ExpertExtractIndices();
1005 myColind.Resize(numNonZeros);
1006 colind = Teuchos::arcp(myColind.Values(), lowerOffset, numNonZeros, ownMemory);
1010 void setAllIndices(
const ArrayRCP<size_t>& rowptr,
const ArrayRCP<LocalOrdinal>& colind) {
1015 "An exception is thrown to let you know that the size of your rowptr array is incorrect.");
1016 if (colind.size() > 0) {
1018 "An exception is thrown to let you know that you mismatched your pointers.");
1025 Epetra_IntSerialDenseVector& myRowptr = graph_->ExpertExtractIndexOffset();
1026 myRowptr.Resize(N+1);
1027 for (
size_t i = 0; i < N+1; i++)
1028 myRowptr[i] = Teuchos::as<int>(rowptr[i]);
1033 void getAllIndices(ArrayRCP<const size_t>& rowptr, ArrayRCP<const LocalOrdinal>& colind)
const {
1036 int lowerOffset = 0;
1037 bool ownMemory =
false;
1044 Epetra_IntSerialDenseVector& myRowptr = graph_->ExpertExtractIndexOffset();
1046 for (
size_t i = 0; i < n+1; i++)
1047 (*const_cast<size_t*>(&rowptr[i])) = Teuchos::as<size_t>(myRowptr[i]);
1050 colind = Teuchos::arcp(graph_->ExpertExtractIndices().Values(), lowerOffset, nnz, ownMemory);
1064 graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
1065 bool doOptimizeStorage =
true;
1066 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
1067 if (doOptimizeStorage) graph_->OptimizeStorage();
1074 graph_->FillComplete();
1075 bool doOptimizeStorage =
true;
1076 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
1077 if (doOptimizeStorage) graph_->OptimizeStorage();
1088 const Teuchos::RCP<Teuchos::ParameterList>& params =
1091 graph_->FillComplete(toEpetra<GlobalOrdinal,Node>(domainMap), toEpetra<GlobalOrdinal,Node>(rangeMap));
1092 graph_->OptimizeStorage();
1107 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRowMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRowMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RowMap()); }
1110 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getColMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getColMap");
return toXpetra<GlobalOrdinal,Node>(graph_->ColMap()); }
1113 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getDomainMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getDomainMap");
return toXpetra<GlobalOrdinal,Node>(graph_->DomainMap()); }
1116 RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getRangeMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getRangeMap");
return toXpetra<GlobalOrdinal,Node>(graph_->RangeMap()); }
1119 RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > >
getImporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getImporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Importer()); }
1122 RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > >
getExporter()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getExporter");
return toXpetra<GlobalOrdinal,Node>(graph_->Exporter()); }
1185 XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices));
1186 if (numEntries == 0) { eIndices = NULL; }
1188 Indices = ArrayView<const GlobalOrdinal>(eIndices, numEntries);
1198 XPETRA_ERR_CHECK(graph_->ExtractMyRowView(LocalRow, numEntries, eIndices));
1199 if (numEntries == 0) { eIndices = NULL; }
1201 indices = ArrayView<const int>(eIndices, numEntries);
1204 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR 1205 #ifdef HAVE_XPETRA_TPETRA 1206 local_graph_type getLocalGraphHost ()
const {
1208 "Epetra does not support Kokkos::StaticCrsGraph!");
1209 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
1213 #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." 1216 #ifdef HAVE_XPETRA_TPETRA 1217 local_graph_type getLocalGraphDevice ()
const {
1219 "Epetra does not support Kokkos::StaticCrsGraph!");
1220 TEUCHOS_UNREACHABLE_RETURN((local_graph_type()));
1224 #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." 1242 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel =Teuchos::Describable::verbLevel_default)
const {
1245 out <<
"EpetraCrsGraphT::describe : Warning, verbosity level is ignored by this method." << std::endl;
1246 const Epetra_BlockMap rowmap = graph_->RowMap();
1247 if (rowmap.Comm().MyPID() == 0) out <<
"** EpetraCrsGraphT **\n\nrowmap" << std::endl;
1258 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >
getMap()
const {
XPETRA_MONITOR(
"EpetraCrsGraphT::getMap");
return toXpetra<GlobalOrdinal,Node>(graph_->Map()); }
1268 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
1269 int err = graph_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1270 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1281 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
1282 int err = graph_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
1283 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1294 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
1295 int err = graph_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1296 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1308 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
1309 int err = graph_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
1310 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
1319 TEUCHOS_TEST_FOR_EXCEPTION(!graph->RowMap().GlobalIndicesIsType<
GlobalOrdinal>(), std::runtime_error,
"Xpetra::EpetraCrsGraphT: GlobalOrdinal mismatch.");
1333 #endif // specialization on Node=EpetraNode and GO=int 1337 #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 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.
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 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.
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.
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
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.
void expertStaticFillComplete(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Expert version of fillComplete.
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.
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.
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.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
RCP< const Comm< int > > getComm() const
Returns the communicator.
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
void removeLocalIndices(LocalOrdinal localRow)
Remove all graph indices from the specified local 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.
size_t getNodeMaxNumRowEntries() const
Maximum number of entries in all rows owned by the calling process.
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the graph.
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.
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.
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.
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.
RCP< const Comm< int > > getComm() const
Returns the communicator.
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.
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.
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getTargetMap() const =0
The Target Map used to construct this Import object.
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.
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.
void allocateAllIndices(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind)
Allocates the 1D pointer arrays of the 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_type > &rowMap, const RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor for empty DynamicProfile graph (no space is preallocated).
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.
EpetraCrsGraphT(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &sourceGraph, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
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 ...
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.
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...
void expertStaticFillComplete(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Expert version of fillComplete.
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.
Exception throws when you call an unimplemented method of Xpetra.
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)
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets the 1D pointer arrays of the graph.
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.
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.
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the graph.
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.
void expertStaticFillComplete(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
Expert version of fillComplete.
RCP< const Epetra_CrsGraph > getEpetra_CrsGraph() const
Get the underlying Epetra graph.
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets the 1D pointer arrays of the 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.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this graph.
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.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
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.
EpetraCrsGraphT(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &sourceGraph, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node >> &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const RCP< Teuchos::ParameterList > ¶ms=Teuchos::null)
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.
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.
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.
RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this graph.
void setAllIndices(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind)
Sets the 1D pointer arrays of the graph.
EpetraCrsGraphT(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty DynamicProfile graph (no space is preallocated).
void getAllIndices(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind) const
Gets the 1D pointer arrays of the 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...