Skip to content

Commit 5fdec8f

Browse files
almost done, tests are done, in-place is good
1 parent 1a0fcfd commit 5fdec8f

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/vector_of_array.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ end
167167

168168
@inline function Base.copy(bc::Broadcast.Broadcasted{VectorOfArrayStyle{Style}}) where Style
169169
N = narrays(bc)
170-
@show "here"
171170
x = unpack_voa(bc, 1)
172-
@show x
173-
@show copy(x)
174171
VectorOfArray(map(1:N) do i
175172
copy(unpack_voa(bc, i))
176173
end)

test/basic_indexing.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,13 @@ v[CartesianIndex((2, 3, 2, 3))] = 1
8787
@test v[CartesianIndex((2, 3, 2, 3))] == 1
8888
@test v.u[3][2, 3, 2] == 1
8989

90-
v .* v
90+
v = VectorOfArray([rand(20), rand(10,10), rand(3,3,3)])
91+
w = v .* v
92+
@test w isa VectorOfArray
93+
@test w[1] isa Vector
94+
@test w[1] == v[1] .* v[1]
95+
@test w[2] == v[2] .* v[2]
96+
@test w[3] == v[3] .* v[3]
97+
x = copy(v)
98+
x .= v .* v
99+
@test all(x .== w)

0 commit comments

Comments
 (0)