Fix multiplication between matrices of dimension 0.

Fix #644
This commit is contained in:
sebcrozet 2019-09-01 18:26:25 +02:00 committed by Sébastien Crozet
parent d9a9c60602
commit 6fa096e199
1 changed files with 7 additions and 0 deletions

View File

@ -565,6 +565,7 @@ where
); );
if ncols2 == 0 { if ncols2 == 0 {
self.fill(N::zero());
return; return;
} }
@ -1006,6 +1007,12 @@ where N: Scalar + Zero + ClosedAdd + ClosedMul
"gemm: dimensions mismatch for addition." "gemm: dimensions mismatch for addition."
); );
if a.ncols() == 0 {
self.fill(N::zero());
return;
}
// We assume large matrices will be Dynamic but small matrices static. // We assume large matrices will be Dynamic but small matrices static.
// We could use matrixmultiply for large statically-sized matrices but the performance // We could use matrixmultiply for large statically-sized matrices but the performance
// threshold to activate it would be different from SMALL_DIM because our code optimizes // threshold to activate it would be different from SMALL_DIM because our code optimizes