On Fri, Oct 14, 2011 at 1:57 AM, Hafedh BEN-HADJ-ALI <span dir="ltr">&lt;<a href="mailto:hafedh.ben-hadj-ali@total.com">hafedh.ben-hadj-ali@total.com</a>&gt;</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;">
<div lang="FR" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">I’m a new user of PETSC and I would like to test different linear solvers on some normal equations derived from a least squares problem.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">I have already a routine that build a sparse distributed (parallel ) matrix in coordinate COO format and would like to not change this part of matrix formation since it is a little bit complicated. <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">What is the simplest way to link with PETSC routines ? Is it possible to use the distributed matrix blocks in the COO format ? Is there any conversion routine to put the COO format in CSR format ? Is it possible to use “MatCreateMPIAIJWithArrays” in that case or is there any more appropriate format ?</span></p>
</div></div></blockquote><div><br></div><div>The easiest, although not most efficient way to do this is to call MatSetValues() for each (i,j,v) in the COO structure. Try this</div><div>first and time it.</div><div><br></div>
<div>  Thanks,</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;"><div lang="FR" link="blue" vlink="purple"><div><p class="MsoNormal">
 </p><p class="MsoNormal"><span lang="EN-US">Regards,<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">HB<u></u><u></u></span></p></div></div></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>