<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:10px;"><div><font size="3">Hi, </font></div><div><font size="3"><br></font></div><div><font size="3">How can I preallocate space for matrices (some symmetric, others asymmetric) if I have the global number of nonzeros (NNZ) but not the number of <span>nonzeros per row? I could compute the NNZ for the upper or lower part separately if this would be useful for symmetric matrices.<br></span></font></div><div><font size="3"><span><br></span></font></div><div><font size="3"><span><span>I create the matrix this way:</span></span></font></div><div><font size="3"><span><span><br></span></span></font></div><div><font size="3"><span><span><span> MatCreate(PETSC_COMM_WORLD, &M);<br> MatSetSizes(M, PETSC_DECIDE, PETSC_DECIDE, N, N);<br> MatSetFromOptions(M);</span></span></span></font></div><div><font size="3"><span><span><br></span></span></font></div><div><font size="3"><span><span>Klaus<br></span><br></span></font></div><div><font size="3"><span><br></span></font></div><div><font size="3"><span><br></span></font><br></div></div></body></html>