Skip to content

Commit

Permalink
Update sparsevector.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Jan 9, 2025
1 parent 1b990c1 commit 2e13389
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/sparsevector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1243,16 +1243,16 @@ function hvcat_internal(rows::Tuple{Vararg{Int}}, X1::_SparseConcatGroup, X::_Sp
if anysparse(X1) || anysparse(X...)
vcat(_hvcat_rows(rows, X1, X...)...)
else
if X1 isa Number && all(Base.Fix2(isa, Number), X)
# Needed to match error type with Base Julia. See https://github.com/JuliaLang/julia/pull/56543#issuecomment-2508637550
matrix_len = if length(rows) == 0
0
else
length(rows) * rows[1]
end
if matrix_len != 1 + length(X)
throw(ArgumentError("argument count does not match specified shape (expected $matrix_len, got $(1+length(X)))"))
end
if X1 isa Number && all(Base.Fix2(isa, Number), X)
# Needed to match error type with Base Julia. See https://github.com/JuliaLang/julia/pull/56543#issuecomment-2508637550
matrix_len = if length(rows) == 0
0
else
length(rows) * rows[1]
end
if matrix_len != 1 + length(X)
throw(ArgumentError("argument count does not match specified shape (expected $matrix_len, got $(1+length(X)))"))
end
end
Base.typed_hvcat(Base.promote_eltypeof(X1, X...), rows, X1, X...)
end
Expand Down

0 comments on commit 2e13389

Please sign in to comment.