Skip to content

Commit 7994e08

Browse files
committed
tests pass
1 parent b76cd02 commit 7994e08

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

src/AbstractBlockBandedMatrix.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,19 @@ struct BlockBandedColumns{LAY} <: AbstractBlockBandedLayout end
2525
struct BlockBandedRows{LAY} <: AbstractBlockBandedLayout end
2626

2727
const BandedBlockBandedColumnMajor = BandedBlockBandedColumns{ColumnMajor}
28-
const BandedBlockBandedRowMajor = BandedBlockBandedColumns{RowMajor}
28+
const BandedBlockBandedRowMajor = BandedBlockBandedRows{ColumnMajor}
2929
const BlockBandedColumnMajor = BlockBandedColumns{ColumnMajor}
30-
const BlockBandedRowMajor = BlockBandedColumns{RowMajor}
30+
const BlockBandedRowMajor = BlockBandedRows{ColumnMajor}
3131

32-
transposelayout(::BandedBlockBandedColumnMajor) = BandedBlockBandedRowMajor()
33-
transposelayout(::BandedBlockBandedRowMajor) = BandedBlockBandedColumnMajor()
34-
transposelayout(::BlockBandedColumnMajor) = BlockBandedRowMajor()
35-
transposelayout(::BlockBandedRowMajor) = BlockBandedColumnMajor()
32+
transposelayout(::BandedBlockBandedColumns{Lay}) where Lay = BandedBlockBandedRows{Lay}()
33+
transposelayout(::BandedBlockBandedRows{Lay}) where Lay = BandedBlockBandedColumns{Lay}()
34+
transposelayout(::BlockBandedColumns{Lay}) where Lay = BlockBandedRows{Lay}()
35+
transposelayout(::BlockBandedRows{Lay}) where Lay = BlockBandedColumns{Lay}()
3636

37+
conjlayout(::Type{T}, ::BandedBlockBandedColumns{Lay}) where {T<:Complex,Lay} = BandedBlockBandedColumns{typeof(conjlayout(T,Lay))}()
38+
conjlayout(::Type{T}, ::BandedBlockBandedRows{Lay}) where {T<:Complex,Lay} = BandedBlockBandedRows{typeof(conjlayout(T,Lay))}()
39+
conjlayout(::Type{T}, ::BlockBandedColumns{Lay}) where {T<:Complex,Lay} = BlockBandedColumns{typeof(conjlayout(T,Lay))}()
40+
conjlayout(::Type{T}, ::BlockBandedRows{Lay}) where {T<:Complex,Lay} = BlockBandedRows{typeof(conjlayout(T,Lay))}()
3741

3842

3943
# AbstractBandedMatrix must implement

src/BlockBandedMatrices.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import ArrayLayouts: BlasMatLmulVec, MatLmulVec, MatLmulMat,
2727
AbstractColumnMajor, DenseColumnMajor, ColumnMajor,
2828
DiagonalLayout, MulAdd, mul, colsupport, rowsupport,
2929
_qr, _factorize, _copyto!, zero!, layout_replace_in_print_matrix,
30-
transposelayout
30+
transposelayout, conjlayout
3131

3232
import BlockArrays: blocksize, blockcheckbounds, BlockedUnitRange, blockisequal, DefaultBlockAxis,
3333
Block, BlockSlice, unblock, block, blockindex,

test/test_adjtransblockbanded.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
using BlockBandedMatrices
1+
using BlockBandedMatrices, ArrayLayouts, Test
2+
import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows
23

34
@testset "Adj/Trans" begin
45
A = BandedBlockBandedMatrix(randn(ComplexF64,10,14), 1:4,2:5, (1,2), (2,1))
56

7+
@test MemoryLayout(transpose(A)) isa BandedBlockBandedRowMajor
8+
@test MemoryLayout(A') isa BandedBlockBandedRows
9+
610
@test A'[Block(1,1)] == A[Block(1,1)]'
711
@test A'[Block(2,3)] == A[Block(3,2)]'
812
@test transpose(A)[Block(1,1)] == transpose(A[Block(1,1)])

0 commit comments

Comments
 (0)