diff --git a/stdlib/LinearAlgebra/docs/src/index.md b/stdlib/LinearAlgebra/docs/src/index.md index afe31b5e230e8..e929bbed9f1da 100644 --- a/stdlib/LinearAlgebra/docs/src/index.md +++ b/stdlib/LinearAlgebra/docs/src/index.md @@ -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 diff --git a/stdlib/LinearAlgebra/src/exceptions.jl b/stdlib/LinearAlgebra/src/exceptions.jl index 02d708642a0fd..e3fabb6c151a8 100644 --- a/stdlib/LinearAlgebra/src/exceptions.jl +++ b/stdlib/LinearAlgebra/src/exceptions.jl @@ -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