Skip to content

Commit a81d9ad

Browse files
authored
Merge branch 'master' into jishnub/checkindex_check
2 parents e6278be + 6f17425 commit a81d9ad

File tree

6 files changed

+37
-24
lines changed

6 files changed

+37
-24
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
arch:
4646
- x64
4747
steps:
48-
- uses: actions/checkout@v4
48+
- uses: actions/checkout@v5
4949
- uses: julia-actions/setup-julia@v2
5050
with:
5151
version: ${{ matrix.version }}

.github/workflows/downstream.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ jobs:
4343
- {repo: InfiniteLinearAlgebra.jl, group: JuliaLinearAlgebra}
4444

4545
steps:
46-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@v5
4747
- uses: julia-actions/setup-julia@v2
4848
with:
4949
version: ${{ matrix.julia-version }}
5050
arch: x64
5151
- uses: julia-actions/julia-buildpkg@latest
5252
- name: Clone Downstream
53-
uses: actions/checkout@v4
53+
uses: actions/checkout@v5
5454
with:
5555
repository: ${{ matrix.package.group }}/${{ matrix.package.repo }}
5656
path: downstream

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "InfiniteArrays"
22
uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
3-
version = "0.15.7"
3+
version = "0.15.9"
44

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

src/infarrays.jl

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -382,23 +382,26 @@ ArrayLayouts.typed_vcat(::Type{T}, ::Tuple{Any,InfiniteCardinal{0}}, A...) where
382382

383383
sub_materialize(_, V, ::Tuple{InfAxes}) = V
384384
sub_materialize(_, V, ::Tuple{InfAxes,InfAxes}) = V
385-
sub_materialize(_, V, ::Tuple{<:Any,InfAxes}) = V
385+
sub_materialize(_, V, ::Tuple{Any,InfAxes}) = V
386386
sub_materialize(_, V, ::Tuple{InfAxes,Any}) = V
387387

388388

389389
sub_materialize(::ApplyLayout{typeof(vcat)}, V::AbstractVector, ::Tuple{InfAxes}) = ApplyArray(V)
390-
sub_materialize(::ApplyLayout{typeof(vcat)}, V::AbstractMatrix, ::Tuple{InfAxes,InfAxes}) = ApplyArray(V)
391-
sub_materialize(::ApplyLayout{typeof(vcat)}, V::AbstractMatrix, ::Tuple{<:Any,InfAxes}) = ApplyArray(V)
392-
sub_materialize(::ApplyLayout{typeof(vcat)}, V::AbstractMatrix, ::Tuple{InfAxes,Any}) = ApplyArray(V)
390+
sub_materialize(::ApplyLayout{typeof(vcat)}, V::AbstractMatrix, ::Tuple{InfAxes, InfAxes}) = ApplyArray(V)
391+
sub_materialize(::ApplyLayout{typeof(vcat)}, V::AbstractMatrix, ::Tuple{Any, InfAxes}) = ApplyArray(V)
392+
sub_materialize(::ApplyLayout{typeof(vcat)}, V::AbstractMatrix, ::Tuple{InfAxes, Any}) = ApplyArray(V)
393393

394394
sub_materialize(::ApplyLayout{typeof(hcat)}, V, ::Tuple{InfAxes}) = V
395-
sub_materialize(::ApplyLayout{typeof(hcat)}, V::AbstractMatrix, ::Tuple{InfAxes,InfAxes}) = ApplyArray(V)
396-
sub_materialize(::ApplyLayout{typeof(hcat)}, V::AbstractMatrix, ::Tuple{<:Any,InfAxes}) = ApplyArray(V)
397-
sub_materialize(::ApplyLayout{typeof(hcat)}, V::AbstractMatrix, ::Tuple{InfAxes,Any}) = ApplyArray(V)
395+
sub_materialize(::ApplyLayout{typeof(hcat)}, V::AbstractMatrix, ::Tuple{InfAxes, InfAxes}) = ApplyArray(V)
396+
sub_materialize(::ApplyLayout{typeof(hcat)}, V::AbstractMatrix, ::Tuple{Any, InfAxes}) = ApplyArray(V)
397+
sub_materialize(::ApplyLayout{typeof(hcat)}, V::AbstractMatrix, ::Tuple{InfAxes, Any}) = ApplyArray(V)
398398

399399

400-
sub_materialize(::AbstractPaddedLayout, v::AbstractVector{T}, ::Tuple{InfAxes}) where T =
401-
_padded_sub_materialize(v)
400+
sub_materialize(::AbstractPaddedLayout, v::AbstractVector, ::Tuple{InfAxes}) = _padded_sub_materialize(v)
401+
402+
sub_materialize(::AbstractPaddedLayout, v::AbstractMatrix, ::Tuple{InfAxes, InfAxes}) = v
403+
sub_materialize(::AbstractPaddedLayout, v::AbstractMatrix, ::Tuple{InfAxes, Any}) = v
404+
sub_materialize(::AbstractPaddedLayout, v::AbstractMatrix, ::Tuple{Any, InfAxes}) = v
402405

403406
sub_materialize(lay::InvColumnLayout, v::AbstractVector, ax::Tuple{InfAxes}) =
404407
Base.invoke(sub_materialize, Tuple{InvColumnLayout, AbstractVector, Any}, lay, v, ax)

