On Sun, May 3, 2009 at 12:59 PM, liu chang <span dir="ltr"><<a href="mailto:liuchangjohn@gmail.com">liuchangjohn@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Matt.<br>
<div class="im"><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>
</div>That's the ideal solution but how can I do that? I can't find a way to<br>
create a Mat or Vec from an existing pointer.</blockquote><div><br><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Vec/VecCreateMPIWithArray.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Vec/VecCreateMPIWithArray.html</a><br>
<br><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatCreateMPIDense.html">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatCreateMPIDense.html</a><br>
<br> Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Regards,<br>
<font color="#888888">Liu Chang<br>
</font><div><div></div><div class="h5"><br>
> On Sun, May 3, 2009 at 4:42 AM, liu chang <<a href="mailto:liuchangjohn@gmail.com">liuchangjohn@gmail.com</a>> wrote:<br>
>><br>
>> I'm using TAO'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't need to be any copying at all.<br>
>><br>
>> Thanks,<br>
>> Liu Chang<br>
><br>
><br>
><br>
> --<br>
> What most experimenters take for granted before they begin their experiments<br>
> is infinitely more interesting than any results to which their experiments<br>
> lead.<br>
> -- Norbert Wiener<br>
><br>
</div></div></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>