Skip to content

Commit c1aef8c

Browse files
committed
Skip conj.(v) for real-valued vectors
This avoids making an unnecessary copy
1 parent 40edb65 commit c1aef8c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/adjtrans.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,18 @@ function mul!(
238238
conj!(res)
239239
end
240240

241+
function mul!(
242+
res::AbstractVector,
243+
op::ConjugateLinearOperator{T, S},
244+
v::AbstractVector{<:Real},
245+
α,
246+
β,
247+
) where {T, S}
248+
p = op.parent
249+
mul!(res, p, v, α, β) # this gets called for A'*v when v is real, so we can skip the conjugation
250+
conj!(res)
251+
end
252+
241253
function mul!(
242254
res::AbstractMatrix,
243255
op::ConjugateLinearOperator{T, S},

0 commit comments

Comments
 (0)