Skip to content

Commit

Permalink
Fix ScaledOperator concretize!
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-arya committed Jul 21, 2023
1 parent 958e00a commit 36d2ef2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ has_ldiv(L::ScaledOperator) = has_ldiv(L.L) & !iszero(L.λ)
has_ldiv!(L::ScaledOperator) = has_ldiv!(L.L) & !iszero(L.λ)

function concretize!(A, L::ScaledOperator{T}, α, β) where {T}
concretize!(A, L.L, L.λ * α, β)
concretize!(A, L.L, convert(Number, L.λ) * α, β)
end

function cache_internals(L::ScaledOperator, u::AbstractVecOrMat)
Expand Down
2 changes: 1 addition & 1 deletion test/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ end

@testset "ConcretizedOperator" begin
A = rand(2, 2); B = rand(2, 2);
L = MatrixOperator(A; update_func=(u,p,t)->t * A) + MatrixOperator(B; update_func=(u,p,t)->t * B)
L = MatrixOperator(A; update_func=(u,p,t)->t * A) + 2 * MatrixOperator(B; update_func=(u,p,t)->t * B)
C = ConcretizedOperator(L)
v = rand(2)
C * v L * v
Expand Down

0 comments on commit 36d2ef2

Please sign in to comment.