Skip to content

Replace indexed iteration by direct indexing #29

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 2 commits into from
Jul 31, 2022
Merged

Replace indexed iteration by direct indexing #29

merged 2 commits into from
Jul 31, 2022

Conversation

dkarrasch
Copy link
Contributor

This came up in a nanosoldier run in JuliaLang/julia#46196. Independently from that PR, the iteration pattern used here is somewhat strange, and could be replaced by directly indexing the first element IIUC.

Copy link
Contributor

@haotian127 haotian127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much Daniel for pointing this out! It is actually a bug. T is supposed to be the QR factorization of a random matrix's Q factor instead of the first matrix entry. Could you help change this line to T = qr(randn(m,m)).Q instead? I have tested on my end and it works fine, since this part is only used to deal with corner cases.

@dkarrasch
Copy link
Contributor Author

I did the requested change. You can, if you want, modify the PR yourself. Do you want to add some test to make sure it works as expected?

@haotian127
Copy link
Contributor

Thanks a lot for the fix! I will take over from here.

@haotian127 haotian127 merged commit 1f8980a into UCD4IDS:master Jul 31, 2022
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