Skip to content

Commit

Permalink
fix condition order
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored Dec 8, 2021
1 parent 4a1494e commit 546565f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pl_sampler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ function sample_communities(τ₂, c_min, c_max, n, max_iter)
end
i = 0
while best_ss != n
if i length(best_s)
i = 0
shuffle!(best_s)
end
i += 1
change = sign(n - best_ss)
if change > 0
Expand All @@ -131,10 +135,6 @@ function sample_communities(τ₂, c_min, c_max, n, max_iter)
end
best_ss += change
best_s[i] += change
if i length(best_s)
i = 0
shuffle!(best_s)
end
end
return sort!(best_s, rev=true)
end

0 comments on commit 546565f

Please sign in to comment.