-
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
adding type to reserve! in most solvers #263
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #263 +/- ##
==========================================
- Coverage 90.61% 90.56% -0.06%
==========================================
Files 18 18
Lines 1130 1124 -6
==========================================
- Hits 1024 1018 -6
Misses 106 106
Continue to review full report at Codecov.
|
Out of curiosity, how did you run into this? |
I did tests with an instrumented type that does not implement silent conversion to Float64 to avoid bugs due to unseen conversions. |
Bump. This looks like a fix that would be nice to have in IterativeSolvers.jl. |
What do you think of this, @haampie? |
When storing a log, solvers reserve memory with
reserve!
. By default no type information is passed to this method which, then, converts the history into Float64.This is not the expected behaviour when using non traditional types (for instrumentation purpose) and can lead to problems if their silent convertion into Float64 is not detected by the programmer.
Thus I replaced several occurences of
reserve!(history, ...
withreserve!(typeof(tol), history, ...
.I did not modify
lsqr.jl
,lsmr.jl
andsvdl.jl
as the modification was less straightforward but they should probably be modified in the same way.(overall I think that
reserve!
should always stipulate the expected type to avoid regression on this issue)