From de56536d3c1ac2de220fed3f2a4c77cd05bbdd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Mon, 26 Feb 2024 14:32:44 +0100 Subject: [PATCH] sub! -> MA --- src/arithmetic.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arithmetic.jl b/src/arithmetic.jl index e8557b7..78a1d25 100644 --- a/src/arithmetic.jl +++ b/src/arithmetic.jl @@ -24,7 +24,7 @@ function _preallocate_output(X::AlgebraElement, Y::AlgebraElement, op) end Base.:+(X::AlgebraElement, Y::AlgebraElement) = MA.operate_to!(_preallocate_output(X, Y, +), +, X, Y) -Base.:-(X::AlgebraElement, Y::AlgebraElement) = sub!(_preallocate_output(X, Y, -), X, Y) +Base.:-(X::AlgebraElement, Y::AlgebraElement) = MA.operate_to!(_preallocate_output(X, Y, -), -, X, Y) Base.:*(X::AlgebraElement, Y::AlgebraElement) = MA.operate_to!(_preallocate_output(X, Y, *), *, X, Y) Base.:^(a::AlgebraElement, p::Integer) = Base.power_by_squaring(a, p) @@ -67,7 +67,7 @@ function MA.operate_to!(res::AlgebraElement, ::typeof(+), X::AlgebraElement, Y:: return res end -function sub!(res::AlgebraElement, X::AlgebraElement, Y::AlgebraElement) +function MA.operate_to!(res::AlgebraElement, ::typeof(-), X::AlgebraElement, Y::AlgebraElement) @assert parent(res) === parent(X) === parent(Y) MA.operate_to!(res, -, Y) MA.operate_to!(res, +, res, X)