IterativeSolvers.jl
                                
                                
                                
                                    IterativeSolvers.jl copied to clipboard
                            
                            
                            
                        Return CGResult from cg and allow absolute tol
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 Report
Merging #238 into master will decrease coverage by
0.48%. The diff coverage is30.76%.
@@            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%) | 
:arrow_down: | 
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 91cac26...8c03b4b. Read the comment docs.
I believe this is ready for a first review.
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?)
I don't mind getting rid of tol. Not big on the underscore either.
Good. Then I think introducing abstol and reltol and deprecating the tol keyword is the best way forward.
bump
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.
#280 is merged now