From 248db3bc687d3ab5f3f757fc4da728dc5d1fcfde Mon Sep 17 00:00:00 2001 From: Gaspard Jankowiak Date: Fri, 15 Mar 2024 13:43:38 +0100 Subject: [PATCH] PLUV.jl take computation of I outside of loop --- PLUV.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PLUV.jl b/PLUV.jl index c10179b..f979c64 100644 --- a/PLUV.jl +++ b/PLUV.jl @@ -280,11 +280,12 @@ function intensity(P::AbstractArray{Float64}, q) ############### Ensemble average # multiply each columns of Am by Normal and sum along the columns, # then multiply by integration step - I = vec(sum(Am .^ 2 .* Normal'; dims=2)) * integration_step - - alp = Rm / (Z + 1) - return @. (Norm * nv * 1e-6) * I * (16 * pi^2 * mu4(q, Z, alp)) + Con * (0.99 * (1.0 / (1 + exp(-8 * (q - 1.0)))) + 0.01) end + + I = vec(sum(Am .^ 2 .* Normal'; dims=2)) * integration_step + + alp = Rm / (Z + 1) + return @. (Norm * nv * 1e-6) * I * (16 * pi^2 * mu4(q, Z, alp)) + Con * (0.99 * (1.0 / (1 + exp(-8 * (q - 1.0)))) + 0.01) end ##################