Skip to content

Commit 82f65b1

Browse files
committed
Fix Adjoint/Transpose * BlockBanded
1 parent 629276d commit 82f65b1

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BlockBandedMatrices"
22
uuid = "ffab5731-97b5-5995-9138-79e8c1846df0"
3-
version = "0.13.4"
3+
version = "0.13.5"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/linalg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const SubBlockSkylineMatrix{T,LL,UU,R1,R2} =
55

66

77

8-
function add_bandwidths(A::AbstractBlockBandedMatrix,B::AbstractBlockBandedMatrix)
8+
function add_bandwidths(A, B)
99
Al,Au = colblockbandwidths(A)
1010
Bl,Bu = colblockbandwidths(B)
1111

@@ -24,7 +24,7 @@ function add_bandwidths(A::AbstractBlockBandedMatrix,B::AbstractBlockBandedMatri
2424
l,u
2525
end
2626

27-
function add_bandwidths(A::BlockBandedMatrix,B::BlockBandedMatrix)
27+
function add_bandwidths(A::BlockBandedMatrix, B::BlockBandedMatrix)
2828
l,u = blockbandwidths(A) .+ blockbandwidths(B)
2929
Fill(l,blocksize(B,2)), Fill(u,blocksize(B,2))
3030
end

test/test_adjtransblockbanded.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,18 @@ import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows,
6363
@test rowsupport(E2, 1) == 1:0
6464
@test colsupport(E2', 1) == 1:0
6565
end
66+
67+
@testset "Adj*BlockBanded" begin
68+
R = BlockBandedMatrix{Float64}(undef, [1,1,2,2,3], 1:2:9, (0,0)); fill!(R, 0)
69+
for K = 1:N
70+
for k = 1:(K÷2)
71+
R[Block(K,K)[k,2k-1]] = R[Block(K,K)[k,2K-2k+1]] = 1/sqrt(2)
72+
end
73+
isodd(K) && (R[Block(K,K)[K÷2+1,K]] = 1)
74+
end
75+
@test R'R == Matrix(R)'R
76+
@test R*R' I
77+
end
6678
end
6779

6880
end # module

0 commit comments

Comments
 (0)