Derived-types for matrix factorizations : QR#1092
Draft
loiseaujc wants to merge 17 commits intofortran-lang:masterfrom
Draft
Derived-types for matrix factorizations : QR#1092loiseaujc wants to merge 17 commits intofortran-lang:masterfrom
loiseaujc wants to merge 17 commits intofortran-lang:masterfrom
Conversation
Bring disciplined linalg branch up-to-date.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1092 +/- ##
=======================================
Coverage 68.55% 68.55%
=======================================
Files 396 396
Lines 12746 12746
Branches 1376 1376
=======================================
Hits 8738 8738
Misses 4008 4008 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Update with stdlib v0.8.1
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Following #1040, this PR proposes a derived-type to store the QR factorization of a matrix. It is quite similar to what is being done in Julia and use
xGEQRTdriver fromlapackto store the QR factorization using the compact WY format which is beneficial for performances (blocked algorithm + efficient specialized drivers matrix-matrix products).Proposed interfaces
I still need to iterate a bit for the matrix-vector/matrix-matrix product.
Note - I don't quite like the
qr_rdp_typenaming for the derived-type but I ain't sure how to come with a better name. An alternative would be to use parameterized types but I'm not too confident about the actual support by all the compilers we test in the CI.Other potential additions
This may be the subject of a different PR but I'll start the discussion here anyway as it may be relevant. Once the implementation is working/validated/integrated, I was wondering whether we should eventually defined an equivalent of the
\operator in Matlab and Julia for solving linear systems with a very simplex = A \ bwhich dispatch to the appropriate driver (solvefor square matrix,lstsqfor overdetermined ones,solve_luifAis coming from the futurelufact, specialized one forqrfact, etc). This is essentially syntactic sugar coating I'll admit but it can be a nice selling point for new comers: don't worry too much about how to get the performances out of your code, we make sure you have very descent performances by default (but if you really want to get the best perfs possible, you still need to go low-level and avoid allocations, etc).Progress
qrfact: Instantiate derived-type for QR factorization.qrmv/qrmm: Specialized driver for matrix-vector and matrix-matrix products.handle_geqrt_info: Handle info flag returned bygeqrt(compact WY QR factorization).handle_gemqrt_info: Handle info flag return bygemqrt(matrix-matrix product with compact WY storage).qrfactqrmv/qrmmself%Q(): Extract the Q matrix from the Compact WY representation.self%R(): Extract the R matrix from the Compact WY representation.qrfact,self%Q(),self%R()qrmv/qrmmqrfact,self%Q(),self%R()qrmv/qrmmqrfact,self%Q(),self%R()qrmv/qrmmqrfact,self%Q(),self%R()qrmv/qrmmqrfactqrmv/qrmmPing: @perazz, @jvdp1, @jalvesz