Skip to content

Commit 5ffd58e

Browse files
authored
ensure no sharing of data in LQ (#219)
1 parent a53006e commit 5ffd58e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/implementations/lq.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,10 @@ function lq_householder!(
164164
end
165165

166166
if computeL
167-
= lowertriangular!(view(A, axes(L)...))
168-
positive && gaugefix!(lq_householder!, L̃, Q, diagview(A))
169-
copyto!(L, L̃)
167+
# we need to first copy then gaugefix - avoiding aliasing between L and Ld for broadcast
168+
Ld = diagview(A)
169+
copyto!(L, lowertriangular!(view(A, axes(L)...)))
170+
positive && gaugefix!(lq_householder!, L, Q, Ld)
170171
else
171172
gaugefix!(lq_householder!, nothing, Q, diagview(A))
172173
end

0 commit comments

Comments
 (0)