Skip to content

Commit fdb1764

Browse files
committed
undo unnecessary doc change
1 parent c2cfe9f commit fdb1764

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

docs/src/man/blockarrays.md

+16-25
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ end
1111
An `AbstractArray` can be repacked into a `BlockArray` with `BlockArray(array, block_sizes...)`. The block sizes are each an `AbstractVector{Int}` which determines the size of the blocks in that dimension (so the sum of `block_sizes` in every dimension must match the size of `array` in that dimension).
1212

1313
```jldoctest
14-
julia> BlockArray(Array(reshape(1:16, 4, 4)), [1,3], [1,1,2])
14+
julia> BlockArray(Array(reshape(1:16, 4, 4)), [2,2], [1,1,2])
1515
2×3-blocked 4×4 BlockMatrix{Int64}:
1616
1 │ 5 │ 9 13
17-
───┼─────┼────────
1817
2 │ 6 │ 10 14
18+
───┼─────┼────────
1919
3 │ 7 │ 11 15
2020
4 │ 8 │ 12 16
2121
@@ -138,36 +138,27 @@ julia> block_array[1, 2]
138138

139139
To view and modify blocks of `BlockArray` use the `view` syntax.
140140
```jldoctest
141-
julia> A = BlockArray([11:16;], 1:3)
142-
3-blocked 6-element BlockVector{Int64, Vector{Vector{Int64}}, Tuple{BlockedOneTo{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}}}:
143-
11
144-
──
145-
12
146-
13
147-
──
148-
14
149-
15
150-
16
141+
julia> A = BlockArray(ones(6), 1:3);
151142
152143
julia> view(A, Block(2))
153-
2-element Vector{Int64}:
154-
12
155-
13
156-
157-
julia> view(A, Block(2)) .= [3,4];
144+
2-element Vector{Float64}:
145+
1.0
146+
1.0
158147
159-
julia> A[Block(2)]
160-
2-element Vector{Int64}:
161-
3
162-
4
148+
julia> view(A, Block(2)) .= [3,4]; A[Block(2)]
149+
2-element Vector{Float64}:
150+
3.0
151+
4.0
163152
164153
julia> view(A, Block.(1:2))
165-
3-element view(::BlockVector{Int64, Vector{Vector{Int64}}, Tuple{BlockedOneTo{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}}}, BlockSlice(BlockRange(1:2),1:1:3)) with eltype Int64 with indices BlockedOneTo([1, 3]):
166-
11
167-
3
168-
4
154+
3-element view(::BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedOneTo{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}}}, BlockSlice(BlockRange(1:2),1:1:3)) with eltype Float64 with indices BlockedOneTo([1, 3]):
155+
1.0
156+
3.0
157+
4.0
169158
```
170159

160+
161+
171162
## Converting between `BlockArray` and normal arrays
172163

173164
An array can be repacked into a `BlockArray` with `BlockArray(array, block_sizes...)`:

0 commit comments

Comments
 (0)