|
81 | 81 |
|
82 | 82 | MemoryLayout(::Type{<:AlmostBandedMatrix}) = AlmostBandedLayout() |
83 | 83 |
|
| 84 | +""" |
| 85 | + finish_part_setindex!(A::AlmostBandedMatrix) |
| 86 | + finish_part_setindex!(bands, fill) |
| 87 | +
|
| 88 | +Synchronize the overlapping region between the banded part and the fill part of an |
| 89 | +`AlmostBandedMatrix`. This function copies values from the `fill` part into the |
| 90 | +corresponding positions in the `bands` part where they overlap. |
| 91 | +
|
| 92 | +This is automatically called during construction but may need to be called manually if |
| 93 | +the fill part is modified directly after construction. |
| 94 | +""" |
84 | 95 | @inline function finish_part_setindex!(A) |
85 | 96 | return finish_part_setindex!(bandpart(A), fillpart(A)) |
86 | 97 | end |
|
97 | 108 | """ |
98 | 109 | bandpart(A::AlmostBandedMatrix) |
99 | 110 |
|
100 | | -Banded Part of the AlmostBandedMatrix. |
| 111 | +Return the banded part of the `AlmostBandedMatrix`. This is a `BandedMatrix` that stores |
| 112 | +the banded structure including the overlapping region with the fill part. |
| 113 | +
|
| 114 | +# Example |
| 115 | +```julia |
| 116 | +A = AlmostBandedMatrix(brand(Float64, 10, 10, 3, 2), rand(Float64, 2, 10)) |
| 117 | +B = bandpart(A) # Returns the BandedMatrix component |
| 118 | +``` |
101 | 119 | """ |
102 | 120 | @inline bandpart(A::AlmostBandedMatrix) = A.bands |
103 | 121 |
|
104 | 122 | """ |
105 | 123 | fillpart(A::AlmostBandedMatrix) |
106 | 124 |
|
107 | | -Fill Part of the AlmostBandedMatrix. |
| 125 | +Return the fill part of the `AlmostBandedMatrix`. This is typically a low-rank matrix that |
| 126 | +represents additional structure beyond the banded part. The fill part overlaps with the |
| 127 | +first `almostbandedrank(A)` rows of the banded part. |
| 128 | +
|
| 129 | +# Example |
| 130 | +```julia |
| 131 | +A = AlmostBandedMatrix(brand(Float64, 10, 10, 3, 2), rand(Float64, 2, 10)) |
| 132 | +F = fillpart(A) # Returns the fill matrix (2×10) |
| 133 | +``` |
108 | 134 | """ |
109 | 135 | @inline fillpart(A::AlmostBandedMatrix) = A.fill |
110 | 136 |
|
111 | 137 | """ |
112 | 138 | exclusive_bandpart(A::AlmostBandedMatrix) |
113 | 139 |
|
114 | | -Banded Part of the AlmostBandedMatrix without the overlapping part. |
| 140 | +Return the banded part of the `AlmostBandedMatrix` excluding the rows that overlap with |
| 141 | +the fill part. This is a view of the banded matrix starting from row |
| 142 | +`almostbandedrank(A) + 1`. |
| 143 | +
|
| 144 | +# Example |
| 145 | +```julia |
| 146 | +A = AlmostBandedMatrix(brand(Float64, 10, 10, 3, 2), rand(Float64, 2, 10)) |
| 147 | +E = exclusive_bandpart(A) # Returns a view of rows 3:10 of the banded part |
| 148 | +``` |
115 | 149 | """ |
116 | 150 | @inline function exclusive_bandpart(A) |
117 | 151 | B, F = bandpart(A), fillpart(A) |
|
0 commit comments