-
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
JuliaLang/julia
#52116Description
A while back I ran into this issue with StaticArrays:
using StaticArrays
A = @SMatrix rand(3, 3)
B = @SMatrix rand(3, 3)
blockA = fill(A, 3, 2)
blockB = fill(B, 3, 2)
val1 = blockA * transpose(blockB)
val2 = blockA * collect(transpose(blockB))
val1 ≈ val2 # false, by a lotRecently, this came back to bite me again, and I managed to narrow down the issue to this chunk in the transpose.jl file.
for jsrc in jr_src
jdest = first(jr_dest)
for isrc in ir_src
B[idest,jdest] = A[isrc,jsrc]
jdest += step(jr_dest)
end
idest += step(ir_dest)
endReplacing B[idest,jdest] = A[isrc,jsrc] by B[idest,jdest] = transpose(A[isrc,jsrc]) seems to fix the StaticArray bug, which is related to the copy_transpose! not transposing its elements. Since the transpose(x::Number) = x, this change should not break the scalar version, but I am not sure if there are further implications of such a change.
Metadata
Metadata
Assignees
Labels
No labels