-
Notifications
You must be signed in to change notification settings - Fork 191
linalg: Cholesky factorization #840
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
23 commits
Select commit
Hold shift + click to select a range
3d2a6ec
add cholesky source
perazz b1dec60
cholesky submodule
perazz 74074a4
implement tests
perazz 91a4e36
chol: function interface, implement and test
perazz ac1e0f9
implement examples
perazz 6b98c46
doc: specs
perazz 780b0a5
finish documentation
perazz 8d20929
Merge branch 'master' into cholesky
perazz a91103a
lift `xdp` restriction
perazz 81ca0ba
Update doc/specs/stdlib_linalg.md
perazz bb57303
Update doc/specs/stdlib_linalg.md
perazz 89f53ea
Update doc/specs/stdlib_linalg.md
perazz a56fb48
Update doc/specs/stdlib_linalg.md
perazz 74ddd32
Update doc/specs/stdlib_linalg.md
perazz 1b65f8b
Update doc/specs/stdlib_linalg.md
perazz d52b707
Update doc/specs/stdlib_linalg.md
perazz a0ca36f
Update doc/specs/stdlib_linalg.md
perazz 52d0894
Update doc/specs/stdlib_linalg.md
perazz 5850eee
Update src/stdlib_linalg_cholesky.fypp
perazz 531aba7
Update src/stdlib_linalg_cholesky.fypp
perazz 2549839
cholesky: allocatable -> assumed-shape return value
perazz 8955bf0
Merge branch 'master' into cholesky
perazz 140fc7f
Merge branch 'cholesky' of github.com:perazz/stdlib into cholesky
perazz 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
! Cholesky factorization: function interface | ||
program example_chol | ||
use stdlib_linalg, only: chol | ||
implicit none | ||
|
||
real, allocatable, dimension(:,:) :: A,L,U | ||
|
||
! Set real matrix | ||
A = reshape( [ [6, 15, 55], & | ||
[15, 55, 225], & | ||
[55, 225, 979] ], [3,3] ) | ||
|
||
! Decompose (lower) | ||
L = chol(A, lower=.true.) | ||
|
||
! Compare decomposition | ||
print *, maxval(abs(A-matmul(L,transpose(L)))) | ||
|
||
! Decompose (upper) | ||
U = chol(A, lower=.false.) | ||
|
||
! Compare decomposition | ||
print *, maxval(abs(A-matmul(transpose(U),U))) | ||
|
||
end program example_chol |
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,25 @@ | ||
! Cholesky factorization: subroutine interface | ||
program example_cholesky | ||
use stdlib_linalg, only: cholesky | ||
implicit none | ||
|
||
real, dimension(3,3) :: A,L,U | ||
|
||
! Set real matrix | ||
A = reshape( [ [6, 15, 55], & | ||
[15, 55, 225], & | ||
[55, 225, 979] ], [3,3] ) | ||
|
||
! Decompose (lower) | ||
call cholesky(A, L, lower=.true.) | ||
|
||
! Compare decomposition | ||
print *, maxval(abs(A-matmul(L,transpose(L)))) | ||
|
||
! Decompose (upper) | ||
call cholesky(A, U, lower=.false.) | ||
|
||
! Compare decomposition | ||
print *, maxval(abs(A-matmul(transpose(U),U))) | ||
|
||
end program example_cholesky |
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.