Skip to content

Commit 0d9f6f2

Browse files
authored
Fix doctests, upgrade Documenter. (#201)
1 parent 0d30a97 commit 0d9f6f2

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33

44
[compat]
5-
Documenter = "= 0.26.0"
5+
Documenter = "0.27"

docs/src/man/blockarrays.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ julia> block_array = BlockArray{Float64}(undef_blocks, [1,2], [2,2])
100100
101101
julia> block_array[Block(2,1)] = rand(2,2)
102102
2×2 Matrix{Float64}:
103-
0.590845 0.566237
104-
0.766797 0.460085
103+
0.325977 0.218587
104+
0.549051 0.894245
105105
106106
julia> block_array[Block(1),Block(1)] = [1 2];
107107
108108
julia> block_array
109109
2×2-blocked 3×4 BlockMatrix{Float64}:
110110
1.0 2.0 │ #undef #undef
111111
────────────────────┼────────────────
112-
0.590845 0.566237 │ #undef #undef
113-
0.766797 0.460085 │ #undef #undef
112+
0.325977 0.218587 │ #undef #undef
113+
0.549051 0.894245 │ #undef #undef
114114
```
115115

116116
Note that this will "take ownership" of the passed in array, that is, no copy is made.

docs/src/man/pseudoblockarrays.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Creating a `PseudoBlockArray` works in the same way as a `BlockArray`.
2424
```jldoctest A
2525
julia> pseudo = PseudoBlockArray(rand(3,3), [1,2], [2,1])
2626
2×2-blocked 3×3 PseudoBlockMatrix{Float64}:
27-
0.590845 0.460085 │ 0.200586
28-
────────────────────┼──────────
29-
0.766797 0.794026 │ 0.298614
30-
0.566237 0.854147 │ 0.246837
27+
0.579862 0.0149088 │ 0.839622
28+
────────────────────┼──────────
29+
0.411294 0.520355 │ 0.967143
30+
0.972136 0.639562 │ 0.131026
3131
```
3232

3333
This "takes ownership" of the passed in array so no copy of the array is made.
@@ -63,15 +63,15 @@ julia> copyto!(A, view(pseudo, Block(2, 1)));
6363
6464
julia> A
6565
2×2 Matrix{Float64}:
66-
0.766797 0.794026
67-
0.566237 0.854147
66+
0.411294 0.520355
67+
0.972136 0.639562
6868
```
6969

7070
It is sometimes convenient to access an index in a certain block. We could of course write this as `A[Block(I,J)][i,j]` but the problem is that `A[Block(I,J)]` allocates its output so this type of indexing will be inefficient. Instead, it is possible to use the `A[BlockIndex((I,J), (i,j))]` indexing. Using the same block matrix `A` as above:
7171

7272
```jldoctest A
7373
julia> pseudo[BlockIndex((2,1), (2,2))]
74-
0.8541465903790502
74+
0.6395615996802734
7575
```
7676

7777
The underlying array is accessed with `Array` just like for `BlockArray`.

src/abstractblockarray.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ julia> A = BlockArray(v, [1,1], [2,1])
156156
157157
julia> Matrix.(collect(eachblock(A)))
158158
2×2 Matrix{Matrix{Int64}}:
159-
[1 3] [5]
160-
[2 4] [6]
159+
[1 3] [5;;]
160+
[2 4] [6;;]
161161
162162
julia> sum.(eachblock(A))
163163
2×2 Matrix{Int64}:

src/pseudo_blockarray.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ julia> Random.seed!(12345);
2424
2525
julia> A = PseudoBlockArray(rand(2,3), [1,1], [2,1])
2626
2×2-blocked 2×3 PseudoBlockMatrix{Float64}:
27-
0.562714 0.371605 │ 0.381128
27+
0.944791 0.339612 │ 0.322501
2828
────────────────────┼──────────
29-
0.849939 0.283365 │ 0.365801
29+
0.866895 0.136117 │ 0.252549
3030
3131
julia> A = PseudoBlockArray(sprand(6, 0.5), [3,2,1])
3232
3-blocked 6-element PseudoBlockVector{Float64, SparseVector{Float64, Int64}, Tuple{BlockedUnitRange{Vector{Int64}}}}:
3333
0.0
34-
0.5865981007905481
3534
0.0
35+
0.26755021483368013
3636
───────────────────
37-
0.05016684053503706
3837
0.0
38+
0.11848853125656122
3939
───────────────────
4040
0.0
4141
```

0 commit comments

Comments
 (0)