From c7804d93e395c9a77fb7c0744116b0da23a6c962 Mon Sep 17 00:00:00 2001 From: Tommy Hofmann Date: Tue, 5 Dec 2023 18:12:17 +0100 Subject: [PATCH] Fix some recent matrix methods (#1516) --- Project.toml | 2 +- src/generic/Matrix.jl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index cd42b8f179..74d1096a41 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/generic/Matrix.jl b/src/generic/Matrix.jl index 71a70c697b..edba7bf616 100644 --- a/src/generic/Matrix.jl +++ b/src/generic/Matrix.jl @@ -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