On Sun, 31 May 2020 at 02:26, Mills, Richard Tran via petsc-dev < [email protected]> wrote:
> 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!) > > Just FYI, this is how NumPy handles it: In [1]: import numpy as np In [2]: A = np.empty([3,0]) In [3]: B = np.empty([0,8]) In [4]: C = np.dot(A,B) In [5]: C.shape Out[5]: (3, 8) If we do not follow these rules, it will bite us in the future. -- Lisandro Dalcin ============ Research Scientist Extreme Computing Research Center (ECRC) King Abdullah University of Science and Technology (KAUST) http://ecrc.kaust.edu.sa/
