@@ -535,12 +535,18 @@ function rmul!(B::Bidiagonal, D::Diagonal)
535
535
end
536
536
537
537
@noinline function check_A_mul_B!_sizes ((mC, nC):: NTuple{2,Integer} , (mA, nA):: NTuple{2,Integer} , (mB, nB):: NTuple{2,Integer} )
538
+ # check for matching sizes in one column of B and C
539
+ check_A_mul_B!_sizes ((mC,), (mA, nA), (mB,))
540
+ # ensure that the number of columns in B and C match
541
+ if nB != nC
542
+ throw (DimensionMismatch (lazy " second dimension of output C, $nC, and second dimension of B, $nB, must match" ))
543
+ end
544
+ end
545
+ @noinline function check_A_mul_B!_sizes ((mC,):: Tuple{Integer} , (mA, nA):: NTuple{2,Integer} , (mB,):: Tuple{Integer} )
538
546
if mA != mC
539
547
throw (DimensionMismatch (lazy " first dimension of A, $mA, and first dimension of output C, $mC, must match" ))
540
548
elseif nA != mB
541
549
throw (DimensionMismatch (lazy " second dimension of A, $nA, and first dimension of B, $mB, must match" ))
542
- elseif nB != nC
543
- throw (DimensionMismatch (lazy " second dimension of output C, $nC, and second dimension of B, $nB, must match" ))
544
550
end
545
551
end
546
552
@@ -563,6 +569,7 @@ _mul!(C::AbstractMatrix, A::BiTriSym, B::TriSym, _add::MulAddMul) =
563
569
_mul! (C:: AbstractMatrix , A:: BiTriSym , B:: Bidiagonal , _add:: MulAddMul ) =
564
570
_bibimul! (C, A, B, _add)
565
571
function _bibimul! (C, A, B, _add)
572
+ require_one_based_indexing (C)
566
573
check_A_mul_B!_sizes (size (C), size (A), size (B))
567
574
n = size (A,1 )
568
575
if n <= 3
733
740
734
741
function _mul! (C:: AbstractVecOrMat , A:: BiTriSym , B:: AbstractVecOrMat , _add:: MulAddMul )
735
742
require_one_based_indexing (C, B)
743
+ check_A_mul_B!_sizes (size (C), size (A), size (B))
736
744
nA = size (A,1 )
737
745
nB = size (B,2 )
738
- if ! (size (C,1 ) == size (B,1 ) == nA)
739
- throw (DimensionMismatch (lazy " A has first dimension $nA, B has $(size(B,1)), C has $(size(C,1)) but all must match" ))
740
- end
741
- if size (C,2 ) != nB
742
- throw (DimensionMismatch (lazy " A has second dimension $nA, B has $(size(B,2)), C has $(size(C,2)) but all must match" ))
743
- end
744
746
iszero (nA) && return C
745
747
iszero (_add. alpha) && return _rmul_or_fill! (C, _add. beta)
746
748
if nA <= 3
0 commit comments