58 return *(epetraGraph->getEpetra_CrsGraph());
62 : graph_(Teuchos::rcp(
new Epetra_CrsGraph(Copy,
toEpetra(rowMap), maxNumEntriesPerRow,
toEpetra(pftype)))) { }
69 : graph_(Teuchos::rcp(
new Epetra_CrsGraph(Copy,
toEpetra(rowMap),
toEpetra(colMap), maxNumEntriesPerRow,
toEpetra(pftype)))) { }
78 int* indices_rawPtr =
const_cast<int*
>(indices.getRawPtr());
85 int* indices_rawPtr =
const_cast<int*
>(indices.getRawPtr());
96 if (numEntries == 0) { eIndices = NULL; }
98 Indices = ArrayView<const int>(eIndices, numEntries);
108 if (numEntries == 0) { eIndices = NULL; }
110 indices = ArrayView<const int>(eIndices, numEntries);
117 bool doOptimizeStorage =
true;
118 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
119 if (doOptimizeStorage)
graph_->OptimizeStorage();
126 bool doOptimizeStorage =
true;
127 if (params != null && params->get(
"Optimize Storage",
true) ==
false) doOptimizeStorage =
false;
128 if (doOptimizeStorage)
graph_->OptimizeStorage();
136 out <<
"EpetraCrsGraph::describe : Warning, verbosity level is ignored by this method." << std::endl;
137 const Epetra_BlockMap rowmap =
graph_->RowMap();
138 if (rowmap.Comm().MyPID() == 0) out <<
"** EpetraCrsGraph **\n\nrowmap" << std::endl;
144 RCP< const CrsGraph<int, int> >
toXpetra(
const Epetra_CrsGraph &g) {
145 RCP<const Epetra_CrsGraph> const_graph = rcp(
new Epetra_CrsGraph(g));
147 RCP<Epetra_CrsGraph> graph = Teuchos::rcp_const_cast<Epetra_CrsGraph>(const_graph);
160 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
161 int err =
graph_->Import(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
162 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
172 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
173 int err =
graph_->Export(*v, *tImporter.getEpetra_Import(),
toEpetra(CM));
174 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
184 RCP<const Epetra_CrsGraph> v = tSource.getEpetra_CrsGraph();
185 int err =
graph_->Import(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
186 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
197 RCP<const Epetra_CrsGraph> v = tDest.getEpetra_CrsGraph();
198 int err =
graph_->Export(*v, *tExporter.getEpetra_Export(),
toEpetra(CM));
199 TEUCHOS_TEST_FOR_EXCEPTION(err != 0, std::runtime_error,
"Catch error code returned by Epetra.");
RCP< const CrsGraph< int, int > > toXpetra(const Epetra_CrsGraph &g)
void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)
Insert graph indices, using global IDs.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const
Extract a const, non-persisting view of local indices in a specified row of the graph.
void insertLocalIndices(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)
Insert graph indices, using local IDs.
std::string description() const
Return a simple one-line description of this object.
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.
#define XPETRA_RCP_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
const Epetra_CrsGraph & toEpetra(const RCP< const CrsGraph< int, int > > &graph)
RCP< Epetra_CrsGraph > graph_
#define XPETRA_ERR_CHECK(arg)
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.
EpetraCrsGraph(const RCP< const map_type > &rowMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, const RCP< ParameterList > ¶ms=null)
Constructor specifying fixed number of entries for each row.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
void doExport(const DistObject< GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
CombineMode
Xpetra::Combine Mode enumerable type.
#define XPETRA_MONITOR(funcName)
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const
Extract a const, non-persisting view of global indices in a specified row of the graph.