16 RCP<Epetra_CrsMatrix> getEpetraMatrix(
int numRows,
int numCols,
double shift=0.0)
19 const RCP<const Epetra_Comm> comm = getEpetraComm();
21 const Epetra_Map rowMap(numRows, 0, *comm);
22 const Epetra_Map domainMap(numCols, numCols, 0, *comm);
24 const RCP<Epetra_CrsMatrix> epetraCrsM =
25 rcp(
new Epetra_CrsMatrix(Copy, rowMap, numCols));
27 Array<double> rowEntries(numCols);
28 Array<int> columnIndices(numCols);
29 for (
int j = 0; j < numCols; ++j) {
33 const int numLocalRows = rowMap.NumMyElements();
35 for (
int i = 0; i < numLocalRows; ++i) {
37 for (
int j = 0; j < numCols; ++j) {
38 rowEntries[j] = as<double>(i+1) + as<double>(j+1) / 10 + shift;
41 epetraCrsM->InsertMyValues( i, numCols, &rowEntries[0], &columnIndices[0] );
45 epetraCrsM->FillComplete(domainMap, rowMap);
53 #if defined(Thyra_SHOW_DEPRECATED_WARNINGS)
55 #warning "The ThyraEpetraAdapters package is deprecated"
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)