Bayes Filters Library
GaussianMixture.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 GAUSSIANMIXTURE_H
9 #define GAUSSIANMIXTURE_H
10 
11 #include <vector>
12 
13 #include <Eigen/Dense>
14 
15 namespace bfl {
16  class GaussianMixture;
17 }
18 
19 
21 {
22 public:
23  GaussianMixture() noexcept;
24 
25  GaussianMixture(const std::size_t components, const std::size_t dim) noexcept;
26 
27  GaussianMixture(const std::size_t components, const std::size_t dim_linear, const std::size_t dim_circular, const bool use_quaternion = false) noexcept;
28 
29  virtual ~GaussianMixture() noexcept = default;
30 
31  virtual void resize(const std::size_t components, const std::size_t dim_linear, const std::size_t dim_circular = 0);
32 
33  Eigen::Ref<Eigen::MatrixXd> mean();
34 
35  Eigen::Ref<Eigen::VectorXd> mean(const std::size_t i);
36 
37  double& mean(const std::size_t i, const std::size_t j);
38 
39  const Eigen::Ref<const Eigen::MatrixXd> mean() const;
40 
41  const Eigen::Ref<const Eigen::VectorXd> mean(const std::size_t i) const;
42 
43  const double& mean(const std::size_t i, const std::size_t j) const;
44 
45  Eigen::Ref<Eigen::MatrixXd> covariance();
46 
47  Eigen::Ref<Eigen::MatrixXd> covariance(const std::size_t i);
48 
49  double& covariance(const std::size_t i, const std::size_t j, const std::size_t k);
50 
51  const Eigen::Ref<const Eigen::MatrixXd> covariance() const;
52 
53  const Eigen::Ref<const Eigen::MatrixXd> covariance(const std::size_t i) const;
54 
55  const double& covariance(const std::size_t i, const std::size_t j, const std::size_t k) const;
56 
57  Eigen::Ref<Eigen::VectorXd> weight();
58 
59  double& weight(const std::size_t i);
60 
61  const Eigen::Ref<const Eigen::VectorXd> weight() const;
62 
63  const double& weight(const std::size_t i) const;
64 
65  bool augmentWithNoise(const Eigen::Ref<const Eigen::MatrixXd>& noise_covariance_matrix);
66 
67  std::size_t components;
68 
70 
72 
73  std::size_t dim;
74 
75  std::size_t dim_linear;
76 
77  std::size_t dim_circular;
78 
79  std::size_t dim_noise;
80 
81  std::size_t dim_covariance;
82 
83 protected:
84  Eigen::MatrixXd mean_;
85 
86  Eigen::MatrixXd covariance_;
87 
88  Eigen::VectorXd weight_;
89 };
90 
91 #endif /* GAUSSIANMIXTURE_H */
bfl::GaussianMixture::GaussianMixture
GaussianMixture() noexcept
Definition: GaussianMixture.cpp:14
bfl::GaussianMixture::covariance_
Eigen::MatrixXd covariance_
Definition: GaussianMixture.h:86
bfl::GaussianMixture::dim_circular
std::size_t dim_circular
Definition: GaussianMixture.h:77
bfl::GaussianMixture::dim_circular_component
std::size_t dim_circular_component
Definition: GaussianMixture.h:71
bfl::GaussianMixture::dim_covariance
std::size_t dim_covariance
Definition: GaussianMixture.h:81
bfl
Port of boost::any for C++11 compilers.
Definition: AdditiveMeasurementModel.h:13
bfl::GaussianMixture::components
std::size_t components
Definition: GaussianMixture.h:67
bfl::GaussianMixture::dim_linear
std::size_t dim_linear
Definition: GaussianMixture.h:75
bfl::GaussianMixture::mean_
Eigen::MatrixXd mean_
Definition: GaussianMixture.h:84
bfl::GaussianMixture::~GaussianMixture
virtual ~GaussianMixture() noexcept=default
bfl::GaussianMixture::mean
Eigen::Ref< Eigen::MatrixXd > mean()
Definition: GaussianMixture.cpp:94
bfl::GaussianMixture::dim_noise
std::size_t dim_noise
Definition: GaussianMixture.h:79
bfl::GaussianMixture::covariance
Eigen::Ref< Eigen::MatrixXd > covariance()
Definition: GaussianMixture.cpp:130
bfl::GaussianMixture::resize
virtual void resize(const std::size_t components, const std::size_t dim_linear, const std::size_t dim_circular=0)
Definition: GaussianMixture.cpp:64
bfl::GaussianMixture::dim
std::size_t dim
Definition: GaussianMixture.h:73
bfl::GaussianMixture::use_quaternion
bool use_quaternion
Definition: GaussianMixture.h:69
bfl::GaussianMixture::augmentWithNoise
bool augmentWithNoise(const Eigen::Ref< const Eigen::MatrixXd > &noise_covariance_matrix)
Definition: GaussianMixture.cpp:190
bfl::GaussianMixture::weight_
Eigen::VectorXd weight_
Definition: GaussianMixture.h:88
bfl::GaussianMixture
Definition: GaussianMixture.h:20
bfl::GaussianMixture::weight
Eigen::Ref< Eigen::VectorXd > weight()
Definition: GaussianMixture.cpp:166