Skip to content

Commit b398064

Browse files
authored
Support LazyArrays v2.0 and BlockArrays v1.0 (#178)
* Support LazyArrays v2.0 and BlockArrays v1.0 * Update Project.toml * update versions * PseudoBlock -> Blocked
1 parent a737b55 commit b398064

File tree

10 files changed

+30
-30
lines changed

10 files changed

+30
-30
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
version:
13-
- '1.9'
14-
- '1'
13+
- '1.10'
1514
os:
1615
- ubuntu-latest
1716
- macOS-latest

Project.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "MultivariateOrthogonalPolynomials"
22
uuid = "4f6956fd-4f93-5457-9149-7bfc4b2ce06d"
3-
version = "0.6.4"
3+
version = "0.7"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -19,29 +19,30 @@ LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
1919
LazyBandedMatrices = "d7e5e226-e90b-4449-9968-0f923699bf6f"
2020
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2121
QuasiArrays = "c4ea9172-b204-11e9-377d-29865faadc5c"
22+
SemiseparableMatrices = "f8ebbe35-cbfb-4060-bf7f-b10e4670cf57"
2223
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2324
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2425
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2526

2627
[compat]
2728
ArrayLayouts = "1.0.9"
2829
BandedMatrices = "1"
29-
BlockArrays = "0.16.14"
30-
BlockBandedMatrices = "0.12.5"
31-
ClassicalOrthogonalPolynomials = "0.12"
32-
ContinuumArrays = "0.17"
30+
BlockArrays = "1.0"
31+
BlockBandedMatrices = "0.13"
32+
ClassicalOrthogonalPolynomials = "0.13"
33+
ContinuumArrays = "0.18"
3334
DomainSets = "0.6, 0.7"
3435
FastTransforms = "0.15.11, 0.16"
3536
FillArrays = "1.0"
36-
HarmonicOrthogonalPolynomials = "0.5"
37-
InfiniteArrays = "0.13"
38-
InfiniteLinearAlgebra = "0.7"
39-
LazyArrays = "1.0"
40-
LazyBandedMatrices = "0.9"
37+
HarmonicOrthogonalPolynomials = "0.6"
38+
InfiniteArrays = "0.14"
39+
InfiniteLinearAlgebra = "0.8"
40+
LazyArrays = "2.0"
41+
LazyBandedMatrices = "0.10"
4142
QuasiArrays = "0.11"
4243
SpecialFunctions = "1, 2"
4344
StaticArrays = "1"
44-
julia = "1.9"
45+
julia = "1.10"
4546

4647
[extras]
4748
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

examples/triangleexamples.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ u_3 = F \ pad(coefficients(Fun((x,y) -> x*y*(1-x-y), rangespace(L))), size(M,1))
6969
u_4 = F \ pad(coefficients(Fun((x,y) -> exp(-25((x-0.2)^2+(y-0.2)^2)), rangespace(L))), size(M,1))
7070

7171

72-
bnrms = u -> [norm(PseudoBlockArray(u, 1:N)[Block(K)],Inf) for K=1:N]
72+
bnrms = u -> [norm(BlockedArray(u, 1:N)[Block(K)],Inf) for K=1:N]
7373

7474
plot(bnrms(u_1); xscale=:log10, yscale=:log10, linewidth=3, label="1")
7575
plot!(bnrms(u_2); xscale=:log10, yscale=:log10, linewidth=3, linestyle=:dot, label="x^2 + y^2")

src/ModalInterlace.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ convert(::Type{ModalTrav{T,M}}, v::ModalTrav) where {T,M} = ModalTrav{T,M}(conve
3131

3232
function convert(::Type{ModalTrav{T,M}}, v_in::AbstractVector) where {T,M}
3333
N = (isqrt(8length(v_in)+1)-1) ÷ 2
34-
v = PseudoBlockVector(v_in, OneTo(N))
34+
v = BlockedVector(v_in, OneTo(N))
3535
m = N ÷ 2 + 1
3636
n = 4(m-1) + 1
3737
mat = zeros(T, m, n)

src/rect.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ end
140140
applylayout(::Type{typeof(*)}, ::Lay, ::DiagTravLayout) where Lay <: AbstractBasisLayout = ExpansionLayout{Lay}()
141141
ContinuumArrays._mul_plotgrid(::Tuple{Any,DiagTravLayout{<:PaddedLayout}}, (P,c)::NTuple{2,Any}) = plotgrid(P, maximum(blockcolsupport(c)))
142142

143-
pad(C::DiagTrav, ::BlockedUnitRange{RangeCumsum{Int,OneToInf{Int}}}) = DiagTrav(pad(C.array, ∞, ∞))
143+
pad(C::DiagTrav, ::BlockedOneTo{Int,RangeCumsum{Int,OneToInf{Int}}}) = DiagTrav(pad(C.array, ∞, ∞))
144144

145145
QuasiArrays.mul(A::BivariateOrthogonalPolynomial, b::DiagTrav) = ApplyQuasiArray(*, A, b)
146146

src/triangle.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ end
664664
# The functionality will need to be added to LazyBandedMatrices.jl
665665
function tri_forwardrecurrence(N::Int, X, Y, x, y)
666666
T = promote_type(eltype(X),eltype(Y))
667-
ret = PseudoBlockVector{T}(undef, 1:N)
667+
ret = BlockedVector{T}(undef, 1:N)
668668
N < 1 && return ret
669669
ret[1] = 1
670670
N < 2 && return ret

test/test_cone.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import MultivariateOrthogonalPolynomials: rectspace, totensor, duffy2legendrecon
1010
A = [1 2 3 5 6;
1111
4 7 8 0 0;
1212
9 0 0 0 0]
13-
B = PseudoBlockArray(A, Ones{Int}(3), [1; Fill(2,2)])
13+
B = BlockedArray(A, Ones{Int}(3), [1; Fill(2,2)])
1414

1515
a = Vector{eltype(A)}()
1616
for N = 1:blocksize(B,2), K=1:N
@@ -22,7 +22,7 @@ import MultivariateOrthogonalPolynomials: rectspace, totensor, duffy2legendrecon
2222
N = isqrt(length(a))
2323
M = 2N-1
2424
= zeros(eltype(a), N, M)
25-
B = PseudoBlockArray(Ã, Ones{Int}(3), [1; Fill(2,2)])
25+
B = BlockedArray(Ã, Ones{Int}(3), [1; Fill(2,2)])
2626
k = 1
2727
for N = 1:blocksize(B,2), K=1:N
2828
V = view(B, Block(K,N-K+1))

test/test_disk.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import ForwardDiff: hessian
1010
T = ZernikeTransform{Float64}(N, 0, 0)
1111
Ti = ZernikeITransform{Float64}(N, 0, 0)
1212

13-
v = PseudoBlockArray(randn(sum(1:N)),1:N)
13+
v = BlockedArray(randn(sum(1:N)),1:N)
1414
@test T * (Ti * v) v
1515

1616

@@ -60,7 +60,7 @@ import ForwardDiff: hessian
6060
@test_throws ArgumentError ModalTrav([1 2 3 4; 5 6 7 8])
6161

6262
for N = 1:10
63-
v = PseudoBlockArray(1:sum(1:N),1:N)
63+
v = BlockedArray(1:sum(1:N),1:N)
6464
if iseven(N)
6565
@test ModalTrav(v) == [v; zeros(N+1)]
6666
else

test/test_modalinterlace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import MultivariateOrthogonalPolynomials: ModalInterlace, ModalInterlaceLayout,
33

44
@testset "modalTrav" begin
55
a = ModalTrav(randn(2,5))
6-
b = PseudoBlockArray(a)
6+
b = BlockedArray(a)
77
v = Vector(a)
88

99
@test zero(a) isa ModalTrav
@@ -12,7 +12,7 @@ import MultivariateOrthogonalPolynomials: ModalInterlace, ModalInterlaceLayout,
1212
@test exp.(a) isa ModalTrav
1313
@test 2a isa ModalTrav
1414
@test a+a isa ModalTrav
15-
@test a+b isa PseudoBlockArray
15+
@test a+b isa BlockedArray
1616
@test a+v isa BlockArray
1717
@test a .+ exp.(a .+ 1) isa ModalTrav
1818

test/test_triangle.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,22 @@ import MultivariateOrthogonalPolynomials: tri_forwardrecurrence, grid, TriangleR
5151
@testset "function" begin
5252
P = JacobiTriangle()
5353
𝐱 = SVector(0.1,0.2)
54-
c = PseudoBlockVector([1; Zeros(∞)], (axes(P,2),))
54+
c = BlockedVector([1; Zeros(∞)], (axes(P,2),))
5555
f = P*c
5656
@test MemoryLayout(f) isa ExpansionLayout
5757
@test @inferred(f[𝐱]) == 1.0
58-
c = PseudoBlockVector([1:3; Zeros(∞)], (axes(P,2),))
58+
c = BlockedVector([1:3; Zeros(∞)], (axes(P,2),))
5959
f = P*c
6060
@test f[𝐱] P[𝐱,1:3]'*(1:3)
61-
c = PseudoBlockVector([1:6; Zeros(∞)], (axes(P,2),))
61+
c = BlockedVector([1:6; Zeros(∞)], (axes(P,2),))
6262
f = P*c
6363
@test f[𝐱] P[𝐱,1:6]'*(1:6)
6464

65-
c = PseudoBlockVector([randn(5050); Zeros(∞)], (axes(P,2),))
65+
c = BlockedVector([randn(5050); Zeros(∞)], (axes(P,2),))
6666
f = P*c
6767
@test f[𝐱] P[𝐱,1:5050]'*c[1:5050]
6868

69-
c = PseudoBlockVector([1:10; zeros(∞)], (axes(P,2),))
69+
c = BlockedVector([1:10; zeros(∞)], (axes(P,2),))
7070
f = P*c
7171
𝐱 = SVector(0.1,0.2)
7272
@test f[𝐱] dot(P[𝐱,1:10],1:10)
@@ -98,7 +98,7 @@ import MultivariateOrthogonalPolynomials: tri_forwardrecurrence, grid, TriangleR
9898

9999
@testset "relation with transform" begin
100100
P = JacobiTriangle()
101-
c = PseudoBlockVector([1:10; zeros(∞)], (axes(P,2),))
101+
c = BlockedVector([1:10; zeros(∞)], (axes(P,2),))
102102
f = P*c
103103
N = 5
104104
P_N = P[:,Block.(Base.OneTo(N))]
@@ -375,7 +375,7 @@ import MultivariateOrthogonalPolynomials: tri_forwardrecurrence, grid, TriangleR
375375
X = P \ (x .* P)
376376
Y = P \ (y .* P)
377377

378-
P_ex = PseudoBlockVector{Float64}(undef, 1:5)
378+
P_ex = BlockedVector{Float64}(undef, 1:5)
379379
for n = 0:4, k=0:n
380380
P_ex[Block(n+1)[k+1]] = p(n,k,1,0,0,0.1,0.2)
381381
end

0 commit comments

Comments
 (0)