Skip to content

Commit

Permalink
Fix sub-diagonal bandedblockbanded * diagtrav (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty authored Jul 25, 2024
1 parent 67890d4 commit 0647f1a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
os: [ubuntu-latest]
package:
- {repo: InfiniteLinearAlgebra.jl, group: JuliaLinearAlgebra}
- {repo: ClassicalOrthogonalPolynomials.jl, group: JuliaApproximation}
- {repo: MultivariateOrthogonalPolynomials.jl, group: JuliaApproximation}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LazyBandedMatrices"
uuid = "d7e5e226-e90b-4449-9968-0f923699bf6f"
authors = ["Sheehan Olver <solver@mac.com>"]
version = "0.10.2"
version = "0.10.3"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
2 changes: 1 addition & 1 deletion src/blockkron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function copy(M::Mul{<:LazyBlockBandedLayouts,<:DiagTravLayout{<:AbstractPaddedL
N = 2max(size(dat)...)-1
P = DiagTrav(convert(Matrix, B.array[1:N,1:N]))
JR = blockaxes(P,1)
KR = blockcolsupport(A,JR)
KR = Block.(OneTo(Int(blockcolsupport(A,JR)[end])))
pad(A[KR,JR] * P, axes(A,1))
end

Expand Down
8 changes: 7 additions & 1 deletion test/test_blockkron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module TestBlockKron

using LazyBandedMatrices, FillArrays, BandedMatrices, BlockBandedMatrices, BlockArrays, ArrayLayouts, LazyArrays, Test
using LinearAlgebra
import BlockBandedMatrices: isbandedblockbanded, isbanded, BandedBlockBandedStyle, BandedLayout
import BlockBandedMatrices: isbandedblockbanded, isbanded, BandedBlockBandedStyle, BandedLayout, _BandedBlockBandedMatrix
import LazyBandedMatrices: KronTravBandedBlockBandedLayout, BroadcastBandedLayout, BroadcastBandedBlockBandedLayout, arguments, call, blockcolsupport, InvDiagTrav, invdiagtrav, pad
import ArrayLayouts: FillLayout, OnesLayout
import LazyArrays: resizedata!, FillLayout, arguments, colsupport, call, LazyArrayStyle
Expand Down Expand Up @@ -311,6 +311,12 @@ LinearAlgebra.factorize(A::MyLazyArray) = factorize(A.data)
@test ApplyArray(*, A, B) * x ApplyArray(*, A, B) * DiagTrav(Matrix(C)) A * B * x
@test LazyArrays.simplifiable(*, ApplyArray(*, A, B), x) == Val(true)
@test LazyArrays.simplifiable(*, BroadcastArray(+, A, B), x) == Val(true)

k = BlockBroadcastArray(hcat, blockedrange(1:5), blockedrange(1:5))
D = _BandedBlockBandedMatrix(k', axes(k, 1), (1, -1), (1, 0))
C = pad(randn(3,3), 5,5)
x = DiagTrav(C)
@test D*x Matrix(D) * Vector(x)
end
end

Expand Down

2 comments on commit 0647f1a

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/111747

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.3 -m "<description of version>" 0647f1ab7524b2cc7fdcfd303b4406ad37b0b5a1
git push origin v0.10.3

Please sign in to comment.