MRPT  2.0.4
CProbabilityParticle.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
11 #include <mrpt/containers/deepcopy_ptr.h> // copy_ptr<>
12 
13 namespace mrpt::bayes
14 {
15 /** use for CProbabilityParticle
16  * \ingroup mrpt_bayes_grp
17  */
19 {
20  VALUE,
21  POINTER
22 };
23 
24 /** A template class for holding a the data and the weight of a particle.
25  * Particles comprise two parts: a "data payload field", and a logarithmic
26  * importance sampling weight.
27  *
28  * \tparam T The type of the payload. Must be default constructable.
29  * \tparam STORAGE If `POINTER`, a (wrapper to a) pointer is used to store
30  * the payload; if `VALUE`, the payload is stored directly as a value.
31  *
32  * \sa CParticleFilterData
33  * \ingroup mrpt_bayes_grp
34  */
35 template <class T, particle_storage_mode STORAGE>
37 
39 {
40  CProbabilityParticleBase(double logw = 0) : log_w(logw) {}
41  /** The (logarithmic) weight value for this particle. */
42  double log_w{.0};
43 };
44 
45 template <class T>
48 {
49  /** The data associated with this particle. The use of copy_ptr<> allows
50  * relying on compiler-generated copy ctor, etc. */
52 };
53 
54 template <class T>
57 {
58  CProbabilityParticle() = default;
59  CProbabilityParticle(const T& data, const double logw)
60  : CProbabilityParticleBase(logw), d(data)
61  {
62  }
63  /** The data associated with this particle */
64  T d{};
65 };
66 
67 } // namespace mrpt::bayes
The namespace for Bayesian filtering algorithm: different particle filters and Kalman filter algorith...
double log_w
The (logarithmic) weight value for this particle.
A template class for holding a the data and the weight of a particle.
particle_storage_mode
use for CProbabilityParticle
static struct FontData data
Definition: gltext.cpp:144



Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020