You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am performing tests with the DescriptorSystems with versions of Julia starting with 1.2. The tests with Julia 1.2 fail with a message saying
MethodError: no method matching rdiv!(::Array{Float64,2}, ::LinearAlgebra.LU{Float64,Array{Float64,2}})
I reproduced the error message after I reinstalled version 1.2 and performed the following sequence:
using LinearAlgebra
a = rand(3,3);
b = rand(3,3);
F = lu(a);
ldiv!(F,b);
rdiv!(b,F);
ERROR: MethodError: no method matching rdiv!(::Array{Float64,2}, ::LU{Float64,Array{Float64,2}})
All other versions of Julia starting with 1.3 are working at this point. I wonder if this is an error or rdiv! is not implemented for factorizations such as LU or QR (I was able to find the code only for ldiv!, but rdiv! is documented). Compat.jl also does not provide a solution.
The missing code (taken from version 1.6) is:
function rdiv!(A::StridedVecOrMat, B::LU{<:Any,<:StridedMatrix})
rdiv!(rdiv!(A, UpperTriangular(B.factors)), UnitLowerTriangular(B.factors))
_apply_inverse_ipiv_cols!(B, A)
end
_apply_inverse_ipiv_cols!(A::LU, B::StridedVecOrMat) = _ipiv_cols!(A, length(A.ipiv) : -1 : 1, B)
function _ipiv_cols!(A::LU, order::OrdinalRange, B::StridedVecOrMat)
for i = order
if i != A.ipiv[i]
_swap_cols!(B, i, A.ipiv[i])
end
end
B
end
function _swap_cols!(B::StridedVector, i::Integer, j::Integer)
_swap_rows!(B, i, j)
end
function _swap_cols!(B::StridedMatrix, i::Integer, j::Integer)
for row = 1 : size(B, 1)
B[row,i], B[row,j] = B[row,j], B[row,i]
end
B
end
The overloaded code for rdiv! works apparently in version 1.2 too:
This seems to have been added in #31285, which is part of 1.3 onwards. If sufficiently motivated you could add it to Compat.jl, but it's probably better to upgrade.
I am performing tests with the DescriptorSystems with versions of Julia starting with 1.2. The tests with Julia 1.2 fail with a message saying
MethodError: no method matching rdiv!(::Array{Float64,2}, ::LinearAlgebra.LU{Float64,Array{Float64,2}})
I reproduced the error message after I reinstalled version 1.2 and performed the following sequence:
All other versions of Julia starting with 1.3 are working at this point. I wonder if this is an error or
rdiv!
is not implemented for factorizations such as LU or QR (I was able to find the code only forldiv!
, butrdiv!
is documented). Compat.jl also does not provide a solution.The missing code (taken from version 1.6) is:
The overloaded code for
rdiv!
works apparently in version 1.2 too:The text was updated successfully, but these errors were encountered: