<p>No, its not okay.</p>
<p>I think MatGetArray needs to be removed. Pretty much any use of it is wrong. It is not even the right thing for dense matrices because they should be distributed differently than PETSc does now.</p>
<div class="gmail_quote">On May 25, 2012 8:44 AM, "Hui Zhang" <<a href="mailto:mike.hui.zhang@hotmail.com">mike.hui.zhang@hotmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A new question: can I use MatSetValues in the following way?<br>
<br>
MatGetArray(A,&a);<br>
a[0]= 1;<br>
MatSetValues(A,...);    /* in particular, is this allowed inside GetArray/RestoreArray? */<br>
MatRestoreArray(A,&a);<br>
<br>
Thanks!<br>
Hui<br>
<br>
On May 14, 2012, at 2:29 PM, Barry Smith wrote:<br>
<br>
><br>
>   If B is 50% dense then store it in a dense format. It will be much faster and the extra memory is minimal.  Even 30% dense.<br>
><br>
>   Barry<br>
><br>
> On May 14, 2012, at 5:13 AM, Hui Zhang wrote:<br>
><br>
>> I have two matrices A and B stored in sparse format.  While A is really sparse, B is relatively<br>
>> dense (say non-zeros entries about 50%).  Now to multiply the two matrices, among<br>
>><br>
>>     A*B<br>
>> or<br>
>>    (B^T * A^T)^T<br>
>><br>
>> which is better, or no big difference ?<br>
>><br>
>> Thanks!<br>
>><br>
><br>
><br>
<br>
</blockquote></div>