1 2 static char help[] = "Tests MatConvert() from SeqDense to SeqAIJ \n\n"; 3 4 #include <petscmat.h> 5 6 int main(int argc, char **args) { 7 Mat A, C; 8 PetscInt n = 10; 9 10 PetscFunctionBeginUser; 11 PetscCall(PetscInitialize(&argc, &args, (char *)0, help)); 12 PetscCall(MatCreateSeqDense(PETSC_COMM_WORLD, n, n, NULL, &A)); 13 PetscCall(MatConvert(A, MATSEQDENSE, MAT_INITIAL_MATRIX, &C)); 14 PetscCall(MatView(C, NULL)); 15 PetscCall(MatDestroy(&A)); 16 PetscCall(MatDestroy(&C)); 17 PetscCall(PetscFinalize()); 18 return 0; 19 } 20 21 /*TEST 22 23 test: 24 25 TEST*/ 26