Actual source code: ex164.c

petsc-3.4.5 2014-06-29
  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: }