@@ -6,6 +6,9 @@ testa = cat(recs..., dims = 2)
66testva = VectorOfArray (recs)
77@test maximum (testva) == maximum (maximum .(recs))
88
9+ testva = VA[[1 , 2 , 3 ], [4 , 5 , 6 ], [7 , 8 , 9 ]]
10+ @test maximum (testva) == maximum (maximum .(recs))
11+
912# broadcast with array
1013X = rand (3 , 3 )
1114mulX = sqrt .(abs .(testva .* X))
@@ -161,15 +164,15 @@ diffeq = DiffEqArray(recs, t)
161164@test diffeq[:, (end - 1 ): end ]. t == t[(length (t) - 1 ): length (t)]
162165
163166# Test views of heterogeneous arrays (issue #453)
164- f = VectorOfArray ( [[1.0 ], [2.0 , 3.0 ]])
167+ f = VA [[1.0 ], [2.0 , 3.0 ]]
165168@test length (view (f, :, 1 )) == 1
166169@test length (view (f, :, 2 )) == 2
167170@test view (f, :, 1 ) == [1.0 ]
168171@test view (f, :, 2 ) == [2.0 , 3.0 ]
169172@test collect (view (f, :, 1 )) == f[:, 1 ]
170173@test collect (view (f, :, 2 )) == f[:, 2 ]
171174
172- f2 = VectorOfArray ( [[1.0 , 2.0 ], [3.0 ]])
175+ f2 = VA [[1.0 , 2.0 ], [3.0 ]]
173176@test length (view (f2, :, 1 )) == 2
174177@test length (view (f2, :, 2 )) == 1
175178@test view (f2, :, 1 ) == [1.0 , 2.0 ]
@@ -178,7 +181,7 @@ f2 = VectorOfArray([[1.0, 2.0], [3.0]])
178181@test collect (view (f2, :, 2 )) == f2[:, 2 ]
179182
180183# Test `end` with ragged arrays
181- ragged = VectorOfArray ( [[1.0 , 2.0 ], [3.0 , 4.0 , 5.0 ], [6.0 , 7.0 , 8.0 , 9.0 ]])
184+ ragged = VA [[1.0 , 2.0 ], [3.0 , 4.0 , 5.0 ], [6.0 , 7.0 , 8.0 , 9.0 ]]
182185@test ragged[end , 1 ] == 2.0
183186@test ragged[end , 2 ] == 5.0
184187@test ragged[end , 3 ] == 9.0
@@ -192,7 +195,7 @@ ragged = VectorOfArray([[1.0, 2.0], [3.0, 4.0, 5.0], [6.0, 7.0, 8.0, 9.0]])
192195@test ragged[:, 2 : end ] == VectorOfArray (ragged. u[2 : end ])
193196@test ragged[:, (end - 1 ): end ] == VectorOfArray (ragged. u[(end - 1 ): end ])
194197
195- ragged2 = VectorOfArray ( [[1.0 , 2.0 , 3.0 , 4.0 ], [5.0 , 6.0 ], [7.0 , 8.0 , 9.0 ]])
198+ ragged2 = VA [[1.0 , 2.0 , 3.0 , 4.0 ], [5.0 , 6.0 ], [7.0 , 8.0 , 9.0 ]]
196199@test ragged2[end , 1 ] == 4.0
197200@test ragged2[end , 2 ] == 6.0
198201@test ragged2[end , 3 ] == 9.0
@@ -228,7 +231,7 @@ ragged_range_idx = 1:lastindex(ragged, 1)
228231@test identity .(ragged_range_idx) === ragged_range_idx
229232
230233# Broadcasting of heterogeneous arrays (issue #454)
231- u = VectorOfArray ( [[1.0 ], [2.0 , 3.0 ]])
234+ u = VA [[1.0 ], [2.0 , 3.0 ]]
232235@test length (view (u, :, 1 )) == 1
233236@test length (view (u, :, 2 )) == 2
234237# broadcast assignment into selected column (last index Int)
@@ -293,7 +296,7 @@ u[1:2, 1, [1, 3], 2] .= [1.0 3.0; 2.0 4.0]
293296@test u[end , 1 , end ] == u. u[end ][end , 1 , end ]
294297
295298# Test that views can be modified
296- f3 = VectorOfArray ( [[1.0 , 2.0 ], [3.0 , 4.0 , 5.0 ]])
299+ f3 = VA [[1.0 , 2.0 ], [3.0 , 4.0 , 5.0 ]]
297300v = view (f3, :, 2 )
298301@test length (v) == 3
299302v[1 ] = 10.0
@@ -384,7 +387,7 @@ mulX .= sqrt.(abs.(testva .* testvb))
384387@test mulX == ref
385388
386389# https://github.com/SciML/RecursiveArrayTools.jl/issues/49
387- a = ArrayPartition ( 1 : 5 , 1 : 6 )
390+ a = AP[ 1 : 5 , 1 : 6 ]
388391a[1 : 8 ]
389392a[[1 , 3 , 8 ]]
390393
0 commit comments