Skip to content

Commit

Permalink
Use fill instead of array comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
urbainvaes committed Dec 21, 2023
1 parent 30b875f commit c38eb88
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Methods/CBO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ end

consensus = zeros(D, M)

update_diff = [Inf for m 1:M]
update_diff = fill(Inf, M)

energy = [Inf for n 1:N, m 1:M]
exponents = [Inf for n 1:N, m 1:M]
logsums = [Inf for n [1], m 1:M]
consensus_energy = [Inf for m 1:M]
energy = fill(Inf, N, M)
exponents = fill(Inf, N, M)
logsums = fill(Inf, 1, M)
consensus_energy = fill(Inf, M)
best_cur_energy = zeros(M)
best_energy = [Inf for m 1:M]
best_energy = fill(Inf, M)

f_min = [Inf for m 1:M]
f_min_idx = [1 for m 1:M]
f_min = fill(Inf, M)
f_min_idx = ones(M)
num_f_eval = 0

best_cur_particle = zeros(D, M)
Expand Down

0 comments on commit c38eb88

Please sign in to comment.