@@ -39,15 +39,14 @@ struct BandedBlockBandedMatrix{T, BLOCKS, RAXIS<:AbstractUnitRange{Int}} <: Abst
39
39
end
40
40
end
41
41
42
- const DefaultBandedBlockBandedMatrix{T} = BandedBlockBandedMatrix{T, PseudoBlockMatrix {T, Matrix{T}, NTuple{2 ,DefaultBlockAxis}}, DefaultBlockAxis}
42
+ const DefaultBandedBlockBandedMatrix{T} = BandedBlockBandedMatrix{T, BlockedMatrix {T, Matrix{T}, NTuple{2 ,DefaultBlockAxis}}, DefaultBlockAxis}
43
43
44
44
@inline _BandedBlockBandedMatrix (data:: AbstractMatrix , axes:: NTuple{2,AbstractUnitRange{Int}} , lu:: NTuple{2,Int} , λμ:: NTuple{2,Int} ) =
45
- _BandedBlockBandedMatrix (PseudoBlockArray (data,(blockedrange (Fill (sum (λμ)+ 1 ,sum (lu)+ 1 )),axes[2 ])), axes[1 ], lu, λμ)
45
+ _BandedBlockBandedMatrix (BlockedArray (data,(blockedrange (Fill (sum (λμ)+ 1 ,sum (lu)+ 1 )),axes[2 ])), axes[1 ], lu, λμ)
46
46
47
47
@inline _BandedBlockBandedMatrix (data:: AbstractMatrix ,rblocksizes:: AbstractVector{Int} , cblocksizes:: AbstractVector{Int} , lu:: NTuple{2,Int} , λμ:: NTuple{2,Int} ) =
48
48
_BandedBlockBandedMatrix (data, (blockedrange (rblocksizes),blockedrange (cblocksizes)), lu, λμ)
49
49
50
- _blocklengths2blocklasts (b:: Fill ) = cumsum (b)
51
50
_bbb_data_axes (caxes, lu, λμ) = (blockedrange (Fill (max (0 ,sum (λμ)+ 1 ),max (0 ,sum (lu)+ 1 ))),caxes)
52
51
53
52
BandedBlockBandedMatrix {T,B,R} (:: UndefInitializer , axes:: NTuple{2,AbstractUnitRange{Int}} , lu:: NTuple{2,Int} , λμ:: NTuple{2,Int} ) where {T,B,R<: AbstractUnitRange{Int} } =
@@ -61,7 +60,7 @@ BandedBlockBandedMatrix{T,B}(::UndefInitializer, rblocksizes::AbstractVector{Int
61
60
BandedBlockBandedMatrix {T,B} (undef, (blockedrange (rblocksizes),blockedrange (cblocksizes)), lu, λμ)
62
61
63
62
BandedBlockBandedMatrix {T} (:: UndefInitializer , axes:: NTuple{2,AbstractUnitRange{Int}} , lu:: NTuple{2,Int} , λμ:: NTuple{2,Int} ) where T =
64
- _BandedBlockBandedMatrix (PseudoBlockMatrix {T} (undef, _bbb_data_axes (axes[2 ],lu,λμ)), axes[1 ], lu, λμ)
63
+ _BandedBlockBandedMatrix (BlockedMatrix {T} (undef, _bbb_data_axes (axes[2 ],lu,λμ)), axes[1 ], lu, λμ)
65
64
"""
66
65
BandedBlockBandedMatrix{T}(undef, rows, cols, (l, u), (λ, μ))
67
66
@@ -242,11 +241,11 @@ convert(::Type{AbstractMatrix{T}}, B::BandedBlockBandedMatrix{T}) where T = B
242
241
similar (A:: BandedBlockBandedMatrix , :: Type{T} , axes:: NTuple{2,AbstractUnitRange{Int}} ) where T =
243
242
BandedBlockBandedMatrix {T} (undef, axes, blockbandwidths (A), subblockbandwidths (A))
244
243
245
- @inline similar (A:: BandedBlockBandedMatrix , :: Type{T} , axes:: Tuple{BlockedUnitRange ,AbstractUnitRange{Int}} ) where T =
244
+ @inline similar (A:: BandedBlockBandedMatrix , :: Type{T} , axes:: Tuple{AbstractBlockedUnitRange ,AbstractUnitRange{Int}} ) where T =
246
245
BandedBlockBandedMatrix {T} (undef, axes, blockbandwidths (A), subblockbandwidths (A))
247
- @inline similar (A:: BandedBlockBandedMatrix , :: Type{T} , axes:: Tuple{AbstractUnitRange{Int},BlockedUnitRange } ) where T =
246
+ @inline similar (A:: BandedBlockBandedMatrix , :: Type{T} , axes:: Tuple{AbstractUnitRange{Int},AbstractBlockedUnitRange } ) where T =
248
247
BandedBlockBandedMatrix {T} (undef, axes, blockbandwidths (A), subblockbandwidths (A))
249
- @inline similar (A:: BandedBlockBandedMatrix , :: Type{T} , axes:: Tuple{BlockedUnitRange,BlockedUnitRange } ) where T =
248
+ @inline similar (A:: BandedBlockBandedMatrix , :: Type{T} , axes:: Tuple{AbstractBlockedUnitRange,AbstractBlockedUnitRange } ) where T =
250
249
BandedBlockBandedMatrix {T} (undef, axes, blockbandwidths (A), subblockbandwidths (A))
251
250
252
251
@@ -289,7 +288,7 @@ subblockbandwidths(A::BandedBlockBandedMatrix) = (A.λ, A.μ)
289
288
# default is to use whole block
290
289
_subblockbandwidths (A:: AbstractMatrix , :: NTuple{2,OneTo{Int}} ) = bandwidths (A)
291
290
function _subblockbandwidths (A:: AbstractMatrix , _)
292
- M,N = map (maximum, blocksizes (A ))
291
+ M,N = map (maximum, blocklengths .( axes (A) ))
293
292
M- 1 ,N- 1
294
293
end
295
294
@@ -401,7 +400,7 @@ const SubBandedBlockBandedMatrix{T,R1,R2} =
401
400
SubArray{T,2 ,<: BandedBlockBandedMatrix{T} ,<: Tuple{BlockSlice{R1},BlockSlice{R2}} }
402
401
403
402
const SingleBlockInd = Union{BlockSlice1, BlockSlice{<: BlockIndexRange1 }}
404
- const BlockRangeInd = Union{BlockSlices, BlockedUnitRange }
403
+ const BlockRangeInd = Union{BlockSlices, AbstractBlockedUnitRange }
405
404
406
405
sublayout (:: BandedBlockBandedColumns{ML} , :: Type{II} ) where {ML,II<: Tuple{SingleBlockInd,SingleBlockInd} } = bandedcolumns (sublayout (ML (), II))
407
406
sublayout (:: BandedBlockBandedColumns{ML} , :: Type{II} ) where {ML,II<: Tuple{BlockRangeInd,BlockRangeInd} } = bandedblockbandedcolumns (sublayout (ML (), II))
@@ -410,7 +409,7 @@ sublayout(::BandedBlockBandedColumns{ML}, ::Type{II}) where {ML,II<:Tuple{BlockR
410
409
411
410
_blockaxes1 (A:: BlockSlice ) = A. block
412
411
_blockaxes1 (A:: Slice ) = _blockaxes1 (A. indices)
413
- _blockaxes1 (A:: BlockedUnitRange ) = blockaxes (A,1 )
412
+ _blockaxes1 (A:: AbstractBlockedUnitRange ) = blockaxes (A,1 )
414
413
blockbandshift (A, B) = BandedMatrices. bandshift (Int .(_blockaxes1 (A)), Int .(_blockaxes1 (B)))
415
414
blockbandshift (S) = blockbandshift (parentindices (S)... )
416
415
@@ -427,13 +426,11 @@ sublayout(::AbstractBandedBlockBandedLayout, ::Type{<:Tuple{BlockRangeInd,Single
427
426
428
427
429
428
sub_materialize (:: AbstractBandedBlockBandedLayout , V, _) = BandedBlockBandedMatrix (V)
430
- sub_materialize (:: AbstractBandedBlockBandedLayout , V, :: Tuple{<:BlockedUnitRange,<:BlockedUnitRange } ) = BandedBlockBandedMatrix (V)
431
- sub_materialize (:: AbstractBandedBlockBandedLayout , V, :: Tuple{<: AbstractUnitRange,<:BlockedUnitRange } ) = PseudoBlockArray (V)
432
- sub_materialize (:: AbstractBandedBlockBandedLayout , V, :: Tuple{<:BlockedUnitRange,<: AbstractUnitRange} ) = PseudoBlockArray (V)
429
+ sub_materialize (:: AbstractBandedBlockBandedLayout , V, :: Tuple{AbstractBlockedUnitRange,AbstractBlockedUnitRange } ) = BandedBlockBandedMatrix (V)
430
+ sub_materialize (:: AbstractBandedBlockBandedLayout , V, :: Tuple{AbstractUnitRange,AbstractBlockedUnitRange } ) = BlockedArray (V)
431
+ sub_materialize (:: AbstractBandedBlockBandedLayout , V, :: Tuple{AbstractBlockedUnitRange, AbstractUnitRange} ) = BlockedArray (V)
433
432
434
433
435
- sub_materialize (:: AbstractBandedLayout , V, :: Tuple{<:BlockedUnitRange,<:BlockedUnitRange} ) = BandedMatrix (V)
436
-
437
434
438
435
isbanded (A:: SubArray{<:Any,2,<:BandedBlockBandedMatrix} ) = MemoryLayout (A) isa AbstractBandedLayout
439
436
isbandedblockbanded (A:: SubArray{<:Any,2,<:BandedBlockBandedMatrix} ) = MemoryLayout (A) isa AbstractBandedBlockBandedLayout
@@ -442,7 +439,7 @@ isbandedblockbanded(A::SubArray{<:Any,2,<:BandedBlockBandedMatrix}) = MemoryLayo
442
439
subblockbandwidths (V:: SubArray ) = subblockbandwidths (parent (V))
443
440
444
441
445
- _firstblock (B:: BlockedUnitRange ) = Int (first (blockaxes (B,1 )))
442
+ _firstblock (B:: AbstractBlockedUnitRange ) = Int (first (blockaxes (B,1 )))
446
443
_firstblock (B:: Block{1} ) = Int (B)
447
444
_firstblock (B:: BlockIndexRange ) = _firstblock (B. block)
448
445
_firstblock (B:: BlockRange ) = first (B. indices[1 ])
0 commit comments