src/infrange.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,12 +488,12 @@ BroadcastStyle(::Type{<:SubArray{<:Any,2,<:Any,<:Tuple{<:Any,<:InfIndexRanges}}}
488488

489489

490490

491-
broadcasted(::BroadcastStyle, f, r::Adjoint{<:Any,<:InfRanges}) = broadcast(f,parent(r))'
492-
broadcasted(::BroadcastStyle, f, r::Transpose{<:Any,<:InfRanges}) = transpose(broadcast(f,parent(r)))
493-
broadcasted(::BroadcastStyle, f, a::Number, r::Adjoint{<:Any,<:InfRanges}) = broadcast(f,a,parent(r))'
494-
broadcasted(::BroadcastStyle, f, a::Number, r::Transpose{<:Any,<:InfRanges}) = transpose(broadcast(f,a,parent(r)))
495-
broadcasted(::BroadcastStyle, f, r::Adjoint{<:Any,<:InfRanges}, a::Number) = broadcast(f,parent(r),a)'
496-
broadcasted(::BroadcastStyle, f, r::Transpose{<:Any,<:InfRanges}, a::Number) = transpose(broadcast(f,parent(r),a))
491+
broadcasted(::LazyArrayStyle, f, r::Adjoint{<:Any,<:InfRanges}) = broadcast(f,parent(r))'
492+
broadcasted(::LazyArrayStyle, f, r::Transpose{<:Any,<:InfRanges}) = transpose(broadcast(f,parent(r)))
493+
broadcasted(::LazyArrayStyle, f, a::Number, r::Adjoint{<:Any,<:InfRanges}) = broadcast(f,a,parent(r))'
494+
broadcasted(::LazyArrayStyle, f, a::Number, r::Transpose{<:Any,<:InfRanges}) = transpose(broadcast(f,a,parent(r)))
495+
broadcasted(::LazyArrayStyle, f, r::Adjoint{<:Any,<:InfRanges}, a::Number) = broadcast(f,parent(r),a)'
496+
broadcasted(::LazyArrayStyle, f, r::Transpose{<:Any,<:InfRanges}, a::Number) = transpose(broadcast(f,parent(r),a))
497497

498498
broadcast(f, r::Adjoint{<:Any,<:InfRanges}) = broadcast(f,parent(r))'
499499
broadcast(f, r::Transpose{<:Any,<:InfRanges}) = transpose(broadcast(f,parent(r)))

test/runtests.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -898,13 +898,13 @@ end
898898
@testset "views of matrices" begin
899899
D = Diagonal(1:∞)
900900
V = Vcat(Ones(2,∞), D)
901-
@test view(D,:,5) .+ 1 isa BroadcastVector
902-
@test view(D,5,:) .+ 1 isa BroadcastVector
903-
@test view(V,:,5) .+ 1 isa BroadcastVector
904-
@test view(V,5,:) .+ 1 isa BroadcastVector
901+
@test view(D,:,5) .+ 1 isa BroadcastVector || view(D,:,5) .+ 1 isa CachedArray
902+
@test view(D,5,:) .+ 1 isa BroadcastVector || view(D,5,:) .+ 1 isa CachedArray
903+
@test view(V,:,5) .+ 1 isa BroadcastVector || view(V,:,5) .+ 1 isa Vcat
904+
@test view(V,5,:) .+ 1 isa BroadcastVector || view(V,5,:) .+ 1 isa Vcat
905905

906906
@test view(D,2:∞,2:∞) .+ 1 isa BroadcastMatrix
907-
@test view(V,2:∞,2:∞) .+ 1 isa BroadcastMatrix
907+
@test view(V,2:∞,2:∞) .+ 1 isa BroadcastMatrix || view(V,2:∞,2:∞) .+ 1 isa Vcat
908908

909909
@test view(D,2:∞,[1,2,3]) .+ 1 isa BroadcastMatrix
910910
@test view(D,[1,2,3],2:∞) .+ 1 isa BroadcastMatrix
@@ -1247,6 +1247,16 @@ end
12471247
@test LazyArrays.sub_materialize(view(v, 2:∞))[1:10] == zeros(10)
12481248
@test v[2:∞] isa Zeros
12491249
@test v[1:∞] == v
1250+
1251+
V = Vcat([1 2; 3 4], Zeros(∞,2))
1252+
H = Hcat([1 2; 3 4], Zeros(2,∞))
1253+
S = ApplyArray(Base.setindex, Zeros(∞,∞), [1 2; 3 4], Base.OneTo(2), Base.OneTo(2))
1254+
@test_skip V[:,1] == S[:,1] == [1; 3; Zeros(∞)]
1255+
@test V[:,1] S[:,1] [1; 3; Zeros(∞)] # TODO: change to ==
1256+
@test V[2:∞,1:2] S[2:∞,1:2] Vcat([3 4], Zeros(∞,2))
1257+
@test H[1,:] S[1,:] [1; 2; Zeros(∞)]
1258+
@test_broken H[1:2,2:∞] S[1:2,2:∞] Hcat([2; 4], Zeros(2,∞))
1259+
@test_broken S[2:∞,2:∞] ApplyArray(Base.setindex, Zeros(∞,∞), 4, 1, 1)
12501260
end
12511261

12521262
@testset "issue #180" begin

0 commit comments

Comments
 (0)