Skip to content

Commit

Permalink
Fix some recent matrix methods
Browse files Browse the repository at this point in the history
  • Loading branch information
thofma committed Dec 5, 2023
1 parent 9dd2219 commit 3509278
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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.34.2"
version = "0.34.3"

[deps]
GroupsCore = "d5909c97-4eac-4ecc-a3dc-fdd0858a4120"
Expand Down
6 changes: 4 additions & 2 deletions src/generic/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,19 @@ function matrix_space(R::AbstractAlgebra.NCRing, r::Int, c::Int; cached::Bool =
return MatSpace{T}(R, r, c)
end

function AbstractAlgebra.sub!(A::MatElem{T}, B::MatElem{T}, C::MatElem{T}) where T
function AbstractAlgebra.sub!(A::Mat{T}, B::Mat{T}, C::Mat{T}) where T
A.entries.= B.entries .- C.entries
return A
end

#since type(view(MatElem{T})) != MatElem{T} which breaks
# sub!(A::T, B::T, C::T) where T in AA
function AbstractAlgebra.mul!(A::MatElem{T}, B::MatElem{T}, C::MatElem{T}, f::Bool = false) where T
function AbstractAlgebra.mul!(A::Mat{T}, B::Mat{T}, C::Mat{T}, f::Bool = false) where T
if f
A.entries .+= (B * C).entries
else
A.entries .= (B * C).entries
end
return A
end

0 comments on commit 3509278

Please sign in to comment.