<div class="gmail_quote">On Thu, Jun 16, 2011 at 11:40, Pierre-Yves Aquilanti <span dir="ltr">&lt;<a href="mailto:sperif@gmail.com">sperif@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":55r">MatCreateSeqAIJ(PETSC_COMM_WORLD,(*nb_eigen_all)+1,(*nb_eigen_all)+1,0,PETSC_NULL,&amp;MM);<br>    MatSetFromOptions(MM);<br><br><br>        for(j=0;j&lt;=*nb_eigen_all;j++)<br>             for(i=0;i&lt;j;i++){<br>
                MatSetValue(MM,i,j,(PetscReal)mm_tmp[i][j],INSERT_VALUES);<br>

                MatSetValue(MM,j,i,(PetscReal)mm_tmp[i][j],INSERT_VALUES);</div></blockquote></div><br><div>Do you intend to have 0 on the diagonal?</div><div><br></div><div>The rest of your code looks okay to me, but if you problem really is dense, then you may as well use a dense matrix format, see MatCreateSeqDense().</div>
<div><br></div><div>Could you send a test case so that we can reproduce?</div>