Skip to content

Commit ddc689a

Browse files
committed
Fix another bad R22upper
1 parent c435b7b commit ddc689a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/pullbacks/qr.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,12 @@ function remove_qr_gauge_dependence!(ΔQ, ΔR, A, Q, R; rank_atol = MatrixAlgebr
175175
# compute the appropriate offset in ΔR so we aren't
176176
# operating on a view-of-view, which doesn't work
177177
# for GPU arrays
178-
offset = LinearIndices(ΔR)[r + 1, r + 1]
179-
upper_inds = uppertriangularind(ΔR₂₂) .+ offset
178+
# uppertriangularind generates linear indices
179+
# compute the appropriate offset in ΔR so we aren't
180+
# operating on a view-of-view, which doesn't work
181+
# for GPU arrays
182+
I = uppertriangularind(ΔR₂₂)
183+
upper_inds = view(LinearIndices(ΔR), (p + 1):minmn, (p + 1):n)[I]
180184
ΔR₂₂upper = view(ΔR, upper_inds)
181185
zero!(ΔR₂₂upper)
182186
end

0 commit comments

Comments
 (0)