1) I guarantee you the copy takes no time. Measure it.<br><br>2) If you are worried about memory, PETSc Vec and dense<br>     matrix can have the same layout and share a pointer.<br><br>  Matt<br><br><div class="gmail_quote">
On Sun, May 3, 2009 at 4:42 AM, liu chang <span dir="ltr">&lt;<a href="mailto:liuchangjohn@gmail.com">liuchangjohn@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m using TAO&#39;s LMVM method for optimize a dense matrix, but TAO<br>
expects its input as a Vec. Do I have to copy the content back and<br>
forth between a Mat and a Vec? Can I somehow cast the Mat into a Vec?<br>
<br>
Both the Mat and the Vec are distributed evenly across the processes<br>
so ideally there doesn&#39;t need to be any copying at all.<br>
<br>
Thanks,<br>
<font color="#888888">Liu Chang<br>
</font></blockquote></div><br><br clear="all"><br>-- <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>