<div class="gmail_quote">On Wed, Nov 9, 2011 at 13:25, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">knepley@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 id=":2cc">The simpler answer is yes, I always initialize the Mat or Vec to zero when I use it. Even if its initialized when created,<div>I almost always get something from DMGetGlobalVector() etc. which could have been used before.</div>
</div></blockquote></div><br><div>Since we keep track of access that could mutate, it would be easy to make VecZeroEntries a no-op when the array is already zeroed. (In debug mode, it could actually check that the array is still zero.)</div>
<div><br></div><div>I agree with Matt that you should call VecZeroEntries() when you want to rely on the Vec being zeroed.</div>