On Wed, Jun 10, 2015 at 10:03 AM, Tim Steinhoff <[email protected]>
wrote:

> Hi all
>
> assume that a sparse matrix is constructed via
>
> MPI_Comm comm;
> Mat A;
> PetscInt n = 10000; /* dimension of matrix */
> comm = PETSC_COMM_SELF;
> MatCreate(comm,&A);
> MatSetSizes(Amat,n,n,n,n);
> MatSetBlockSize(A,6);
> MatSetType(A,MATAIJ);
>
> followd by some suitable preallocation and setting of values.
>
> What can be done to efficiently read the values from the matrix A and
> store them in a format like the coordinate format COO?
>

Using MatGetRow() should be fine for this.

  Thanks,

    Matt


> Regards
> Tim
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

Reply via email to