Skip to content

Commit

Permalink
Specify how to obtain all inverses (#1835)
Browse files Browse the repository at this point in the history
  • Loading branch information
albinahlback authored Oct 7, 2024
1 parent 5653a21 commit c6f2611
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Matrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3567,11 +3567,15 @@ end
@doc raw"""
is_invertible_with_inverse(A::MatrixElem{T}; side::Symbol = :left) where {T <: RingElement}
Given an $n\times m$ matrix $A$ over a ring, return a tuple `(flag, B)`.
If `side` is `:right` and `flag` is true, $B$ is the right inverse of $A$
i.e. $AB$ is the $n\times n$ unit matrix. If `side` is `:left` and `flag` is
true, $B$ is the left inverse of $A$ i.e. $BA$ is the $m\times m$ unit matrix.
If `flag` is false, no right or left inverse exists.
Given an $n \times m$ matrix $A$ over a ring, return a tuple `(flag, B)`. If
`side` is `:right` and `flag` is `true`, $B$ is a right inverse of $A$ i.e.
$A B$ is the $n \times n$ unit matrix. If `side` is `:left` and `flag` is
`true`, $B$ is a left inverse of $A$ i.e. $B A$ is the $m \times m$ unit matrix.
If `flag` is `false`, no right or left inverse exists.
To get the space of all inverses, note that if $B$ and $C$ are both right
inverses, then $A (B - C) = 0$, and similar for left inverses. Hence from one
inverse one can find all by making suitable use of [`kernel`](@ref).
"""
function is_invertible_with_inverse(A::MatrixElem{T}; side::Symbol = :left) where {T <: RingElement}
if (side == :left && nrows(A) < ncols(A)) || (side == :right && ncols(A) < nrows(A))
Expand Down

0 comments on commit c6f2611

Please sign in to comment.