|
145 | 145 | return (inds[1][I[1]], to_indices(a, Base.tail(inds), Base.tail(I))...) |
146 | 146 | end |
147 | 147 |
|
| 148 | +# a[mortar([Block(1)[1:2], Block(2)[1:3]]), mortar([Block(1)[1:2], Block(2)[1:3]])] |
| 149 | +# a[[Block(1)[1:2], Block(2)[1:3]], [Block(1)[1:2], Block(2)[1:3]]] |
| 150 | +@interface ::AbstractBlockSparseArrayInterface function Base.to_indices( |
| 151 | + a, inds, I::Tuple{BlockVector{<:BlockIndex{1},<:Vector{<:BlockIndexRange{1}}},Vararg{Any}} |
| 152 | +) |
| 153 | + # TODO: Use a type like `BlockSlice` to keep track of the blocks. |
| 154 | + # See https://github.com/JuliaArrays/BlockArrays.jl/pull/459. |
| 155 | + I1 = blockedunitrange_getindices(inds[1], I[1]) |
| 156 | + return (I1, to_indices(a, Base.tail(inds), Base.tail(I))...) |
| 157 | +end |
| 158 | + |
| 159 | +# a[mortar([Block(1)[1:2], Block(2)[1:3]]), mortar([Block(1)[1:2], Block(2)[1:3]])] |
| 160 | +# a[[Block(1)[1:2], Block(2)[1:3]], [Block(1)[1:2], Block(2)[1:3]]] |
| 161 | +@interface ::AbstractBlockSparseArrayInterface function Base.to_indices( |
| 162 | + a, inds, I::Tuple{BlockVector{<:BlockIndex{1},<:Vector{<:BlockIndexRange{1}}},Vararg{Any}} |
| 163 | +) |
| 164 | + # TODO: Use a type like `BlockSlice` to keep track of the blocks. |
| 165 | + # See https://github.com/JuliaArrays/BlockArrays.jl/pull/459. |
| 166 | + I1 = blockedunitrange_getindices(inds[1], I[1]) |
| 167 | + return (I1, to_indices(a, Base.tail(inds), Base.tail(I))...) |
| 168 | +end |
| 169 | + |
148 | 170 | # TODO: Need to implement this! |
149 | 171 | function block_merge end |
150 | 172 |
|
|
0 commit comments