JuliaLinearAlgebra / IterativeSolvers.jl

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

Making iterative solvers resumable #291

Open wsshin opened 3 years ago

wsshin commented 3 years ago

There are cases where iterative solvers finish prematurely by hitting maxiter, before the convergence criterion ‖rₙ‖ = ‖b - A xₙ‖ ≤ tol is met. In that case, it is useful to have the capability to resume the solvers from the point they finished.

Resuming iterative solvers requires not only the last approximate solution xₙ, but also other state variables. For example in CG, these state variables are the last residual vector rₙ and the last search direction vector pₙ. Luckily, these state variables are already stored in CGStateVariables, but currently the code is not written to resume the CG algorithm from the state stored in the passed statevars::CGStateVariables.

I have implemented the resumability in cg.jl and it works as expected. Before posting a PR for this new capability, I would like to have feedbacks from other users as to whether the resumability would be a useful feature that the community would welcome. Also, I wonder if it would make sense to implement the resumability in as many iterative solvers as possible.

wsshin commented 3 years ago

Any opinions from anyone?

jagot commented 3 years ago

See also #276