How to get the matrix after ordering

Matthew Knepley knepley at
Mon Feb 23 08:35:15 CST 2009

On Sun, Feb 22, 2009 at 9:30 PM, Shengli Xu <shengli.xu.xu at> wrote:

> Hi everyone,
> I want get the ordering matrix of a sparse matrix. I use MatGetOrdering(Mat
> matrix, MatOrderingType type, IS* rowperm, IS* colperm); to get rowperm and
> colperm.
> How to get the matrix after ordering?

I am  not sure what you mean. A MatOrdering is exactly those permutation
vectors. We do not
change the matrix. If you want to change the matrix, you must use something
like MatPermute().


> --
> Shengli Xu
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the petsc-users mailing list