Skip to content

Commit c14d687

Browse files
authored
extend to non-commutative numbers and adjoints
1 parent b951b92 commit c14d687

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/adjtrans.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,10 @@ function _dot_nonrecursive(u, v)
514514
end
515515

516516
# we use (n A^T) = (A n)^T, which holds if the product of n and the elements of A is commutative
517-
rmul!(X::AdjOrTrans{<:Union{Real,Complex}}, s::Union{Real,Complex}) = (lmul!(wrapperop(X)(s), parent(X)); X)
518-
lmul!(s::Union{Real,Complex}, X::AdjOrTrans{<:Union{Real,Complex}}) = (rmul!(parent(X), wrapperop(X)(s)); X)
517+
rmul!(X::Transpose{<:Union{Real,Complex}}, s::Union{Real,Complex}) = (lmul!(s, parent(X)); X)
518+
rmul!(X::Adjoint, s::Number) = (lmul!(s', parent(X)); X)
519+
lmul!(s::Union{Real,Complex}, X::Transpose{<:Union{Real,Complex}}) = (rmul!(parent(X), s); X)
520+
lmul!(s::Number, X::Adjoint) = (rmul!(parent(X), s'); X)
519521

520522
# Adjoint/Transpose-vector * vector
521523
*(u::AdjointAbsVec{<:Number}, v::AbstractVector{<:Number}) = dot(u.parent, v)

0 commit comments

Comments
 (0)