From 068315967d80b1fd1f6c3a8b5a9091e9dc2a0288 Mon Sep 17 00:00:00 2001 From: cbrahms Date: Thu, 22 Jul 2021 19:05:27 +0100 Subject: [PATCH] remove allocation --- src/SFA.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SFA.jl b/src/SFA.jl index 3ee3a23e..a6e44a66 100644 --- a/src/SFA.jl +++ b/src/SFA.jl @@ -225,8 +225,10 @@ function sfa_dipole_fast(t, Et::Vector{<:Real}, gas, λ0; p_st .= intA_this./τ @. S = Ip*τ + τ/2*p_st^2 - p_st*intA_this + intAsq_this/2 # Action - d_birth .= dipole.(p_st .- A_birth) - d_recomb .= dipole.(p_st .- A[tidx]) + for i in eachindex(d_birth) + d_birth[i] = dipole(p_st[i] - A_birth[i]) + d_recomb[i] = dipole(p_st[i] - A[tidx]) + end gstate_pop_recomb = depletion ? gstate_pop[tidx] : 1.0