Skip to content

feat: [linalg] add iterative solvers (CG and PCCG) #994

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

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

jalvesz
Copy link
Contributor

@jalvesz jalvesz commented May 17, 2025

This daft PR introduces the base for iterative solvers.

Two methods are proposed:

  • Conjugate Gradient
  • Preconditioned Conjugate Gradient

Each method is made public with two public interface flavors:

  • solve_<method>_kernel: All arguments are mandatory (no optionals/no internal allocations), it contains the methods steps. The linear system (and preconditioner) is defined through a public DT linop which enables to extend two key procedures: apply equivalent to a matrix-vector product and inner equivalent to the dot_product. This is the interface recommended to extend the method when dealing with a matrix type not available in stdlib or when working in distributed-memory frameworks for which the matvec, dot_product and factorization steps need to be adapted to account for parallel synchronization.
  • solve_<method>: API with optional arguments, the linear system can be defined with dense or CSR_<>_type matrices. For the PCCG, the following preconditioners are available: none (identity), jacobi (1/diagonal), SSOR, LDLt. It internally uses solve_<method>_kernel.
  • tests
  • examples
  • documentation

jalvesz and others added 30 commits March 2, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant