Skip to content
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

linalg: Cholesky factorization #840

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Conversation

perazz
Copy link
Contributor

@perazz perazz commented Jun 25, 2024

Compute the Cholesky factorization of a real or complex matrix: $A = L \cdot L^T $, or $A = U^T \cdot U$, where $A$ is symmetric or complex Hermitian, and $L$, $U$ are lower- or upper-triangular, respectively.
Based on LAPACK Cholesky factorization (*POTRF) routines.

  • base implementation
  • tests
  • exclude unsupported xdp
  • documentation
  • submodule
  • examples
  • all pure subroutine interfaces

Prior art

  • Numpy: L = cholesky(a, /, *, upper=False)
  • Scipy: L = cholesky(a, lower=False, overwrite_a=False, check_finite=True)

Proposed implementation

  • call cholesky(A, lower [, other_zeroed] [, err]) : inplace pure subroutine interface

  • call cholesky(A, chol, lower, [, other_zeroed] [, err]): non-inplace pure subroutine interface

  • L = chol(A, lower [, other_zeroed]): pure function interface

  • Only $L$ or $U$ is returned. The unused triangular region is zeroed out by default. However, if the user wants to save time, they can set the other_zeroed=.false. argument. In this case, the unused region will not be accessed at all, and will in general contain garbage. This option is to be used with caution part of the expert interface.

cc: @fortran-lang/stdlib @jalvesz @jvdp1

@perazz perazz marked this pull request as ready for review June 25, 2024 11:04
Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Thank you.

doc/specs/stdlib_linalg.md Show resolved Hide resolved
doc/specs/stdlib_linalg.md Outdated Show resolved Hide resolved
doc/specs/stdlib_linalg.md Outdated Show resolved Hide resolved
doc/specs/stdlib_linalg.md Outdated Show resolved Hide resolved
doc/specs/stdlib_linalg.md Outdated Show resolved Hide resolved
doc/specs/stdlib_linalg.md Outdated Show resolved Hide resolved
doc/specs/stdlib_linalg.md Outdated Show resolved Hide resolved
src/stdlib_linalg.fypp Outdated Show resolved Hide resolved
src/stdlib_linalg_cholesky.fypp Outdated Show resolved Hide resolved
src/stdlib_linalg_cholesky.fypp Outdated Show resolved Hide resolved
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.

None yet

2 participants