-
Notifications
You must be signed in to change notification settings - Fork 225
feat (linalg_iterative) : add gmres solver to the iterative methods library #1186
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
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
e830a02
start gmres draft
jalvesz eb6bfc6
add comments
jalvesz 877f435
remove kdim from test
jalvesz af06e0d
use dot_product
jalvesz 43b06c7
Merge branch 'gmres' of https://github.com/jalvesz/stdlib into gmres
jalvesz 314189f
Merge branch 'fortran-lang:master' into gmres
jalvesz bf59c02
gmres: add Hilbert matrix test
AlexanderGSC da90ab2
linalg: add MGS reorthogonalization to GMRES
AlexanderGSC 38048ce
fix: rename loop variable to avoid fypp collision
AlexanderGSC 36f81b5
fix: hilbert sp tolerance test
AlexanderGSC 87e9f32
fix: hilbert sp tolerance test
AlexanderGSC b9a99e1
fix: hilbert dp tolerance test
AlexanderGSC 5fa5583
fix: hilbert dp tolerance test for Intel 2024 1 cmake
AlexanderGSC c33097c
Merge pull request #9 from AlexanderGSC/colab-gmres
jalvesz 54769fe
Update test/linalg/test_linalg_solve_iterative.fypp
jalvesz cce7368
Update test/linalg/test_linalg_solve_iterative.fypp
jalvesz 450e7c0
Update test/linalg/test_linalg_solve_iterative.fypp
jalvesz b35926e
Update test/linalg/test_linalg_solve_iterative.fypp
jalvesz 902054c
Update test/linalg/test_linalg_solve_iterative.fypp
jalvesz 825fd51
fix declarations
jalvesz 6ebfe6b
make gmres implementation flexible by allowing switching between memo…
jalvesz 7dab12d
add example
jalvesz 3ba5a4f
convert static enum to integer helper function to determine the numbe…
jalvesz 0069cd3
simplify iterations logic
jalvesz 5099335
replace manual given rotations and the triangular solve by lapack ker…
jalvesz 84b920a
try removing the hilbert test for sp as it is meaningless for the sel…
jalvesz 9da3671
Merge branch 'fortran-lang:master' into gmres
jalvesz cca105b
Merge branch 'fortran-lang:master' into gmres
jalvesz f1341af
Refactor coverage report generation in workflow
jalvesz 45ef501
Merge branch 'fortran-lang:master' into gmres
jalvesz 7cbbf9a
Restrict fpm-deployment coverage upload to the filtered `src/` report…
Copilot ec97def
add review corrections
jalvesz 894a2d9
Merge branch 'fortran-lang:master' into gmres
jalvesz c4734a0
parametrize system size
jalvesz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| program example_solve_gmres | ||
| use stdlib_kinds, only: dp | ||
| use stdlib_linalg_iterative_solvers, only: stdlib_solve_gmres, pc_jacobi | ||
| implicit none | ||
| integer, parameter :: n = 4 | ||
| real(dp), parameter :: A(n,n) = reshape([5.0_dp, 1.0_dp, 2.0_dp, 0.0_dp, & | ||
| 0.0_dp, 4.0_dp, -1.0_dp, 1.0_dp, & | ||
| 1.0_dp, 0.0_dp, 3.0_dp, 2.0_dp, & | ||
| 2.0_dp, -1.0_dp, 0.0_dp, 6.0_dp], [n,n]) | ||
| real(dp), parameter :: x0(n) = [0.2_dp, -0.1_dp, 0.3_dp, 0.0_dp] | ||
| real(dp), parameter :: xref(n) = [1.0_dp, 2.0_dp, -1.0_dp, 0.5_dp] | ||
| real(dp) :: rhs(n), x(n) | ||
|
|
||
| rhs = matmul(A, xref) | ||
|
|
||
| ! GMRES lets the user tune the restart size and the storage mode. | ||
| x = x0 | ||
| call stdlib_solve_gmres(A, rhs, x, restart=.false., kdim=2, maxiter=12, precond=pc_jacobi) | ||
| print *, 'compact:', x | ||
|
|
||
| x = x0 | ||
| call stdlib_solve_gmres(A, rhs, x, restart=.false., kdim=2, maxiter=12, precond=pc_jacobi, compact=.false.) | ||
| print *, 'cached :', x | ||
| end program example_solve_gmres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.