-
-
Couldn't load subscription status.
- Fork 5.7k
Transpose elements in copy_transpose!
#52116
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
Conversation
|
For a test, you could call it directly, instead of the indirect path via |
|
You could add a testset to the end of the transpose.jl test file, perhaps like this: @testset "copy_transpose!" begin
A = [randn(2,3) for _ in 1:2, _ in 1:3]
At = copy(transpose(A))
B = zero.(At)
LinearAlgebra.copy_transpose!(B, axes(B, 1), axes(B, 2), A, axes(A, 1), axes(A, 2))
@test B == At
end |
1eb7a56 to
905f1d4
Compare
|
Thanks for the suggestion. I added a test and rebased it. |
|
CI looks horrible, but it seems all unrelated, and the change is small enough. So, I'd say this is "ready for review" and merge. |
Thanks! Indeed, the changes are very simple. As a general question, for PRs in Julia should I have |
|
Yes, |
|
Thank you for reporting the issue and getting the fix started! Welcome to the Julia community @maltezfaria. |
That makes sense, thanks for the review and for taking the time to answer! |
Fixes JuliaLang/LinearAlgebra.jl#1033
Notes
I had a hard time coming up with a self-contained test to cover this bug, as it only happens for elements which are bothIf we testbitstypeand for whichtranspose(x) != x. Not sure how to go about it.copy_transpose!directly (and through the matrix multiplication), testing is straightforward.copy_transpose!is no longer used in the generic matrix multiplication. Still, I thought maybe it would still be worth fixing.