Skip to content

Commit

Permalink
Fix MatrixOperator concretize!
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-arya committed Jul 21, 2023
1 parent 1fb11e2 commit 958e00a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function concretize!(A, L::AbstractMatrix, α, β)
end

function concretize!(A, L::Union{Factorization, AbstractSciMLOperator}, α, β)
@warn """using concretize-based fallback for concretize!"""
@warn """using concretize-based fallback for concretize! for $(typeof(L))"""

Check warning on line 324 in src/interface.jl

View check run for this annotation

Codecov / codecov/patch

src/interface.jl#L323-L324

Added lines #L323 - L324 were not covered by tests
# TODO: could also use a mul! based fallback on the unit vectors
concretize!(A, concretize(L), α, β)

Check warning on line 326 in src/interface.jl

View check run for this annotation

Codecov / codecov/patch

src/interface.jl#L326

Added line #L326 was not covered by tests
end
Expand Down
4 changes: 2 additions & 2 deletions src/matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ function update_coefficients!(L::MatrixOperator, u, p, t; kwargs...)
L.update_func!(L.A, u, p, t; kwargs...)
end

function concretize!(A, L::MatrixOperator)
return concretize!(A, L.A)
function concretize!(A, L::MatrixOperator, α, β)
return concretize!(A, L.A, α, β)
end

SparseArrays.sparse(L::MatrixOperator) = sparse(L.A)
Expand Down
2 changes: 2 additions & 0 deletions test/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ end
C = ConcretizedOperator(L)
v = rand(2)
C * v L * v
@test C.A convert(AbstractMatrix, L)
update_coefficients!(C, nothing, nothing, 2.0)
C * v L * v
@test C.A convert(AbstractMatrix, L)
end
#

0 comments on commit 958e00a

Please sign in to comment.