void EpetraCrsGraph::getGlobalRowView(int GlobalRow, ArrayView<const int> &Indices) const { XPETRA_MONITOR("EpetraCrsGraph::getGlobalRowView"); int numEntries; int * eIndices; XPETRA_ERR_CHECK(graph_->ExtractGlobalRowView(GlobalRow, numEntries, eIndices)); if (numEntries == 0) { eIndices = NULL; } // Cf. TEUCHOS_TEST_FOR_EXCEPT( p == 0 && size_in != 0 ) in Teuchos ArrayView constructor. Indices = ArrayView<const int>(eIndices, numEntries); }
//! Return a const, nonpersisting view of local indices in the given row. void getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &indices) const { XPETRA_MONITOR("EpetraCrsGraphT::getLocalRowView"); int numEntries; int * eIndices; XPETRA_ERR_CHECK(graph_->ExtractMyRowView(LocalRow, numEntries, eIndices)); if (numEntries == 0) { eIndices = NULL; } // Cf. TEUCHOS_TEST_FOR_EXCEPT( p == 0 && size_in != 0 ) in Teuchos ArrayView constructor. indices = ArrayView<const int>(eIndices, numEntries); }
void EpetraCrsGraph::insertLocalIndices(int localRow, const ArrayView<const int> &indices) { XPETRA_MONITOR("EpetraCrsGraph::insertLocalIndices"); int* indices_rawPtr = const_cast<int*>(indices.getRawPtr()); // there is no const in the Epetra interface :( XPETRA_ERR_CHECK(graph_->InsertMyIndices(localRow, indices.size(), indices_rawPtr)); }