Bayes Filters Library
Resampling.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2019 Istituto Italiano di Tecnologia (IIT)
3  *
4  * This software may be modified and distributed under the terms of the
5  * BSD 3-Clause license. See the accompanying LICENSE file for details.
6  */
7 
8 #ifndef RESAMPLING_H
9 #define RESAMPLING_H
10 
11 #include <random>
12 
14 
15 #include <Eigen/Dense>
16 
17 namespace bfl {
18  class Resampling;
19 }
20 
21 
23 {
24 public:
25  Resampling(unsigned int seed) noexcept;
26 
27  Resampling() noexcept;
28 
29  Resampling(const Resampling& resampling) noexcept;
30 
31  Resampling(Resampling&& resampling) noexcept;
32 
33  virtual ~Resampling() noexcept = default;
34 
35  Resampling& operator=(const Resampling& resampling);
36 
37  Resampling& operator=(Resampling&& resampling) noexcept;
38 
39  Resampling& operator=(const Resampling&& resampling) noexcept;
40 
41  virtual void resample(const bfl::ParticleSet& cor_particles, bfl::ParticleSet& res_particles, Eigen::Ref<Eigen::VectorXi> res_parents);
42 
43  virtual double neff(const Eigen::Ref<const Eigen::VectorXd>& cor_weights);
44 
45 
46 private:
47  std::mt19937_64 generator_;
48 };
49 
50 #endif /* RESAMPLING_H */
bfl::Resampling::Resampling
Resampling() noexcept
Definition: Resampling.cpp:21
bfl::Resampling::resample
virtual void resample(const bfl::ParticleSet &cor_particles, bfl::ParticleSet &res_particles, Eigen::Ref< Eigen::VectorXi > res_parents)
Definition: Resampling.cpp:67
bfl
Port of boost::any for C++11 compilers.
Definition: AdditiveMeasurementModel.h:13
bfl::Resampling::~Resampling
virtual ~Resampling() noexcept=default
bfl::Resampling::generator_
std::mt19937_64 generator_
Definition: Resampling.h:47
bfl::Resampling
Definition: Resampling.h:22
ParticleSet.h
bfl::Resampling::neff
virtual double neff(const Eigen::Ref< const Eigen::VectorXd > &cor_weights)
Definition: Resampling.cpp:97
bfl::ParticleSet
Definition: ParticleSet.h:20
bfl::Resampling::operator=
Resampling & operator=(const Resampling &resampling)
Definition: Resampling.cpp:36