Closed
Description
MWE:
using LinearAlgebra
function resizer()
v = rand(7)
w = similar(v)
W = rand(7,7)
luw = lu(W)
ldiv!(vec(w),luw,v)
resize!(v,3)
end
resizer()
The resize!
fails because of the view on v
which is built internally. Patching with
function LinearAlgebra.ldiv!(Y::AbstractVecOrMat, A::Factorization, B::AbstractVecOrMat)
@assert !LinearAlgebra.has_offset_axes(Y, B)
m, n = size(A, 1), size(A, 2)
if m > n
ldiv!(A, B)
return copyto!(Y, B)
else
return ldiv!(A, copyto!(Y, B))
end
end
fixes the issue. Note that this is a regression from v0.6 where
function resizer()
v = rand(7)
w = similar(v)
W = rand(7,7)
luw = lufact(W)
A_ldiv_B!(w,luw,v)
resize!(v,3)
end
resizer()
works.
Is that viewless version fine? Should I PR it? I don't really understand what supporting using only part of B
is for. For reference the dispatch is
Why not generally use B
?
Metadata
Metadata
Assignees
Labels
No labels