Skip to content

Commit

Permalink
Merge pull request #5 from ChrisRackauckas/patch-1
Browse files Browse the repository at this point in the history
Optimize the Julia code
  • Loading branch information
00sapo committed May 22, 2021
2 parents b246d99 + f4de052 commit 71ea71e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions list_julia.jl
Expand Up @@ -3,9 +3,9 @@ using PyCall
function iterate_list(a_list::Vector{Vector{Float64}})

count = 0.0
for i in 1:length(a_list)
@inbounds for i in 1:length(a_list)
internal_list = a_list[i]
for j in 1:length(internal_list)
@simd for j in 1:length(internal_list)
count += internal_list[j]
end
end
Expand All @@ -16,10 +16,10 @@ end

function make_list(a_list::Vector{Any})
convert(Vector{Vector{Float64}}, a_list)
for i in 1:10^4
new_list::Vector{Float64} = []
for j in 1:10^4
push!(new_list, 0.01)
@inbounds for i in 1:10^4
new_list = zeros(10^4)
@simd for j in 1:10^4
new_list[j] = 0.01
end
push!(a_list, new_list)
end
Expand Down

0 comments on commit 71ea71e

Please sign in to comment.