ginkgo
ginkgo copied to clipboard
Minres solver
This PR will add a Minres solver for symmetric/hermitian indefinite matrices. The implementation is based in the book 'Iterative Methods for Solving Linear Systems' (Ch. 8) by Anne Greenbaum (DOI: https://doi.org/10.1137/1.9781611970937). It uses the common kernel interface to define kernels.
One uncertainty for me is the computation of the residual norm approximation. I'm using the approach from Iterative Methods for Singular Linear Equations and Least-Squares Problems, but somehow this does not define the initial value for the used recursion. The three possible values are beta = sqrt(<r, z>)
, ||r||
or ||z||
. I'm currently using ||z||
, since I could also find that used by petsc. I've compared these three in matlab for smaller matrices, and the difference between these does not seem to matter.
Todo:
- [x] wait until #973 is merged and update to that.
format-rebase!
Error: Rebase failed, see the related Action for details
format!
Codecov Report
Attention: 43 lines
in your changes are missing coverage. Please review.
Comparison is base (
1e268ff
) 91.03% compared to head (6a991bc
) 91.72%. Report is 4 commits behind head on develop.
:exclamation: Current head 6a991bc differs from pull request most recent head 7e34ec9. Consider uploading reports for the commit 7e34ec9 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## develop #975 +/- ##
===========================================
+ Coverage 91.03% 91.72% +0.69%
===========================================
Files 697 503 -194
Lines 56724 43056 -13668
===========================================
- Hits 51639 39494 -12145
+ Misses 5085 3562 -1523
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've realized that there are issues if the jacobi preconditioner is used for matrices with negative diagonal elements. I need to further investigate this, so I will put the PR back to WIP.
Error: The following files need to be formatted:
test/solver/minres_kernels.cpp
You can find a formatting patch under Artifacts here or run format!
if you have write access to Ginkgo
Note: This PR changes the Ginkgo ABI:
Functions changes summary: 0 Removed, 0 Changed, 792 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
For details check the full ABI diff under Artifacts here
I've realized that there are issues if the jacobi preconditioner is used for matrices with negative diagonal elements. I need to further investigate this, so I will put the PR back to WIP.
In general, Jacobi is not supposed to work for indefinite systems. Is the system indefinite? If so, this may not be an issue. If the matrix is diagonal dominant, but has both negative and positive diagonal elements, I guess there's a high chance it's indefinite.