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

Matrixify Q matrix before comparison with a matrix #9

Merged
merged 1 commit into from
Aug 1, 2022
Merged

Matrixify Q matrix before comparison with a matrix #9

merged 1 commit into from
Aug 1, 2022

Conversation

dkarrasch
Copy link
Contributor

This came up in a nanosoldier run in JuliaLang/julia#46196. Independently from that PR, it is advisable to matrixify the Q matrix before comparing it via getindex, which is slow for Q's. With the proposed change, the tests in this package become independent from whether JuliaLang/julia#46196 gets accepted or not.

@fkastner
Copy link
Owner

fkastner commented Aug 1, 2022

Thanks for looking after the ecosystem, Daniel!
It is good to know that also such small packages are notified/updated when Base changes.

Just one question: Could we also use Matrix(Q), which would better convey the intention here?
Actually, I just tested it and it seems that Matrix(Q) != Q*I. Is that a bug?

@dkarrasch
Copy link
Contributor Author

No worries, Felix. This package is registered, so this is as big as it can get. 😄 The difference you mention is known, intentional and documented, see the docstring of qr. In your case, as you noted, Matrix(Q) returns a thin matrix, but on the rhs, you have the full, square matrix. Alternatively, you could use Q*Matrix(I, size(Q)) as suggested in the docstring, but Q*I gives the same result and doesn't allocate the intermediate Bool matrix.

@fkastner
Copy link
Owner

fkastner commented Aug 1, 2022

Ok, that makes sense then. Thank you again!

@fkastner fkastner merged commit ad63538 into fkastner:master Aug 1, 2022
@dkarrasch dkarrasch deleted the patch-1 branch August 1, 2022 13:31
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.

2 participants