-
Notifications
You must be signed in to change notification settings - Fork 194
feat : [linalg] add bi-conjugate gradient stabilized method #1034
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces the Bi-Conjugate Gradient Stabilized (BiCGSTAB) method for solving non-symmetric linear systems. The implementation follows the internal framework established in #994 and is inspired by SciPy's BiCGSTAB implementation.
Key changes:
- Adds BiCGSTAB kernel and user-friendly interface for dense and CSR matrices
- Moves preconditioner enums to main module for shared use across solvers
- Includes comprehensive test coverage and example programs
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/stdlib_linalg_iterative_solvers_bicgstab.fypp | Core BiCGSTAB implementation with kernel and interface procedures |
src/stdlib_linalg_iterative_solvers.fypp | Main module updated with BiCGSTAB interfaces and shared preconditioner enums |
src/stdlib_linalg_iterative_solvers_pcg.fypp | Removes duplicate preconditioner enum definitions |
test/linalg/test_linalg_solve_iterative.fypp | Adds comprehensive test cases for BiCGSTAB method |
example/linalg/example_solve_bicgstab.f90 | Basic BiCGSTAB usage example |
example/linalg/example_solve_bicgstab_wilkinson.f90 | Advanced example using Wilkinson matrix with CSR format |
src/CMakeLists.txt | Adds new BiCGSTAB source file to build |
example/linalg/CMakeLists.txt | Adds BiCGSTAB examples to build |
doc/specs/stdlib_linalg_iterative_solvers.md | Documentation for BiCGSTAB interfaces and usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Jeremie Vandenplas <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you @jalvesz
Co-authored-by: Jeremie Vandenplas <[email protected]>
Thanks for your reviews @jvdp1, I'll merge this one which I think is ready. I just opened an issue to don't forget about the |
This PR co-developed with CoPilot introduces the Bi-Conjugate Gradient stabilized method. It is inspired from SciPy's implementation https://github.com/scipy/scipy/blob/v1.16.2/scipy/sparse/linalg/_isolve/iterative.py#L158-L304 but following the internal framework introduced in #994
Key interfaces :
call stdlib_solve_bicgstab_kernel (A, M, b, x, rtol, atol, maxiter, workspace)
call stdlib_solve_bicgstab(A, b, x [, di, rtol, atol, maxiter, restart, precond, M, workspace])