Skip to content

Commit

Permalink
Docs: add examples to istril/istriu docstrings (#49853)
Browse files Browse the repository at this point in the history
Also, simplify some of the examples to focus on the structure of the
matrices
  • Loading branch information
jishnub authored Aug 25, 2023
1 parent 451de66 commit 38520e1
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions stdlib/LinearAlgebra/src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1284,16 +1284,17 @@ false
julia> istriu(a, -1)
true
julia> b = [1 im; 0 -1]
2×2 Matrix{Complex{Int64}}:
1+0im 0+1im
0+0im -1+0im
julia> istriu(b)
true
julia> c = [1 1 1; 1 1 1; 0 1 1]
3×3 Matrix{Int64}:
1 1 1
1 1 1
0 1 1
julia> istriu(b, 1)
julia> istriu(c)
false
julia> istriu(c, -1)
true
```
"""
function istriu(A::AbstractMatrix, k::Integer = 0)
Expand Down Expand Up @@ -1328,16 +1329,17 @@ false
julia> istril(a, 1)
true
julia> b = [1 0; -im -1]
2×2 Matrix{Complex{Int64}}:
1+0im 0+0im
0-1im -1+0im
julia> istril(b)
true
julia> c = [1 1 0; 1 1 1; 1 1 1]
3×3 Matrix{Int64}:
1 1 0
1 1 1
1 1 1
julia> istril(b, -1)
julia> istril(c)
false
julia> istril(c, 1)
true
```
"""
function istril(A::AbstractMatrix, k::Integer = 0)
Expand Down

0 comments on commit 38520e1

Please sign in to comment.