Skip to content

Commit

Permalink
Fix one diagonal_matrix dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Sep 26, 2023
1 parent 5891cfa commit 842bffa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "AbstractAlgebra"
uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d"
version = "0.32.2"
version = "0.32.3"

[deps]
GroupsCore = "d5909c97-4eac-4ecc-a3dc-fdd0858a4120"
Expand Down
6 changes: 5 additions & 1 deletion src/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7019,7 +7019,11 @@ function diagonal_matrix(x::T, xs::T...) where {T<:MatElem}
end

function diagonal_matrix(R::NCRing, V::Vector{<:MatElem})
return block_diagonal_matrix(map(x -> change_base_ring(R, x), V))
if length(V) == 0
return zero_matrix(R, 0, 0)

Check warning on line 7023 in src/Matrix.jl

View check run for this annotation

Codecov / codecov/patch

src/Matrix.jl#L7022-L7023

Added lines #L7022 - L7023 were not covered by tests
else
return block_diagonal_matrix(map(x -> change_base_ring(R, x), V))

Check warning on line 7025 in src/Matrix.jl

View check run for this annotation

Codecov / codecov/patch

src/Matrix.jl#L7025

Added line #L7025 was not covered by tests
end
end


Expand Down

0 comments on commit 842bffa

Please sign in to comment.