Skip to content
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

Return CGResult from cg and allow absolute tol #238

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mohamed82008
Copy link
Member

This fixes #236. I also allowed passing absolute tolerance as opposed to just a relative one. Since it makes sense for the residual to be <= the tolerance, the absolute tolerance is the one that should be returned in the CGResult. And it would be weird if I pass tol = .. to cg and then I see a different tolerance printed in the result.

@codecov-io
Copy link

codecov-io commented Jan 15, 2019

Codecov Report

Merging #238 into master will decrease coverage by 0.48%.
The diff coverage is 30.76%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #238      +/-   ##
==========================================
- Coverage   56.03%   55.54%   -0.49%     
==========================================
  Files          17       17              
  Lines        1740     1757      +17     
==========================================
+ Hits          975      976       +1     
- Misses        765      781      +16
Impacted Files Coverage Δ
src/cg.jl 52.5% <30.76%> (-12.58%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91cac26...8c03b4b. Read the comment docs.

@mohamed82008
Copy link
Member Author

I believe this is ready for a first review.

@pkofod
Copy link

pkofod commented Jul 25, 2019

How do you plan to deprecate tol? I think it'd be better to add an abs_tol and rel_tol, have tol default to nothing and throw a deprecation warning if tol is actually set.

(I came here because I wanted to use abs_tol in gmres for a inexact newton method, so I'd love if all methods got this abs_/rel_tol separation. Isn't base using abstol and reltol btw?)

@mohamed82008
Copy link
Member Author

I don't mind getting rid of tol. Not big on the underscore either.

@pkofod
Copy link

pkofod commented Jul 31, 2019

Good. Then I think introducing abstol and reltol and deprecating the tol keyword is the best way forward.

@chriscoey
Copy link

bump

@ranocha
Copy link
Member

ranocha commented Dec 7, 2020

I'm working on introducing keyword arguments abstol and reltol in #280 with a proper deprecation of tol. Once that's settled, this approach to change the return type would be nice to consider next.

@mschauer
Copy link
Member

#280 is merged now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CGResult that saves info
6 participants