Skip to content

Commit f392b4a

Browse files
Merge pull request #283 from cvsvensson/master
mul! for out-of-place FunctionOperator
2 parents 41a4dc6 + 4420d4e commit f392b4a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/func.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ isconvertible(L::FunctionOperator) = L.traits.isconvertible
619619
isconstant(L::FunctionOperator) = L.traits.isconstant
620620
has_adjoint(L::FunctionOperator) = !(L.op_adjoint isa Nothing)
621621
has_mul(::FunctionOperator{iip}) where {iip} = true
622-
has_mul!(::FunctionOperator{iip}) where {iip} = iip
622+
has_mul!(::FunctionOperator{iip}) where {iip} = true
623623
has_ldiv(L::FunctionOperator{iip}) where {iip} = !(L.op_inverse isa Nothing)
624624
has_ldiv!(L::FunctionOperator{iip}) where {iip} = iip & !(L.op_inverse isa Nothing)
625625

@@ -772,7 +772,7 @@ function LinearAlgebra.mul!(w::AbstractArray, L::FunctionOperator{true}, v::Abst
772772
vec_output ? vec(W) : W
773773
end
774774

775-
function LinearAlgebra.mul!(w::AbstractArray, L::FunctionOperator{false}, ::AbstractArray,
775+
function LinearAlgebra.mul!(w::AbstractArray, L::FunctionOperator{false}, v::AbstractArray,
776776
args...)
777777
_sizecheck(L, v, w)
778778
V, W, vec_output = _unvec(L, v, w)

test/func.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ end
133133
@test size(op1) == (NK, NK)
134134
@test has_adjoint(op1)
135135
@test has_mul(op1)
136-
@test !has_mul!(op1)
136+
@test has_mul!(op1)
137137
@test has_ldiv(op1)
138138
@test !has_ldiv!(op1)
139139

@@ -167,7 +167,7 @@ end
167167

168168
# Test standard operator operations (from original test)
169169
w = rand(N, K)
170-
@test _mul(A, v) op1 * v mul!(w, op2, v)
170+
@test _mul(A, v) op1 * v mul!(w, op2, v) mul!(w, op1, v)
171171
w = rand(N, K)
172172
@test _mul(A, v) op1(v, u, p, t) op2(v, u, p, t)
173173
v = rand(N, K)
@@ -248,7 +248,7 @@ end
248248
@test size(op1) == (N, N)
249249
@test has_adjoint(op1)
250250
@test has_mul(op1)
251-
@test !has_mul!(op1)
251+
@test has_mul!(op1)
252252
@test has_ldiv(op1)
253253
@test !has_ldiv!(op1)
254254

@@ -405,4 +405,4 @@ end
405405
@test res a1 * A * v1 + b1 * w1
406406
@test res + res2 (a1 * A * v1 + b1 * w1) + (a2 * A * v2 + b2 * w2)
407407
end
408-
end
408+
end

0 commit comments

Comments
 (0)