Skip to content

Commit

Permalink
resolves #6, scales are not 0.0 when number of particles = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjwilliams1 committed Apr 5, 2017
1 parent 3008300 commit 5566520
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ end
function getscales(particles)

parameters = hcat(map(x -> x.params, particles)...)'
scales = (maximum(parameters, 1) -
minimum(parameters, 1) ./2)[:]
scales = ((maximum(parameters, 1) -
minimum(parameters, 1)) ./2)[:]

for i in 1:length(particles)
particles[i].scales = scales
Expand All @@ -76,12 +76,12 @@ function getscales(particles, ABCsetup)
for i in 1:ABCsetup.nmodels
if modelfreq[i] == 0
push!(scales, [0.0])
elseif modelfreq[i] == 1
push!(scales, particles[modelindex[:, i]][1].scales)
else
#parameters = hcat(map(x -> x.params, particles)...)'[modelindex[:, i], :]
parameters = hcat(map(x -> x.params, particles[modelindex[:, i]])...)'
#println(length(parameters))
push!(scales, (maximum(parameters, 1) -
minimum(parameters, 1) ./2)[:])
push!(scales, ((maximum(parameters, 1) -
minimum(parameters, 1)) ./2)[:])
end
end

Expand Down

0 comments on commit 5566520

Please sign in to comment.