<div class="gmail_quote">On Mon, May 21, 2012 at 2:20 PM, Andrew Spott <span dir="ltr"><<a href="mailto:andrew.spott@gmail.com" target="_blank">andrew.spott@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>How do I read the nonzero structure (from an assembled matrix?)</div></div></blockquote><div><br></div><div>MatGetRow()</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Andrew</div></font></span><div><div class="h5"><br><div><div>On May 18, 2012, at 2:31 PM, Jed Brown wrote:</div><br><blockquote type="cite">
<div class="gmail_quote">On Fri, May 18, 2012 at 3:26 PM, Andrew Spott <span dir="ltr"><<a href="mailto:andrew.spott@gmail.com" target="_blank">andrew.spott@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I have a couple of questions about how to deal with the nonzero structure.<br>
<br>
0)  Is the "nonzero structure" the same as "number of non zeros per row"? Or are they different?<br></blockquote><div><br></div><div>Yes, for parallel *AIJ matrices, it's the number of nonzeros in the diagonal part and in the off-diagonal part. Preallocation can optionally also set the column indices, but it's not critical.</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
1)  How much of a speedup do you get for copying/creating/loading matrices when you set the number of non zeros per row beforehand? (if the nonzero structure is different from the number of non zeros per row, what about the nonzero structure)<br>

</blockquote><div><br></div><div>a million</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
2)  If I have a matrix, how do I add to the nonzero structure, without actually adding nonzero values, do I just add "0.0"? (the matrix will have values there, but doesn't at the moment)<br></blockquote><div>

<br></div><div>Mat*AIJSetPreallocation(), then reassemble.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
As usual, thanks for all the help<br>
<span><font color="#888888"><br>
-Andrew</font></span></blockquote></div><br>
</blockquote></div><br></div></div></div></blockquote></div><br>