Skip to content

Fix Adjoint/Transpose * BlockBanded #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "BlockBandedMatrices"
uuid = "ffab5731-97b5-5995-9138-79e8c1846df0"
version = "0.13.4"
version = "0.13.5"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
4 changes: 2 additions & 2 deletions src/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@



function add_bandwidths(A::AbstractBlockBandedMatrix,B::AbstractBlockBandedMatrix)
function add_bandwidths(A, B)

Check warning on line 8 in src/linalg.jl

View check run for this annotation

Codecov / codecov/patch

src/linalg.jl#L8

Added line #L8 was not covered by tests
Al,Au = colblockbandwidths(A)
Bl,Bu = colblockbandwidths(B)

Expand All @@ -24,7 +24,7 @@
l,u
end

function add_bandwidths(A::BlockBandedMatrix,B::BlockBandedMatrix)
function add_bandwidths(A::BlockBandedMatrix, B::BlockBandedMatrix)

Check warning on line 27 in src/linalg.jl

View check run for this annotation

Codecov / codecov/patch

src/linalg.jl#L27

Added line #L27 was not covered by tests
l,u = blockbandwidths(A) .+ blockbandwidths(B)
Fill(l,blocksize(B,2)), Fill(u,blocksize(B,2))
end
Expand Down
12 changes: 12 additions & 0 deletions test/test_adjtransblockbanded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ import BlockBandedMatrices: BandedBlockBandedRowMajor, BandedBlockBandedRows,
@test rowsupport(E2, 1) == 1:0
@test colsupport(E2', 1) == 1:0
end

@testset "Adj*BlockBanded" begin
R = BlockBandedMatrix{Float64}(undef, [1,1,2,2,3], 1:2:9, (0,0)); fill!(R, 0)
for K = 1:N
for k = 1:(K÷2)
R[Block(K,K)[k,2k-1]] = R[Block(K,K)[k,2K-2k+1]] = 1/sqrt(2)
end
isodd(K) && (R[Block(K,K)[K÷2+1,K]] = 1)
end
@test R'R == Matrix(R)'R
@test R*R' ≈ I
end
end

end # module
Loading