[petsc-users] getting a sub matrix from a matrix

Nachiket Gokhale gokhalen at gmail.com
Fri Dec 21 15:16:29 CST 2012


I have a dense matrix A  (100x100)   and I want to extract a matrix B from
it consisting of the first  N columns of A.   Is there a better way to do
it than getting the column using MatGetColumnVector, followed by
VecGetArray,  and MatSetValues?  It could also be done using
MatGetSubMatrix but is seems to be more involved.

Thanks,

 -Nachiket
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121221/9a2a607d/attachment.html>


More information about the petsc-users mailing list