Skip to content

Commit

Permalink
Fix #28619, logabsdet for singular matrices (#28620)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison authored and andreasnoack committed Aug 13, 2018
1 parent d7e4584 commit 0846eb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ julia> logabsdet(B)
(0.6931471805599453, 1.0)
```
"""
logabsdet(A::AbstractMatrix) = logabsdet(lu(A))
logabsdet(A::AbstractMatrix) = logabsdet(lu(A, check=false))

"""
logdet(M)
Expand Down
2 changes: 2 additions & 0 deletions stdlib/LinearAlgebra/test/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ n = 5 # should be odd
@test logdet(A) log(det(A))
@test logabsdet(A)[1] log(abs(det(A)))
@test logabsdet(Matrix{elty}(-I, n, n))[2] == -1
infinity = convert(float(elty), Inf)
@test logabsdet(zeros(elty, n, n)) == (-infinity, zero(elty))
if elty <: Real
@test logabsdet(A)[2] == sign(det(A))
@test_throws DomainError logdet(Matrix{elty}(-I, n, n))
Expand Down

0 comments on commit 0846eb5

Please sign in to comment.