-
Notifications
You must be signed in to change notification settings - Fork 191
linalg: QR factorization #832
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 19 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
6cac0cc
add `qr` module
perazz d4b5dbc
add examples
perazz fe0e243
submodule
perazz ec6f687
fix the examples
perazz a6a6838
exclude `xdp`
perazz feecc14
fix `module` `subroutine`
perazz f3d74ff
enforce full/reduced problem sizes
perazz 5735b05
add tests
perazz 7c9d5b4
remove `xdp` from tests
perazz cda4b0d
document `qr_space`
perazz 8df204f
document `qr`
perazz b4889c5
relax tol
perazz 9ac97d1
deactivate full tol check
perazz 364b9ca
export error amount
perazz 8ed1fe4
Fix: return full `Q` from `*ORGQR`
perazz 3db022d
add test: init NaNs, check correct return
perazz fcb5306
Merge branch 'master' into qr
perazz 68ece36
Merge branch 'master' into qr
perazz 86d15bc
lift `xdp` restriction
perazz 381d024
Update doc/specs/stdlib_linalg.md
perazz 931f07a
Update doc/specs/stdlib_linalg.md
perazz 5f15913
Update doc/specs/stdlib_linalg.md
perazz 997021c
Update doc/specs/stdlib_linalg.md
perazz 789e6d0
Update doc/specs/stdlib_linalg.md
perazz e5999f2
Update doc/specs/stdlib_linalg.md
perazz 47f70e6
Update doc/specs/stdlib_linalg.md
perazz 478f68d
Update doc/specs/stdlib_linalg.md
perazz e3db36d
improve qr description
perazz e69e767
`qr` workspace: make `a` `intent(in)`
perazz 8827bf7
`qr` temporary storage: make `intent(out)`
perazz 7393a18
Merge branch 'master' into qr
perazz c6bb171
Update src/stdlib_linalg_qr.fypp
perazz 6fc0e1d
use IEEE NaNs
perazz df4016a
Merge branch 'master' into qr
perazz d3ae5a7
Merge branch 'fortran-lang:master' into qr
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,15 @@ | ||
program example_qr | ||
use stdlib_linalg, only: qr | ||
implicit none(type,external) | ||
real :: A(104, 32), Q(104,32), R(32,32) | ||
|
||
! Create a random matrix | ||
call random_number(A) | ||
|
||
! Compute its QR factorization (reduced) | ||
call qr(A,Q,R) | ||
|
||
! Test factorization: Q*R = A | ||
print *, maxval(abs(matmul(Q,R)-A)) | ||
|
||
end program example_qr |
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 @@ | ||
! QR example with pre-allocated storage | ||
program example_qr_space | ||
use stdlib_linalg_constants, only: ilp | ||
use stdlib_linalg, only: qr, qr_space, linalg_state_type | ||
implicit none(type,external) | ||
real :: A(104, 32), Q(104,32), R(32,32) | ||
real, allocatable :: work(:) | ||
integer(ilp) :: lwork | ||
type(linalg_state_type) :: err | ||
|
||
! Create a random matrix | ||
call random_number(A) | ||
|
||
! Prepare QR workspace | ||
call qr_space(A,lwork) | ||
allocate(work(lwork)) | ||
|
||
! Compute its QR factorization (reduced) | ||
call qr(A,Q,R,storage=work,err=err) | ||
|
||
! Test factorization: Q*R = A | ||
print *, maxval(abs(matmul(Q,R)-A)) | ||
print *, err%print() | ||
|
||
end program example_qr_space |
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.