Skip to content

Commit 38520e1

Browse files
authored
Docs: add examples to istril/istriu docstrings (#49853)
Also, simplify some of the examples to focus on the structure of the matrices
1 parent 451de66 commit 38520e1

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

stdlib/LinearAlgebra/src/generic.jl

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,16 +1284,17 @@ false
12841284
julia> istriu(a, -1)
12851285
true
12861286
1287-
julia> b = [1 im; 0 -1]
1288-
2×2 Matrix{Complex{Int64}}:
1289-
1+0im 0+1im
1290-
0+0im -1+0im
1291-
1292-
julia> istriu(b)
1293-
true
1287+
julia> c = [1 1 1; 1 1 1; 0 1 1]
1288+
3×3 Matrix{Int64}:
1289+
1 1 1
1290+
1 1 1
1291+
0 1 1
12941292
1295-
julia> istriu(b, 1)
1293+
julia> istriu(c)
12961294
false
1295+
1296+
julia> istriu(c, -1)
1297+
true
12971298
```
12981299
"""
12991300
function istriu(A::AbstractMatrix, k::Integer = 0)
@@ -1328,16 +1329,17 @@ false
13281329
julia> istril(a, 1)
13291330
true
13301331
1331-
julia> b = [1 0; -im -1]
1332-
2×2 Matrix{Complex{Int64}}:
1333-
1+0im 0+0im
1334-
0-1im -1+0im
1335-
1336-
julia> istril(b)
1337-
true
1332+
julia> c = [1 1 0; 1 1 1; 1 1 1]
1333+
3×3 Matrix{Int64}:
1334+
1 1 0
1335+
1 1 1
1336+
1 1 1
13381337
1339-
julia> istril(b, -1)
1338+
julia> istril(c)
13401339
false
1340+
1341+
julia> istril(c, 1)
1342+
true
13411343
```
13421344
"""
13431345
function istril(A::AbstractMatrix, k::Integer = 0)

0 commit comments

Comments
 (0)