Actual source code: ex164.c

petsc-3.7.3 2016-08-01
Report Typos and Errors
  2: static char help[] = "Tests MatConvert() from SeqDense to SeqAIJ \n\n";

  4: #include <petscmat.h>

  8: int main(int argc,char **args)
  9: {
 10:   Mat            A,C;
 12:   PetscInt       n = 10;

 14:   PetscInitialize(&argc,&args,(char*)0,help);
 15:   MatCreateSeqDense(PETSC_COMM_WORLD,n,n,NULL,&A);
 16:   MatConvert(A,MATSEQDENSE,MAT_INITIAL_MATRIX,&C);
 17:   MatView(C,NULL);
 18:   MatDestroy(&A);
 19:   MatDestroy(&C);
 20:   PetscFinalize();
 21:   return 0;
 22: }