@@ -13,20 +13,31 @@ Represents the `i`-th band of a banded matrix.
13
13
```jldoctest
14
14
julia> using BandedMatrices
15
15
16
- julia> A = BandedMatrix(Ones(5,5),(1,1))
17
- 5×5 BandedMatrix{Float64} with bandwidths (1, 1):
18
- 1.0 1.0 ⋅ ⋅ ⋅
19
- 1.0 1.0 1.0 ⋅ ⋅
20
- ⋅ 1.0 1.0 1.0 ⋅
21
- ⋅ ⋅ 1.0 1.0 1.0
22
- ⋅ ⋅ ⋅ 1.0 1.0
16
+ julia> A = BandedMatrix(0=>1:4, 1=>5:7, -1=>8:10)
17
+ 4×4 BandedMatrix{Int64} with bandwidths (1, 1):
18
+ 1 5 ⋅ ⋅
19
+ 8 2 6 ⋅
20
+ ⋅ 9 3 7
21
+ ⋅ ⋅ 10 4
23
22
24
23
julia> A[band(1)]
25
- 4-element Vector{Float64}:
26
- 1.0
27
- 1.0
28
- 1.0
29
- 1.0
24
+ 3-element Vector{Int64}:
25
+ 5
26
+ 6
27
+ 7
28
+
29
+ julia> A[band(0)]
30
+ 4-element Vector{Int64}:
31
+ 1
32
+ 2
33
+ 3
34
+ 4
35
+
36
+ julia> A[band(-1)]
37
+ 3-element Vector{Int64}:
38
+ 8
39
+ 9
40
+ 10
30
41
```
31
42
"""
32
43
band (i:: Int ) = Band (i)
@@ -41,19 +52,18 @@ Represents the entries in a row/column inside the bands.
41
52
```jldoctest
42
53
julia> using BandedMatrices
43
54
44
- julia> A = BandedMatrix(Ones(5,5),(1,1))
45
- 5×5 BandedMatrix{Float64} with bandwidths (1, 1):
46
- 1.0 1.0 ⋅ ⋅ ⋅
47
- 1.0 1.0 1.0 ⋅ ⋅
48
- ⋅ 1.0 1.0 1.0 ⋅
49
- ⋅ ⋅ 1.0 1.0 1.0
50
- ⋅ ⋅ ⋅ 1.0 1.0
51
-
52
- julia> A[2,BandRange]
53
- 3-element Vector{Float64}:
54
- 1.0
55
- 1.0
56
- 1.0
55
+ julia> A = BandedMatrix(0=>1:4, 1=>5:7, -1=>8:10)
56
+ 4×4 BandedMatrix{Int64} with bandwidths (1, 1):
57
+ 1 5 ⋅ ⋅
58
+ 8 2 6 ⋅
59
+ ⋅ 9 3 7
60
+ ⋅ ⋅ 10 4
61
+
62
+ julia> A[2, BandRange]
63
+ 3-element Vector{Int64}:
64
+ 8
65
+ 2
66
+ 6
57
67
```
58
68
"""
59
69
const BandRange = BandRangeType ()
0 commit comments