Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/exceptions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ struct SingularException <: Exception
info::BlasInt
end

function Base.showerror(io::IO, ex::SingularException)
print(io, "SingularException: matrix is singular; factorization failed. Zero eigenvalue found at index ", ex.info)
end

"""
PosDefException

Expand Down
5 changes: 5 additions & 0 deletions test/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1366,4 +1366,9 @@ end
@test !any(LinearAlgebra.getstructure(A))
end

@testset "SingularException show" begin
A = diagm(0=> [1, 0])
@test_throws "matrix is singular; factorization failed" inv(A)
end

end # module TestDense