|
1 | 1 | using BlockBandedMatrices, ArrayLayouts, Test
|
2 |
| -import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows |
| 2 | +import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows, BandedBlockBandedColumns,BlockBandedRows, BlockBandedColumns |
3 | 3 |
|
4 | 4 | @testset "Adj/Trans" begin
|
5 |
| - A = BandedBlockBandedMatrix(randn(ComplexF64,10,14), 1:4,2:5, (1,2), (2,1)) |
| 5 | + @testset "BandedBlockBanded" begin |
| 6 | + A = BandedBlockBandedMatrix(randn(ComplexF64,10,14), 1:4,2:5, (1,2), (2,1)) |
6 | 7 |
|
7 |
| - @test MemoryLayout(transpose(A)) isa BandedBlockBandedRowMajor |
8 |
| - @test MemoryLayout(A') isa BandedBlockBandedRows |
| 8 | + @test MemoryLayout(transpose(A)) isa BandedBlockBandedRowMajor |
| 9 | + @test MemoryLayout(A') isa BandedBlockBandedRows |
| 10 | + @test MemoryLayout(transpose(A)') isa BandedBlockBandedColumns |
9 | 11 |
|
10 |
| - @test A'[Block(1,1)] == A[Block(1,1)]' |
11 |
| - @test A'[Block(2,3)] == A[Block(3,2)]' |
12 |
| - @test transpose(A)[Block(1,1)] == transpose(A[Block(1,1)]) |
13 |
| - @test transpose(A)[Block(2,3)] == transpose(A[Block(3,2)]) |
| 12 | + @test A'[Block(1,1)] == A[Block(1,1)]' |
| 13 | + @test A'[Block(2,3)] == A[Block(3,2)]' |
| 14 | + @test transpose(A)[Block(1,1)] == transpose(A[Block(1,1)]) |
| 15 | + @test transpose(A)[Block(2,3)] == transpose(A[Block(3,2)]) |
14 | 16 |
|
15 |
| - @test blockbandwidths(A') == blockbandwidths(transpose(A)) == (2,1) |
16 |
| - @test subblockbandwidths(A') == subblockbandwidths(transpose(A)) == (1,2) |
| 17 | + @test blockbandwidths(A') == blockbandwidths(transpose(A)) == (2,1) |
| 18 | + @test subblockbandwidths(A') == subblockbandwidths(transpose(A)) == (1,2) |
17 | 19 |
|
18 |
| - @test BandedBlockBandedMatrix(A') == A' |
19 |
| - @test BandedBlockBandedMatrix(transpose(A)) == transpose(A) |
| 20 | + @test BandedBlockBandedMatrix(A') == A' |
| 21 | + @test BandedBlockBandedMatrix(transpose(A)) == transpose(A) |
| 22 | + end |
| 23 | + |
| 24 | + @testset "BlockBanded" begin |
| 25 | + A = BlockBandedMatrix(randn(ComplexF64,10,14), 1:4,2:5, (1,2)) |
| 26 | + |
| 27 | + @test MemoryLayout(transpose(A)) isa BlockBandedRows |
| 28 | + @test MemoryLayout(A') isa BlockBandedRows |
| 29 | + @test MemoryLayout(transpose(A)') isa BlockBandedColumns |
| 30 | + |
| 31 | + @test A'[Block(1,1)] == A[Block(1,1)]' |
| 32 | + @test A'[Block(2,3)] == A[Block(3,2)]' |
| 33 | + @test transpose(A)[Block(1,1)] == transpose(A[Block(1,1)]) |
| 34 | + @test transpose(A)[Block(2,3)] == transpose(A[Block(3,2)]) |
| 35 | + |
| 36 | + @test blockbandwidths(A') == blockbandwidths(transpose(A)) == (2,1) |
| 37 | + |
| 38 | + @test BlockBandedMatrix(A') == A' |
| 39 | + @test BlockBandedMatrix(transpose(A)) == transpose(A) |
| 40 | + end |
20 | 41 | end
|
0 commit comments