<div class="gmail_quote">On Fri, Feb 10, 2012 at 00:05, Dmitry Karpeev <span dir="ltr"><<a href="mailto:karpeev@mcs.anl.gov">karpeev@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I don't think so.  Preallocating doesn't set any values and seems to leave the matrix marked !assembled.</div>

<div>MatDuplicate for such a matrix will fail.  Assemblying it before setting values (just to force an assembled flag)</div><div>will squeeze out the extra values, won't it?  I think it would just be reasonable to allow to duplicate unassembled</div>


<div>matrices, or, better yet, have a matrix be "assembled" by default until MatSetValues has been called.</div><div>But I'm not sure whether either solution will break something else.</div></blockquote></div>
<br><div>Are you calling DMSetMatrixPreallocateOnly()?</div>