Skip to content

Commit 5c129e1

Browse files
committed
Generalise similar to AbstractBandedBlockBanded muladd
1 parent 55362a9 commit 5c129e1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-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.10.6"
3+
version = "0.10.7"
44

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

src/linalg.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function similar(M::MulAdd{<:AbstractBlockBandedLayout,<:AbstractBlockBandedLayo
4747
BlockSkylineMatrix{T}(undef, (axes(A,1),axes(B,2)), (l,u))
4848
end
4949

50-
function similar(M::MulAdd{BandedBlockBandedColumnMajor,BandedBlockBandedColumnMajor}, ::Type{T}) where T
50+
function similar(M::MulAdd{<:AbstractBandedBlockBandedLayout,<:AbstractBandedBlockBandedLayout}, ::Type{T}) where T
5151
A,B = M.A, M.B
5252

5353
if !blockisequal(axes(A,2), axes(B,1))
@@ -62,8 +62,12 @@ function similar(M::MulAdd{BandedBlockBandedColumnMajor,BandedBlockBandedColumnM
6262
end
6363
end
6464
n,m = size(A,1), size(B,2)
65+
Al,Au = blockbandwidths(A)
66+
Bl,Bu = blockbandwidths(B)
67+
Aλ,Aμ = subblockbandwidths(A)
68+
Bλ,Bμ = subblockbandwidths(B)
6569

66-
BandedBlockBandedMatrix{T}(undef, (axes(A,1),axes(B,2)), (A.l+B.l, A.u+B.u), (A.λ+B.λ, A.μ+B.μ))
70+
BandedBlockBandedMatrix{T}(undef, (axes(A,1),axes(B,2)), (Al+Bl, Au+Bu), (+Bλ, Aμ+))
6771
end
6872

6973
similar(M::MulAdd{<:DiagonalLayout,<:AbstractBlockBandedLayout}, ::Type{T}) where T = similar(M.B,T)

0 commit comments

Comments
 (0)