Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logabsdet(::Diagonal) doesn't work #32988

Closed
tpapp opened this issue Aug 20, 2019 · 1 comment · Fixed by #32998
Closed

logabsdet(::Diagonal) doesn't work #32988

tpapp opened this issue Aug 20, 2019 · 1 comment · Fixed by #32998
Labels
linear algebra Linear algebra

Comments

@tpapp
Copy link
Contributor

tpapp commented Aug 20, 2019

julia> VERSION
v"1.3.0-rc1.0"

julia> using LinearAlgebra

julia> logabsdet(Diagonal(ones(3)))
ERROR: MethodError: no method matching lu!(::Diagonal{Float64,Array{Float64,1}}, ::Val{true}; check=false)
Closest candidates are:
  lu!(::Union{DenseArray{T,2}, Base.ReinterpretArray{T,2,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, Base.ReshapedArray{T,2,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, SubArray{T,2,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractRange{Int64}, Base.AbstractCartesianIndex},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, DenseArray}}, ::Union{Val{false}, Val{true}}; check) where T<:Union{Complex{Float32}, Complex{Float64}, Float32, Float64} at /home/tamas/src/julia-git/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/lu.jl:81
  lu!(::Union{Hermitian{T,S}, Symmetric{T,S}} where S where T, ::Union{Val{false}, Val{true}}; check) at /home/tamas/src/julia-git/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/lu.jl:89
  lu!(::Union{DenseArray{T,2}, Base.ReinterpretArray{T,2,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, Base.ReshapedArray{T,2,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, SubArray{T,2,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractRange{Int64}, Base.AbstractCartesianIndex},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, DenseArray}} where T, ::Union{Val{false}, Val{true}}; check) at /home/tamas/src/julia-git/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/lu.jl:130
  ...
Stacktrace:
 [1] #lu#135(::Bool, ::typeof(lu), ::Diagonal{Float64,Array{Float64,1}}, ::Val{true}) at /home/tamas/src/julia-git/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/lu.jl:186
 [2] (::LinearAlgebra.var"#kw##lu")(::NamedTuple{(:check,),Tuple{Bool}}, ::typeof(lu), ::Diagonal{Float64,Array{Float64,1}}, ::Val{true}) at ./none:0 (repeats 2 times)
 [3] logabsdet(::Diagonal{Float64,Array{Float64,1}}) at /home/tamas/src/julia-git/usr/share/julia/stdlib/v1.3/LinearAlgebra/src/generic.jl:1455
 [4] top-level scope at REPL[3]:1

Probably should be special cased not to go through lu.

@andreasnoack andreasnoack added the linear algebra Linear algebra label Aug 20, 2019
@andreasnoack
Copy link
Member

Yes, it should have its own method. Shouldn't be hard to implement.

tpapp added a commit to tpapp/julia that referenced this issue Aug 21, 2019
Works with generic eltypes. Fixes JuliaLang#32988.
andreasnoack pushed a commit that referenced this issue Aug 21, 2019
Works with generic eltypes. Fixes #32988.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linear algebra Linear algebra
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants