-
-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
But single-level is fine:
using RecursiveArrayTools, Test
xce0 = ArrayPartition(zeros(2),[0.])
xcde0 = copy(xce0)
function foo(y, x)
y .= y .+ x
nothing
end
foo(xcde0, xce0)
@test 0 == @allocated foo(xcde0, xce0)
function foo(y, x)
y .= y .+ 2 .* x
nothing
end
foo(xcde0, xce0)
@test 0 == @allocated foo(xcde0, xce0)
using BenchmarkTools
@btime foo(xcde0, xce0)
ap = ArrayPartition([100], [4, 1.3], ArrayPartition(ArrayPartition([1], [1, 4.4]), [0.4, 2, 1, 45]));
ap2 = recursivecopy(ap)
@btime foo(ap, ap2)
Metadata
Metadata
Assignees
Labels
No labels