From 8854baa7ad3c2b3b7c11602751bcc396c4faf6ef Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Thu, 21 Dec 2023 08:12:17 -0500 Subject: [PATCH] Update test/interface_tests.jl --- test/interface_tests.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/interface_tests.jl b/test/interface_tests.jl index ad3fec43..7f2288c0 100644 --- a/test/interface_tests.jl +++ b/test/interface_tests.jl @@ -126,6 +126,16 @@ z .= x .+ y @test z == VectorOfArray([fill(4, SVector{2, Float64}), fill(2, SVector{2, Float64})]) +u1 = VectorOfArray([fill(2, SVector{2, Float64}), ones(SVector{2, Float64})]) +u2 = VectorOfArray([fill(4, SVector{2, Float64}), 2 .* ones(SVector{2, Float64})]) +u3 = VectorOfArray([fill(4, SVector{2, Float64}), 2 .* ones(SVector{2, Float64})]) + +function f(u1,u2,u3) + u3 .= u1 .+ u2 +end +f(u1,u2,u3) +@test@allocated f(u1,u2,u3) == 0 + yy = [2.0 1.0; 2.0 1.0] zz = x .+ yy @test zz == [4.0 2.0; 4.0 2.0]