static char help[] = "Tests copying and ordering uniprocessor row-based sparse matrices.\n\n"; #include int main(int argc,char **args) { Mat C,A; PetscInt i,j,m = 5,n = 5,Ii,J; PetscScalar v; IS perm,iperm; PetscCall(PetscInitialize(&argc,&args,(char*)0,help)); PetscCall(MatCreateSeqAIJ(PETSC_COMM_SELF,m*n,m*n,5,NULL,&C)); /* create the matrix for the five point stencil, YET AGAIN*/ for (i=0; i0) {J = Ii - n; PetscCall(MatSetValues(C,1,&Ii,1,&J,&v,INSERT_VALUES));} if (i0) {J = Ii - 1; PetscCall(MatSetValues(C,1,&Ii,1,&J,&v,INSERT_VALUES));} if (j