56int main(
int argc,
char *argv[])
63 MPI_Init(&argc,&argv);
70 cerr <<
"This example must be run with one process only." << endl;
79#if !defined(EPETRA_NO_32BIT_GLOBAL_INDICES) || !defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
85 Teuchos::RefCountPtr<Epetra_CrsMatrix> Matrix = Teuchos::rcp(
new Epetra_CrsMatrix(
Copy,Map,0) );
87 std::vector<int> Indices(NumPoints);
88 std::vector<double> Values(NumPoints);
91 for (
int i = 0 ; i < NumPoints ; ++i) {
93 Matrix->InsertGlobalValues(i,1,&Diag,&i);
97 for (
int j = i + 1 ; j < NumPoints ; ++j) {
98 Indices[NumEntries] = j;
99 Values[NumEntries] = 1.0 * (j - i);
102#if !defined(EPETRA_NO_32BIT_GLOBAL_INDICES) || !defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
103 Matrix->InsertGlobalValues(i,NumEntries,&Values[0],&Indices[0]);
106 Matrix->FillComplete();
112 cout <<
"Sparsity, non-dropped matrix" << endl;
123 assert (DropA.MaxNumEntries() == 2);
125 cout <<
"Sparsity, dropping by value" << endl;
135 cout <<
"Sparsity, dropping by sparsity" << endl;
137 assert (SparsityA.MaxNumEntries() == 3);
150 cout <<
"Sparsity, dropping singletons 4 times" << endl;
152 assert (Filter4.NumMyRows() == 1);
157 return(EXIT_SUCCESS);