Actual source code: ex164.c
1: static char help[] = "Tests MatConvert() from SeqDense to SeqAIJ \n\n";
3: #include <petscmat.h>
5: int main(int argc, char **args)
6: {
7: Mat A, C;
8: PetscInt n = 10;
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: }
21: /*TEST
23: test:
25: TEST*/