<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 31 May 2020 at 02:26, Mills, Richard Tran via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
Thanks for the replies, everyone. It suppose is not actually that hard for me to handle these dimensions properly -- I just hadn't personally encountered or thought much about when such operations with empty matrices might arise, and was initially puzzled about
 what multiplication by an "empty" matrix even means. I think I see now why I need to put in the work to handle these cases properly. (Sure wish that MKL could just do it, though!)<br>
<br></div></blockquote><div><br></div><div>Just FYI, this is how NumPy handles it:</div><div><br></div><div>In [1]: import numpy as np                                                      <br><br>In [2]: A = np.empty([3,0])                                                     <br><br>In [3]: B = np.empty([0,8])                                                     <br><br>In [4]: C = np.dot(A,B)                                                         <br><br>In [5]: C.shape                                                                 <br>Out[5]: (3, 8)<br></div><div><br></div><div>If we do not follow these rules, it will bite us in the future.</div><div><br></div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div></div>