Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/func.jl
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ isconvertible(L::FunctionOperator) = L.traits.isconvertible
isconstant(L::FunctionOperator) = L.traits.isconstant
has_adjoint(L::FunctionOperator) = !(L.op_adjoint isa Nothing)
has_mul(::FunctionOperator{iip}) where {iip} = true
has_mul!(::FunctionOperator{iip}) where {iip} = iip
has_mul!(::FunctionOperator{iip}) where {iip} = true
has_ldiv(L::FunctionOperator{iip}) where {iip} = !(L.op_inverse isa Nothing)
has_ldiv!(L::FunctionOperator{iip}) where {iip} = iip & !(L.op_inverse isa Nothing)

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

function LinearAlgebra.mul!(w::AbstractArray, L::FunctionOperator{false}, ::AbstractArray,
function LinearAlgebra.mul!(w::AbstractArray, L::FunctionOperator{false}, v::AbstractArray,
args...)
_sizecheck(L, v, w)
V, W, vec_output = _unvec(L, v, w)
Expand Down
8 changes: 4 additions & 4 deletions test/func.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ end
@test size(op1) == (NK, NK)
@test has_adjoint(op1)
@test has_mul(op1)
@test !has_mul!(op1)
@test has_mul!(op1)
@test has_ldiv(op1)
@test !has_ldiv!(op1)

Expand Down Expand Up @@ -167,7 +167,7 @@ end

# Test standard operator operations (from original test)
w = rand(N, K)
@test _mul(A, v) ≈ op1 * v ≈ mul!(w, op2, v)
@test _mul(A, v) ≈ op1 * v ≈ mul!(w, op2, v) ≈ mul!(w, op1, v)
w = rand(N, K)
@test _mul(A, v) ≈ op1(v, u, p, t) ≈ op2(v, u, p, t)
v = rand(N, K)
Expand Down Expand Up @@ -248,7 +248,7 @@ end
@test size(op1) == (N, N)
@test has_adjoint(op1)
@test has_mul(op1)
@test !has_mul!(op1)
@test has_mul!(op1)
@test has_ldiv(op1)
@test !has_ldiv!(op1)

Expand Down Expand Up @@ -405,4 +405,4 @@ end
@test res ≈ a1 * A * v1 + b1 * w1
@test res + res2 ≈ (a1 * A * v1 + b1 * w1) + (a2 * A * v2 + b2 * w2)
end
end
end
Loading