@@ -1250,19 +1250,19 @@ end
12501250ldiv! (A:: Bidiagonal , b:: AbstractVecOrMat ) = @inline ldiv! (b, A, b)
12511251function ldiv! (c:: AbstractVecOrMat , A:: Bidiagonal , b:: AbstractVecOrMat )
12521252 require_one_based_indexing (c, A, b)
1253- N = size (A, 2 )
1253+ N = size (A, 1 )
12541254 mb, nb = size (b, 1 ), size (b, 2 )
12551255 if N != mb
1256- throw (DimensionMismatch (lazy " second dimension of A, $N, does not match first dimension of b, $mb" ))
1256+ dimstr = b isa AbstractVector ? " length" : " first dimension"
1257+ throw (DimensionMismatch (LazyString (lazy " the first dimension of the Bidiagonal matrix, $N, " ,
1258+ lazy " does not match the $dimstr of the right-hand-side, $mb" )))
12571259 end
12581260 mc, nc = size (c, 1 ), size (c, 2 )
12591261 if mc != mb || nc != nb
1260- throw (DimensionMismatch (lazy " size of result, ($mc, $nc) , does not match the size of b, ($mb, $nb )" ))
1262+ throw (DimensionMismatch (lazy " size of result, $(size(c)) , does not match the size of b, $(size(b) )" ))
12611263 end
12621264
1263- if N == 0
1264- return copyto! (c, b)
1265- end
1265+ N == 0 && return c # in this case c and b are also empty
12661266
12671267 zi = findfirst (iszero, A. dv)
12681268 isnothing (zi) || throw (SingularException (zi))
0 commit comments