MRPT  1.9.9
CProbabilityParticle.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://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 {
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 }
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
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:3546



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020