<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Aug 10, 2015 at 3:57 AM, Hoang Giang Bui <span dir="ltr"><<a href="mailto:hgbk2008@gmail.com" target="_blank">hgbk2008@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear list<br>
<br>
What is the best way to search for complete zero rows of the matrix and set the diagonal to 1.0? In my thinking, the solution would be:<br>
+ extract the max absolute values of each row by using MatGetRowMaxAbs<br>
+ Compare the value with some tolerance and put into the zero row list<br>
+ Extract the diagonal of the matrix by MatGetDiagonal<br>
+ modify the vector of diagonal<br>
+ set the diagonal back by using MatDiagonalSet<br>
<br>
THis seem to be overly complicated. Is there an all-in-one solution, similar to MatZeroRowsColumns?<br></blockquote><div><br></div><div>I don't think there is anything better than checking the MaxAbs, and calling MatZeroRows() on the indices with a 0.0</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Best regards<span class="HOEnZb"><font color="#888888"><br>
Giang<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>