Skip to content

Commit 1adb4a7

Browse files
ArrayPartition efficient broadcasting
1 parent 6814130 commit 1adb4a7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/partitions_test.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ C = rand(10)
1212
p3 = similar(p,indices(p))
1313
@test length(p3.x[1]) == length(p3.x[2]) == 5
1414
@test length(p.x) == length(p2.x) == length(p3.x) == 2
15+
16+
A = (rand(5),rand(5))
17+
p = ArrayPartition(A)
18+
B = (rand(5),rand(5))
19+
p2 = ArrayPartition(B)
20+
a = 5
21+
22+
p .= (*).(p,5)
23+
p .= (*).(p,a)
24+
p .= (*).(p,p2)

0 commit comments

Comments
 (0)