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