Skip to content

Commit 78043db

Browse files
committed
Add BlockSkylineLayout
1 parent a0682e0 commit 78043db

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/AbstractBlockBandedMatrix.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const BandedBlockBandedRowMajor = BandedBlockBandedRows{ColumnMajor}
2929
const BlockBandedColumnMajor = BlockBandedColumns{ColumnMajor}
3030
const BlockBandedRowMajor = BlockBandedRows{ColumnMajor}
3131

32+
blockbandedcolumns(lay) = BlockBandedColumns{typeof(lay)}()
33+
3234
transposelayout(::BandedBlockBandedColumns{Lay}) where Lay = BandedBlockBandedRows{Lay}()
3335
transposelayout(::BandedBlockBandedRows{Lay}) where Lay = BandedBlockBandedColumns{Lay}()
3436
transposelayout(::BlockBandedColumns{Lay}) where Lay = BlockBandedRows{Lay}()

src/BlockSkylineMatrix.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,12 @@ axes(A::BlockSkylineMatrix) = A.block_sizes.axes
366366
# BlockSkylineMatrix Interface #
367367
################################
368368

369-
MemoryLayout(::Type{<:BlockSkylineMatrix}) = BlockBandedColumnMajor()
369+
struct BlockSkylineColumns{Lay} <: AbstractBlockLayout end
370+
371+
blockskylinelayout(lay, ::Type{<:BlockBandedSizes}) = blockbandedcolumns(lay)
372+
blockskylinelayout(lay, _) = BlockSkylineColumns{typeof(lay)}()
373+
374+
MemoryLayout(::Type{<:BlockSkylineMatrix{T,DATA,BS}}) where {T,DATA,BS} = blockskylinelayout(MemoryLayout(DATA), BS)
370375
colblockbandwidths(A::BlockSkylineMatrix) = (A.block_sizes.l, A.block_sizes.u)
371376
blockbandwidths(A::BlockSkylineMatrix) = maximum.(colblockbandwidths(A))
372377
BroadcastStyle(::Type{<:BlockSkylineMatrix}) = BlockSkylineStyle()

0 commit comments

Comments
 (0)