Change the QR implementation, inspired by LAPACK #730
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.
I ported some ideas from LAPACK's QR implementation, more specifically from
?ORG2R
.As a result I could increase all epsilons in the test by two order of magnitudes. Also the full computation of the
Q
matrix is now supported, not only the firstmin(n, m)
columns. I added a new methodq_columns
for this. The currentq()
method stayed the same.The main difference in the implementation seems to be that LAPACK applies the scaling of the Householder vectors at a different point in the code.
Breaking changes
qr_internal
)R
andQ
.work
. This resulted in additional allocator bounds. See discussion below.Things to discuss
q_tr_mul
borrows self mutably due to an implementation detail although the struct's state will only be changed temporarily inside the method. Ideas to resolve this:gerc
andgemv
call (possible performance penalty)work
allocations could be done only once by storing a suitable vector in the struct and sharing it. This will result in&mut self
or interior mutability.