Skip to content

Commit b8d4e60

Browse files
Merge pull request #103 from SciML/revert-100-vp-ldiv-of-invpreconditioner
Revert "avoid ldiv of invpreconditioner"
2 parents 5791656 + 4895f84 commit b8d4e60

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/preconditioners.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ struct InvPreconditioner{T}
2626
end
2727

2828
Base.eltype(A::InvPreconditioner) = Base.eltype(A.P)
29+
LinearAlgebra.ldiv!(A::InvPreconditioner, x) = mul!(x, A.P, x)
2930
LinearAlgebra.ldiv!(y, A::InvPreconditioner, x) = mul!(y, A.P, x)
3031
LinearAlgebra.mul!(y, A::InvPreconditioner, x) = ldiv!(y, A.P, x)

test/basictests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ end
208208
mul!(y, Pl, x); @test y s .* x
209209
mul!(y, Pr, x); @test y s .\ x
210210

211+
y .= x; ldiv!(Pl, x); @test x s .\ y
212+
y .= x; ldiv!(Pr, x); @test x s .* y
213+
211214
ldiv!(y, Pl, x); @test y s .\ x
212215
ldiv!(y, Pr, x); @test y s .* x
213216
end

0 commit comments

Comments
 (0)