Skip to content

Commit

Permalink
Merge pull request #302 from h-larsson/dbg
Browse files Browse the repository at this point in the history
IDRS: Move preconditioning
  • Loading branch information
mschauer authored Oct 29, 2021
2 parents 02b577b + 9426d0a commit 6af7d5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/idrs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ function idrs_method!(log::ConvergenceHistory, X, A, C::T,
Q .+= c[i-k+1] .* U[i]
end

# Preconditioning
ldiv!(Pl, V)

# Compute new U[:,k] and G[:,k], G[:,k] is in space G_j
V .= R .- V

# Preconditioning
ldiv!(Pl, V)

U[k] .= Q .+ om .* V
mul!(G[k], A, U[k])

Expand Down
4 changes: 2 additions & 2 deletions test/idrs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ end
@test history.isconverged
@test norm(A * x - b) / norm(b) reltol

Apre = lu(A)
Apre = lu(droptol!(copy(A), 0.1)) # inexact preconditioner
xpre, historypre = idrs(A, b, Pl = Apre, log=true)
@test historypre.isconverged
@test norm(A * xpre - b) / norm(b) reltol

@test isapprox(x, xpre, rtol = 1e-3)
@test historypre.iters < history.iters
@test historypre.iters < 0.5history.iters

end

Expand Down

0 comments on commit 6af7d5e

Please sign in to comment.