43int main(
int argc,
char *argv[])
50 MPI_Init(&argc,&argv);
57 cerr <<
"This example must be run with one process only." << endl;
65 long long NumPoints = 5;
66#if !defined(EPETRA_NO_32BIT_GLOBAL_INDICES) || !defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
72 Teuchos::RefCountPtr<Epetra_CrsMatrix> Matrix = Teuchos::rcp(
new Epetra_CrsMatrix(
Copy,Map,0) );
74 std::vector<long long> Indices(NumPoints);
75 std::vector<double> Values(NumPoints);
78 for (
long long i = 0 ; i < NumPoints ; ++i) {
80 Matrix->InsertGlobalValues(i,1,&Diag,&i);
84 for (
long long j = i + 1 ; j < NumPoints ; ++j) {
85 Indices[NumEntries] = j;
86 Values[NumEntries] = 1.0 * (j - i);
89#if !defined(EPETRA_NO_32BIT_GLOBAL_INDICES) || !defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
90 Matrix->InsertGlobalValues(i,NumEntries,&Values[0],&Indices[0]);
93 Matrix->FillComplete();
99 cout <<
"Sparsity, non-dropped matrix" << endl;
110 assert (DropA.MaxNumEntries() == 2);
112 cout <<
"Sparsity, dropping by value" << endl;
122 cout <<
"Sparsity, dropping by sparsity" << endl;
124 assert (SparsityA.MaxNumEntries() == 3);
137 cout <<
"Sparsity, dropping singletons 4 times" << endl;
139 assert (Filter4.NumMyRows() == 1);
144 return(EXIT_SUCCESS);