@@ -1250,19 +1250,19 @@ end
1250
1250
ldiv! (A:: Bidiagonal , b:: AbstractVecOrMat ) = @inline ldiv! (b, A, b)
1251
1251
function ldiv! (c:: AbstractVecOrMat , A:: Bidiagonal , b:: AbstractVecOrMat )
1252
1252
require_one_based_indexing (c, A, b)
1253
- N = size (A, 2 )
1253
+ N = size (A, 1 )
1254
1254
mb, nb = size (b, 1 ), size (b, 2 )
1255
1255
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" )))
1257
1259
end
1258
1260
mc, nc = size (c, 1 ), size (c, 2 )
1259
1261
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) )" ))
1261
1263
end
1262
1264
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
1266
1266
1267
1267
zi = findfirst (iszero, A. dv)
1268
1268
isnothing (zi) || throw (SingularException (zi))
0 commit comments