JuliaLinearAlgebra / IterativeSolvers.jl

Iterative algorithms for solving linear systems, eigensystems, and singular value problems
MIT License
399 stars 105 forks source link

Error when initializing idrs! from [very near] solution #222

Closed UserQuestions closed 5 years ago

UserQuestions commented 6 years ago

When initializing idrs! from near to the solution, I receive an error that res is not defined. In looking closer, this is likely because res is referenced only on line 88 of idrs.jl and is not created anywhere. Line 88 is only called if normR<=tol, which is commented to occur when the "initial guess is a good enough solution." Replacing the return value in this case to X, log seems to work fine for me, though this may be bad/breaking for other reasons. I thought I would report this here in case this or another solution would be an easy fix. Thank you for putting this package together!

mschauer commented 6 years ago

Thank you, this bug looks like an oversight when introducing a new mechanism to save the iteration history, https://github.com/JuliaMath/IterativeSolvers.jl/commit/0c78f030d4015f31e950339e622f55d036235564#diff-6623a48145b6c4f92eec15da7d571fa4

UserQuestions commented 6 years ago

Great to hear! Do you know what the second output of the return value should be in such a case?