Skip to content

Commit

Permalink
Prevent LowVarianceResampler from crashing for weights close to machi…
Browse files Browse the repository at this point in the history
…ne precision (#51)
  • Loading branch information
johannes-fischer authored Apr 25, 2021
1 parent 061764d commit 13d5e64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/resamplers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function resample(re::LowVarianceResampler, b::AbstractParticleBelief{S}, rng::A
i = 1
U = r
for m in 1:re.n
while U > c
while U > c && i < n_particles(b)
i += 1
c += weight(b, i)
end
Expand Down

2 comments on commit 13d5e64

@zsunberg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/35279

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.3 -m "<description of version>" 13d5e64be0730721e0f1e7127147af42c6e0ce71
git push origin v0.5.3

Please sign in to comment.