diff --git a/Project.toml b/Project.toml index dc29985..2a9e0f0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ArrayLayouts" uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" authors = ["Sheehan Olver "] -version = "0.4.11" +version = "0.4.12" [deps] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" @@ -11,7 +11,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] Compat = "3.16" -FillArrays = "0.9.1, 0.10" +FillArrays = "0.10.1" julia = "1" [extras] diff --git a/src/memorylayout.jl b/src/memorylayout.jl index 0638e48..a9af476 100644 --- a/src/memorylayout.jl +++ b/src/memorylayout.jl @@ -534,8 +534,8 @@ transposelayout(L::AbstractFillLayout) = L _getindex_value(V::SubArray) = getindex_value(parent(V)) sub_materialize(::AbstractFillLayout, V, ax) = Fill(_getindex_value(V), ax) -sub_materialize(::ZerosLayout, V, ax) = Zeros(ax) -sub_materialize(::OnesLayout, V, ax) = Ones(ax) +sub_materialize(::ZerosLayout, V, ax) = Zeros{eltype(V)}(ax) +sub_materialize(::OnesLayout, V, ax) = Ones{eltype(V)}(ax) abstract type AbstractBandedLayout <: MemoryLayout end abstract type AbstractTridiagonalLayout <: AbstractBandedLayout end diff --git a/test/test_layouts.jl b/test/test_layouts.jl index 8e76e11..cec02e3 100644 --- a/test/test_layouts.jl +++ b/test/test_layouts.jl @@ -296,8 +296,8 @@ struct FooNumber <: Number end @test MemoryLayout(Transpose(Fill(1+0im,10,2))) == FillLayout() @test layout_getindex(Fill(1,10), 1:3) ≡ Fill(1,3) - @test layout_getindex(Ones(1,10), 1, 1:3) ≡ Ones(3) - @test layout_getindex(Zeros(5,10,12), 1, 1:3,4:6) ≡ Zeros(3,3) + @test layout_getindex(Ones{Int}(1,10), 1, 1:3) ≡ Ones{Int}(3) + @test layout_getindex(Zeros{Int}(5,10,12), 1, 1:3,4:6) ≡ Zeros{Int}(3,3) end @testset "Triangular col/rowsupport" begin