The types Mat and Vec are actually pointers. The assignments are just pointer copies.<br><br> Matt<br><br><div class="gmail_quote">On Tue, Oct 20, 2009 at 7:27 PM, Umut Tabak <span dir="ltr"><<a href="mailto:u.tabak@tudelft.nl">u.tabak@tudelft.nl</a>></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;">Dear all,<br>
<br>
I tried to write a very primitive wrapper class for a linear equation solver, Ax=B. I am puzzled at a point and turned to the list. In my constructors, I use<br>
<br>
solveKxF::solveKxF(Mat &K, Vec &F, Vec &x)<br>
{ // assign<br>
A = K; B = F;<br>
VecDuplicate(x, &y);<br>
// set up the solver<br>
setUpSolver();<br>
}<br>
<br>
K and F are allocated before creating the object, however I do no allocation for A and B and PETSc automatically does the trick for me, right? (At least, it seems that way.) I just have the data members Mat A and Vec B which seems to work as above where the allocation is somewhere going behind the scenes in this assignment/initialization(which one is right term I am not sure).<br>
<br>
Best regards,<br><font color="#888888">
Umut<br>
<br>
<br>
<br>
<br>
<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>