Skip to content

Commit

Permalink
Merge pull request #131 from danscr/patch-1
Browse files Browse the repository at this point in the history
Fix indexing error in particle resampling
  • Loading branch information
baggepinnen authored Jan 31, 2024
2 parents 070d060 + ff8acb7 commit 8c12038
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mcm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function MonteCarloMeasurements.Particles(x::AbstractMatrix{<:AbstractVector},we
## Perform resampling so that all particles have the same weight
choices = map(LowLevelParticleFilters.resample, eachcol(we))
for j in 1:size(xp,2), i in 1:size(xp,1)
xp[i,j].particles .= xp[i,j].particles[choices[j]]
xp[i,j].particles .= xp[i,j].particles[choices[i]]
end
xp
end

0 comments on commit 8c12038

Please sign in to comment.