Skip to content

Commit

Permalink
Docs for PosDefException and SingularException (#31251)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored and fredrikekre committed Mar 5, 2019
1 parent 3f64624 commit 9656c44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stdlib/LinearAlgebra/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ Linear algebra functions in Julia are largely implemented by calling functions f
```@docs
Base.:*(::AbstractMatrix, ::AbstractMatrix)
Base.:\(::AbstractMatrix, ::AbstractVecOrMat)
LinearAlgebra.SingularException
LinearAlgebra.PosDefException
LinearAlgebra.dot
LinearAlgebra.cross
LinearAlgebra.factorize
Expand Down
14 changes: 14 additions & 0 deletions stdlib/LinearAlgebra/src/exceptions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,24 @@ function Base.showerror(io::IO, ex::ARPACKException)
end
end

"""
SingularException
Exception thrown when the input matrix has one or more zero-valued eigenvalues, and is not invertible.
A linear solve involving such a matrix cannot be computed.
The `info` field indicates the location of (one of) the singular value(s).
"""
struct SingularException <: Exception
info::BlasInt
end

"""
PosDefException
Exception thrown when the input matrix was not [positive definite](https://en.wikipedia.org/wiki/Definiteness_of_a_matrix).
Some linear algebra functions and factorizations are only applicable to positive definite matrices.
The `info` field indicates the location of (one of) the eigenvalue(s) which is (are) less than/equal to 0.
"""
struct PosDefException <: Exception
info::BlasInt
end
Expand Down

0 comments on commit 9656c44

Please sign in to comment.