Sorry, I made a mistake, it should be A is sparse matrix and B is dense matrix. <br><br>Yujie<br><br><div class="gmail_quote">On Sun, Feb 21, 2010 at 2:44 PM, Yujie <span dir="ltr"><<a href="mailto:recrusader@gmail.com">recrusader@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I need do it for many. Actually, we don't consider a vector. Generally, if A is dense matrix (nonzero entries) and B is sparse matrix, MatGetRow() doesn't work when doing A.*B or A./B directly, right?<br>
Thanks a lot.<br>
<br>Regards,<br><font color="#888888">Yujie</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Sun, Feb 21, 2010 at 2:41 PM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org" target="_blank">jed@59a2.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>On Sun, 21 Feb 2010 14:33:23 -0600, Yujie <<a href="mailto:recrusader@gmail.com" target="_blank">recrusader@gmail.com</a>> wrote:<br>
> Thanks very much, Jed.<br>
> I have a vector (V) and a matrix (A),<br>
> I want to do Row_i_A.*V or Row_i_A./V (Row_i_A are the rows of A). However,<br>
> V has different format with the rows of A.<br>
<br>
</div>You need to do this for a small number of rows (values of i), or for<br>
many? Since vectors are dense, and since MatGetValues only provides the<br>
local part, this is not scalable.<br>
<br>
What is the problem you are trying to solve with this algebraic<br>
manipulation? There is probably a scalable way to formulate the<br>
higher-level objective to avoid these shenanigans.<br>
<font color="#888888"><br>
Jed<br>
</font></blockquote></div><br>
</div></div></blockquote></div><br>