Skip to content

Commit 7f6a618

Browse files
committed
increase coverage
1 parent 36550bc commit 7f6a618

File tree

2 files changed

+35
-12
lines changed

2 files changed

+35
-12
lines changed

test/test_adjtransblockbanded.jl

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
using BlockBandedMatrices, ArrayLayouts, Test
2-
import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows
2+
import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows, BandedBlockBandedColumns,BlockBandedRows, BlockBandedColumns
33

44
@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))
67

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
911

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)])
1416

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)
1719

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
2041
end

test/test_misc.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ end
5151
@testset "MyBlockBandedMatrix" begin
5252
A = MyBlockBandedMatrix(BlockMatrix(randn(6,6), 1:3, 1:3))
5353
@test MemoryLayout(A) isa BlockBandedMatrices.BlockBandedLayout
54+
@test MemoryLayout(A') isa BlockBandedMatrices.BlockBandedLayout
55+
@test MemoryLayout(transpose(A)) isa BlockBandedMatrices.BlockBandedLayout
5456
@test A[Block(3,3)] == A.A[Block(3,3)]
5557
@test A[Block.(1:3),Block.(1:3)] == A
5658

0 commit comments

Comments
 (0)