diff --git a/Project.toml b/Project.toml index a985a48..e1ffd97 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "InfiniteArrays" uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c" -version = "0.9.0" +version = "0.9.1" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" @@ -14,7 +14,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" ArrayLayouts = "0.5" DSP = "0.6" FillArrays = "0.11" -LazyArrays = "0.20" +LazyArrays = "0.20.2" julia = "1.5" [extras] diff --git a/src/InfiniteArrays.jl b/src/InfiniteArrays.jl index 866d725..fccec7d 100644 --- a/src/InfiniteArrays.jl +++ b/src/InfiniteArrays.jl @@ -218,6 +218,15 @@ function searchsortedlast(v::AbstractVector, x, lo::Int, hi::Infinity, o::Orderi return lo end +# special case for Vcat +@inline function LazyArrays.searchsortedlast_recursive(::Infinity, x, a, args...) + n = sum(map(length,args)) + r = searchsortedlast(a, x) + r > 0 && return n + r + return LazyArrays.searchsortedlast_recursive(n, x, args...) +end + + ## # lazy sub_materialize ## diff --git a/src/reshapedarray.jl b/src/reshapedarray.jl index 3b4532f..29e4878 100644 --- a/src/reshapedarray.jl +++ b/src/reshapedarray.jl @@ -68,4 +68,11 @@ BroadcastStyle(::Type{<:ReshapedArray{T,2,<:Any,<:Tuple{<:Any,<:Infinity}}}) whe BroadcastStyle(::Type{<:ReshapedArray{T,2,<:Any,<:Tuple{<:Infinity,<:Any}}}) where {T} = LazyArrayStyle{2}() -MemoryLayout(::Type{<:ReshapedArray{T,N,A,DIMS}}) where {T,N,A,DIMS} = reshapedlayout(MemoryLayout(A), DIMS) \ No newline at end of file +MemoryLayout(::Type{<:ReshapedArray{T,N,A,DIMS}}) where {T,N,A,DIMS} = reshapedlayout(MemoryLayout(A), DIMS) + + +### +# permutedims for reshaped unrolls +### + +permutedims(R::ReshapedArray{<:Any,2,<:AbstractVector}) = parent(R) \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 0f26b36..fab85bc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -953,6 +953,7 @@ end @test permutedims(1:∞)[1,1:10] == (1:10) a = reshape(Vcat(Fill(1,1,∞),Fill(2,2,∞)),∞) @test a[1:7] == [1, 2, 2, 1, 2, 2, 1] + @test permutedims(permutedims(1:∞)) ≡ 1:∞ end @testset "norm/dot" begin