|
33 | 33 | # Uninitialized
|
34 | 34 | @test @inferred(SizedArray{Tuple{2,2},Int,2,2,Matrix{Int}}(undef)) isa SizedArray{Tuple{2,2},Int,2,2,Matrix{Int}}
|
35 | 35 | @test @inferred(SizedArray{Tuple{2,2},Int,2,2}(undef)) isa SizedArray{Tuple{2,2},Int,2,2,Matrix{Int}}
|
| 36 | + @test @inferred(SizedArray{Tuple{2,2},Int,2,1}(undef)) isa SizedArray{Tuple{2,2},Int,2,1,Vector{Int}} |
36 | 37 | @test @inferred(SizedArray{Tuple{2,2},Int,2}(undef)) isa SizedArray{Tuple{2,2},Int,2,2,Matrix{Int}}
|
37 | 38 | @test @inferred(SizedArray{Tuple{2,2},Int}(undef)) isa SizedArray{Tuple{2,2},Int,2,2,Matrix{Int}}
|
38 | 39 | @test size(SizedArray{Tuple{4,5},Int,2}(undef).data) == (4, 5)
|
|
44 | 45 | @test @inferred(SizedArray{Tuple{2},Float64}((1,2)))::SizedArray{Tuple{2},Float64,1,1,Vector{Float64}} == [1.0, 2.0]
|
45 | 46 | @test @inferred(SizedArray{Tuple{2}}((1,2)))::SizedArray{Tuple{2},Int,1,1,Vector{Int}} == [1,2]
|
46 | 47 | @test @inferred(SizedArray{Tuple{2,2}}((1,2,3,4)))::SizedArray{Tuple{2,2},Int,2,2,Matrix{Int}} == [1 3; 2 4]
|
| 48 | + @test @inferred(SizedArray{Tuple{2,2},Int,2,1}((1,2,3,4)))::SizedArray{Tuple{2,2},Int,2,1,Vector{Int}} == [1 3; 2 4] |
47 | 49 | @test SizedArray{Tuple{2},Int,1}((3, 4)).data == [3, 4]
|
48 | 50 | end
|
49 | 51 |
|
|
121 | 123 | @testset "sized views" begin
|
122 | 124 | x = rand(4,1,2)
|
123 | 125 | y = SizedMatrix{4,2}(view(x, :, 1, :))
|
124 |
| - @test isa(y, SizedArray{Tuple{4,2},Float64,2,2,SubArray{Float64,2,Array{Float64,3},Tuple{Base.Slice{Base.OneTo{Int64}},Int64,Base.Slice{Base.OneTo{Int64}}},false}}) |
| 126 | + |
| 127 | + @test isa(y, SizedArray{Tuple{4,2},Float64,2,2,<:SubArray{Float64,2}}) |
125 | 128 | @test Array(y) isa Matrix{Float64}
|
126 | 129 | @test Array(y) == x[:, 1, :]
|
127 | 130 | @test convert(Array, y) isa Matrix{Float64}
|
128 | 131 | @test convert(Array, y) == x[:, 1, :]
|
129 | 132 |
|
130 | 133 | x2 = rand(10)
|
131 | 134 | y2 = SizedMatrix{4,2}(view(x2, 1:8))
|
132 |
| - @test isa(y2, SizedArray{Tuple{4,2},Float64,2,1,SubArray{Float64,1,Array{Float64,1},Tuple{UnitRange{Int64}},true}}) |
| 135 | + @test isa(y2, SizedArray{Tuple{4,2},Float64,2,1,<:SubArray{Float64,1}}) |
133 | 136 | @test Array(y2) isa Matrix{Float64}
|
134 | 137 | @test Array(y2) == reshape(x2[1:8], 4, 2)
|
135 | 138 | @test convert(Array, y2) isa Matrix{Float64}
|
|
0 commit comments