<br><br><div class="gmail_quote">2009/2/23 Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Sun, Feb 22, 2009 at 9:30 PM, Shengli Xu <span dir="ltr"><<a href="mailto:shengli.xu.xu@gmail.com" target="_blank">shengli.xu.xu@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_quote">
<div><div></div><div class="Wj3C7c"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br clear="all">Hi everyone,<br><br>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. <br><br>How to get the matrix after ordering? </blockquote>
</div></div><div><br>I am not sure what you mean. A MatOrdering is exactly those permutation vectors. We do not<br>change the matrix. If you want to change the matrix, you must use something like MatPermute().<br><br> Matt<br>
</div></div></blockquote><div>Thank you Matt, MatPermute() is what I want. <br><br>Another question: Matrix A is known, there are some zero entries in A. For example A(2,3)=0.0 and A(4,5)=0.0. I want to get a new matrix B, which has the same nonzero structure as A but does not have the entries where are zero in A. For example no entries of B(2,3) and B(4,5). How to get Matrix B?<br>
<br>I want to use MatGetSeqNonzeroStructure(), But I don't think clearly.<br><br>thanks in advance.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>-- <br><font color="#888888">Shengli Xu<br>
</font></blockquote></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>
</blockquote></div><br><br clear="all"><br>-- <br>Shengli Xu<br>