From 8e760732bd875f298573593504d984a1e98acd4e Mon Sep 17 00:00:00 2001 From: Mahmoud Bentriou <mahmoud.bentriou@centralesupelec.fr> Date: Wed, 18 Nov 2020 15:29:31 +0100 Subject: [PATCH] Small fix about bench for view macro --- core/_tests_simulate.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/_tests_simulate.jl b/core/_tests_simulate.jl index ca97957..0fc7c4a 100644 --- a/core/_tests_simulate.jl +++ b/core/_tests_simulate.jl @@ -177,7 +177,7 @@ function _simulate_without_view(m::ContinuousTimeModel) transitions = Union{String,Nothing}[nothing] # values at time n n = 0 - xn = m.x0 + xn = @view m.x0[:] tn = m.t0 # at time n+1 mat_x = zeros(Int, m.buffer_size, m.d) @@ -188,16 +188,16 @@ function _simulate_without_view(m::ContinuousTimeModel) i = 0 while i < m.buffer_size && !is_absorbing &&Â (tn <= m.time_bound) i += 1 - m.f!(mat_x, l_t, l_tr, i, xn, tn, m.p) + m.f!(mat_x, l_t, l_tr, i, @view(xn[:]), tn, m.p) xn = mat_x[i,:] tn = l_t[i] - is_absorbing = m.is_absorbing(m.p,xn)::Bool + is_absorbing = m.is_absorbing(m.p,@view(xn[:]))::Bool end full_values = vcat(full_values, mat_x[1:i,:]) append!(times, l_t[1:i]) append!(transitions, l_tr[1:i]) n += i - is_absorbing = m.is_absorbing(m.p,xn)::Bool + is_absorbing = m.is_absorbing(m.p,@view(xn[:]))::Bool end if is_bounded(m) if times[end] > m.time_bound -- GitLab