On Tue, Sep 25, 2012 at 5:44 PM, John Mousel <span dir="ltr"><<a href="mailto:john.mousel@gmail.com" target="_blank">john.mousel@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>If I'm adding to a particular column in multiple passes, do I need to preallocate enough memory for each pass, or just 1 for each column in the row?<br>Right now I'm drastically over-allocating, and I'm trying to reduce this. If I give the true number of columns in the row, I keep getting new entry errors.<br>

<br>New nonzero at (8045,60) caused a malloc!<br></blockquote><div><br></div><div>You have to be more specific. It sounds like what you are doing is</div><div><br></div><div><preallocate></div><div><put in some nonzeros></div>
<div><assemble></div><div><try to put in more nonzeros></div><div><br></div><div>This will not work since assembly squeezes out extra space. Why are you assembling in between?</div><div>If you need to clear buffers, you can just to MAT_ASSEMBLY_FLUSH.</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">I have it spit into phases where I set zeros in the non-zero pattern, then I come back and fill in entries in a bulk pass, and then do a second pass to clean up entries in special rows.<br>


Could someone clarify how this works. <br><span class="HOEnZb"><font color="#888888"><br>John<br>
</font></span></blockquote></div><br><br clear="all"><div><br></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>