Dear Barry:<br><br>Regarding my method,<br><br><br><br><br><br><br><div><span class="gmail_quote">On 4/18/08, <b class="gmail_sendername">Barry Smith</b> <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
<br> For dense matrices only.<br><br> You can call MatGetArray() on A and then do direct copies of the arrays.<br><span class="sg"><br> Barry</span><div><span class="e" id="q_1196474ed55bd296_2"><br><br> On Apr 18, 2008, at 8:40 PM, Yujie wrote:<br>
<br><blockquote class="gmail_quote" style="border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex"> Hi, everyone<br><br> Assuming there are A1(M*N) A2(M*N) A3(M*N), I want to get<br>
A1<br> A=A2<br> A3<br><br> My method is<br><br> MatGetArray(A1,&a1);<br> MatSetValues(A,a1);<br> MatGetArray(A2,&a2);<br> MatSetValues(A,a2);<br> MatGetArray(A3,&a3);<br> MatSetValues(A,a3);<br><br>
Is there any better methods for it? The above codes are slow. thanks a lot.<br><br> Regards,<br> Yujie<br><br><br></blockquote><br></span></div></blockquote></div><br>