-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Absolute and relative tolerance for linear solvers #280
Conversation
…instead of RHS) as suggested by @haampie
…sidual instead of RHS)
I made all the changes to the iterative solvers for "simple" linear problems. Since the solvers for least-squares problems use a different setup of tolerances, I didn't adapt them. It would be nice to have another round of reviews to improve this PR 🙂 |
Can one express the logic/stopping criteria with |
norm(x-y) <= max(atol, rtol*max(norm(x), norm(y))) Our stopping criterion is norm(residual) <= max(abstol, reltol * initial_residual_norm) Hence, I don't see a possibility to do that. |
I see, thanks. |
@haampie Can we merge this? The decreased coverage is only caused by the new depwarns. |
Hi @ranocha , I haven't had the chance to review yet. Tomorrow I can do that |
Thank you! |
This PR adds keyword arguments
abstol
andreltol
to iterative solvers for linear system and deprecates the former keywordtol
(which is nowreltol
).Since this is my first contribution to IterativeSolvers.jl, I would like to get some feedback on this work to improve this PR. Thanks!
If this approach is acceptable, I will continue to work on the other iterative solvers and adapt them accordingly.
By the way, I noticed that CG doesn't respect the stopping criterion described in the docs, see also #244. I think it would be good to fix this (as described in my comment in
cg.jl
).Closes #207 by adding the keyword argument
abstol
.Closes #244 by fixing the convergence criterion for CG (
reltol
should be relative to the initial residual instead of the RHSb
).