ProbabilityMeasures.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package MemoryX::Core
17 * @author Alexey Kozlov ( kozlov at kit dot edu)
18 * @date 2012
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
25 #include <MemoryX/interface/core/ProbabilityMeasures.h>
27 
28 #include <Eigen/Core>
29 
30 namespace armarx::VariantType
31 {
32  // variant types
33  const armarx::VariantTypeId DiscreteProbability = armarx::Variant::addTypeName("::memoryx::DiscreteProbabilityBase");
34  const armarx::VariantTypeId UnivariateNormalDistribution = armarx::Variant::addTypeName("::memoryx::UnivariateNormalDistributionBase");
35  const armarx::VariantTypeId IsotropicNormalDistribution = armarx::Variant::addTypeName("::memoryx::IsotropicNormalDistributionBase");
36  const armarx::VariantTypeId MultivariateNormalDistribution = armarx::Variant::addTypeName("::memoryx::MultivariateNormalDistributionBase");
37  const armarx::VariantTypeId GaussianMixtureDistribution = armarx::Variant::addTypeName("::memoryx::GaussianMixtureDistributionBase");
38 }
39 
40 namespace memoryx
41 {
42  /**
43  * @brief The DiscreteProbability class
44  * @ingroup VariantsGrp
45  */
47  virtual public memoryx::DiscreteProbabilityBase
48  {
49  public:
52  ~DiscreteProbability() override;
53 
54  ::Ice::Float getProbability(const ::Ice::Current& = Ice::emptyCurrent) const override;
55  void setProbability(::Ice::Float, const ::Ice::Current& = Ice::emptyCurrent) override;
56 
57  // inherited from VariantDataClass
58  Ice::ObjectPtr ice_clone() const override
59  {
60  return this->clone();
61  }
62  armarx::VariantDataClassPtr clone(const Ice::Current& c = Ice::emptyCurrent) const override
63  {
64  return new DiscreteProbability(this->prob);
65  }
66  std::string output(const Ice::Current& c = Ice::emptyCurrent) const override
67  {
68  std::stringstream s;
69  s << prob;
70  return s.str();
71  }
72  armarx::VariantTypeId getType(const Ice::Current& c = Ice::emptyCurrent) const override
73  {
75  }
76  bool validate(const Ice::Current& c = Ice::emptyCurrent) override
77  {
78  return true;
79  }
80 
81  public: // serialization
82  void serialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) const override;
83  void deserialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) override;
84 
85  };
86 
88  virtual public memoryx::NormalDistributionBase
89  {
90  public:
91  int getDimensions(const ::Ice::Current& = Ice::emptyCurrent) const override
92  {
93  return dimensions;
94  }
95  FloatVector getMean(const ::Ice::Current& = Ice::emptyCurrent) const override
96  {
97  return mean;
98  }
99  void setMean(const FloatVector& mean, const ::Ice::Current& = Ice::emptyCurrent) override
100  {
101  this->mean = mean;
102  }
103  float getCovariance(int row, int col, const ::Ice::Current& = Ice::emptyCurrent) const override = 0;
104 
105  Eigen::VectorXf toEigenMean() const;
106  void fromEigenMean(const Eigen::VectorXf& mean);
107 
108  virtual Eigen::MatrixXf toEigenCovariance() const = 0;
109  virtual void fromEigenCovariance(const Eigen::MatrixXf& cov) = 0;
110  virtual float getDensity(const Eigen::VectorXf& p) = 0;
111 
112  std::string output(const Ice::Current& c = Ice::emptyCurrent) const override;
113 
114  protected:
115  NormalDistribution(int dimensions);
117  NormalDistribution(const Eigen::VectorXf& mean);
119 
120  protected: // serialization
121  void serialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) const override;
122  void deserialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) override;
123  };
124 
126 
127  /**
128  * @brief The UnivariateNormalDistribution class
129  * @ingroup VariantsGrp
130  */
132  virtual public memoryx::UnivariateNormalDistributionBase,
133  virtual public memoryx::NormalDistribution
134  {
135  public:
137  UnivariateNormalDistribution(float mean, float var);
139 
140  ::Ice::Float getVariance(const ::Ice::Current& = Ice::emptyCurrent) const override;
141  void setVariance(::Ice::Float, const ::Ice::Current& = Ice::emptyCurrent) override;
142 
143  float getCovariance(int row, int col, const ::Ice::Current& = Ice::emptyCurrent) const override;
144  Eigen::MatrixXf toEigenCovariance() const override;
145  void fromEigenCovariance(const Eigen::MatrixXf& cov) override;
146  float getDensity(const Eigen::VectorXf& p) override
147  {
148  return 0.;
149  }
150 
151 
152  // inherited from VariantDataClass
153  Ice::ObjectPtr ice_clone() const override
154  {
155  return this->clone();
156  }
157  armarx::VariantDataClassPtr clone(const Ice::Current& c = Ice::emptyCurrent) const override
158  {
159  return new UnivariateNormalDistribution(*this);
160  }
161  // std::string output(const Ice::Current& c = Ice::emptyCurrent) const { std::stringstream s; s << variance; return s.str(); };
162  armarx::VariantTypeId getType(const Ice::Current& c = Ice::emptyCurrent) const override
163  {
165  }
166  bool validate(const Ice::Current& c = Ice::emptyCurrent) override
167  {
168  return true;
169  }
170 
171  public: // serialization
172  void serialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) const override;
173  void deserialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) override;
174 
175  };
176 
178 
179  /**
180  * @brief The IsotropicNormalDistribution class
181  * @ingroup VariantsGrp
182  */
184  virtual public memoryx::IsotropicNormalDistributionBase,
185  virtual public memoryx::NormalDistribution
186  {
187  public:
188  IsotropicNormalDistribution(int dimensions = 0);
190  IsotropicNormalDistribution(const Eigen::VectorXf& mean, const Eigen::VectorXf& vars);
192 
193  ::Ice::Float getVariance(::Ice::Int dim, const ::Ice::Current& = Ice::emptyCurrent) const override;
194  void setVariance(::Ice::Int dim, ::Ice::Float, const ::Ice::Current& = Ice::emptyCurrent) override;
195 
196  float getCovariance(int row, int col, const ::Ice::Current& = Ice::emptyCurrent) const override;
197  Eigen::MatrixXf toEigenCovariance() const override;
198  void fromEigenCovariance(const Eigen::MatrixXf& cov) override;
199  float getDensity(const Eigen::VectorXf& p) override
200  {
201  return 0.;
202  }
203 
204  // inherited from VariantDataClass
205  Ice::ObjectPtr ice_clone() const override
206  {
207  return this->clone();
208  }
209  armarx::VariantDataClassPtr clone(const Ice::Current& c = Ice::emptyCurrent) const override
210  {
211  return new IsotropicNormalDistribution(*this);
212  }
213  armarx::VariantTypeId getType(const Ice::Current& c = Ice::emptyCurrent) const override
214  {
216  }
217  bool validate(const Ice::Current& c = Ice::emptyCurrent) override
218  {
219  return true;
220  }
221 
222  public: // serialization
223  void serialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) const override;
224  void deserialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) override;
225 
226  };
227 
229 
232  /**
233  * @brief The MultivariateNormalDistribution class
234  * @ingroup VariantsGrp
235  */
237  virtual public memoryx::MultivariateNormalDistributionBase,
238  virtual public memoryx::NormalDistribution
239  {
240  public:
241  MultivariateNormalDistribution(int dimensions = 0);
243  MultivariateNormalDistribution(const Eigen::VectorXf& mean, const Eigen::MatrixXf& vars);
245 
246  /*!
247  * \brief Create a distribution with uncertainty of variance in all directions (default: variance = 10000, i.e. standard deviation is 100 mm)
248  * \param variance
249  * \return
250  */
252  {
253  Eigen::Matrix3f covar = variance * Eigen::Matrix3f::Identity();
254  Eigen::Vector3f mean = Eigen::Vector3f::Zero();
256  }
257 
258  float getCovariance(int row, int col, const ::Ice::Current& = Ice::emptyCurrent) const override;
259  void setCovariance(::Ice::Int row, ::Ice::Int col, ::Ice::Float cov, const ::Ice::Current& = Ice::emptyCurrent) override;
260  float getVarianceScalar(const ::Ice::Current& = Ice::emptyCurrent) const override;
261 
262  Eigen::MatrixXf toEigenCovariance() const override;
263  void fromEigenCovariance(const Eigen::MatrixXf& cov) override;
264  float getDensity(const Eigen::VectorXf& point) override;
265 
266  // inherited from VariantDataClass
267  Ice::ObjectPtr ice_clone() const override
268  {
269  return this->clone();
270  }
271  armarx::VariantDataClassPtr clone(const Ice::Current& c = Ice::emptyCurrent) const override
272  {
273  return new MultivariateNormalDistribution(*this);
274  }
275  armarx::VariantTypeId getType(const Ice::Current& c = Ice::emptyCurrent) const override
276  {
278  }
279  bool validate(const Ice::Current& c = Ice::emptyCurrent) override
280  {
281  return true;
282  }
283 
284  public: // serialization
285  void serialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) const override;
286  void deserialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) override;
287  };
288 
289 
290 
292 
294  /**
295  * @brief The GaussianMixtureDistribution class
296  * @ingroup VariantsGrp
297  */
299  virtual public GaussianMixtureDistributionBase
300  {
301  public:
304 
305  void clear(const ::Ice::Current& = Ice::emptyCurrent) override;
306  ::Ice::Int size(const ::Ice::Current& = Ice::emptyCurrent) const override;
307 
308  ::Ice::Int getDimensions(const ::Ice::Current& = Ice::emptyCurrent) const override;
309  GaussianMixtureComponent getComponent(::Ice::Int index, const ::Ice::Current& = Ice::emptyCurrent) const override;
310  GaussianMixtureComponent getModalComponent(const ::Ice::Current& = Ice::emptyCurrent) const override;
311  void addComponent(const GaussianMixtureComponent& component, const ::Ice::Current& = Ice::emptyCurrent) override;
312  void addComponent(const NormalDistributionBasePtr& gaussian, float weight);
313  void addGaussian(const NormalDistributionBasePtr& gaussian, float weight, const ::Ice::Current& = Ice::emptyCurrent) override;
314  void setComponent(::Ice::Int index, const GaussianMixtureComponent& component, const ::Ice::Current& = Ice::emptyCurrent) override;
315  void removeComponent(::Ice::Int index, const ::Ice::Current& = Ice::emptyCurrent) override;
316 
317  /**
318  * Multiply weight of each GM component with a given constant
319  *
320  * @param factor constant to multiply with (scaling factor)
321  */
322  void addComponents(const GaussianMixtureDistributionBasePtr& other, const ::Ice::Current& = Ice::emptyCurrent) override;
323 
324  /**
325  * Multiply weight of each GM component with a given constant
326  *
327  * @param factor constant to multiply with (scaling factor)
328  */
329  void scaleComponents(::Ice::Float factor, const ::Ice::Current& = Ice::emptyCurrent) override;
330 
331  /**
332  * Remove all components with weights lower than threshold value
333  *
334  * @param threshold
335  */
336  void pruneComponents(::Ice::Float threshold, const ::Ice::Current& = Ice::emptyCurrent) override;
337 
338  /**
339  * Normalize components weights (i.e. sum of weights = 1.0)
340  */
341  void normalize(const ::Ice::Current& = Ice::emptyCurrent) override;
342 
343  virtual float getDensity(const Eigen::VectorXf& point);
344 
345 
346  /**
347  * Convert or approximate given ProbabilityMeasure to a gaussian mixture. To special cases implemented so far:
348  * probMeasure is a gaussian (NormalDistibution) -> create GM with a single component probMeasure
349  * probMeasure is a gaussian mixture -> just return probMeasure itself
350  *
351  * probMeasure probability measure to approximate/convert
352  */
353  static GaussianMixtureDistributionPtr FromProbabilityMeasure(const ProbabilityMeasureBasePtr& probMeasure);
354 
355  // inherited from VariantDataClass
356  Ice::ObjectPtr ice_clone() const override
357  {
358  return this->clone();
359  }
360  armarx::VariantDataClassPtr clone(const Ice::Current& c = Ice::emptyCurrent) const override
361  {
362  return new GaussianMixtureDistribution(*this);
363  }
364  armarx::VariantTypeId getType(const Ice::Current& c = Ice::emptyCurrent) const override
365  {
367  }
368  bool validate(const Ice::Current& c = Ice::emptyCurrent) override
369  {
370  return true;
371  }
372 
373  std::string output(const Ice::Current& c = Ice::emptyCurrent) const override;
374 
375  public: // serialization
376  void serialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) const override;
377  void deserialize(const armarx::ObjectSerializerBasePtr& serializer, const ::Ice::Current& = Ice::emptyCurrent) override;
378 
379  private:
380  float getTotalWeight() const;
381  };
382 
383 }
384 
memoryx::IsotropicNormalDistribution::getVariance
::Ice::Float getVariance(::Ice::Int dim, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:273
memoryx::DiscreteProbability::setProbability
void setProbability(::Ice::Float, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:45
memoryx::GaussianMixtureDistribution::getType
armarx::VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:364
memoryx::UnivariateNormalDistribution::getCovariance
float getCovariance(int row, int col, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:195
armarx::VariantType::GaussianMixtureDistribution
const armarx::VariantTypeId GaussianMixtureDistribution
Definition: ProbabilityMeasures.h:37
memoryx::IsotropicNormalDistribution
The IsotropicNormalDistribution class.
Definition: ProbabilityMeasures.h:183
memoryx::NormalDistribution::fromEigenMean
void fromEigenMean(const Eigen::VectorXf &mean)
Definition: ProbabilityMeasures.cpp:102
memoryx::GaussianMixtureDistribution::removeComponent
void removeComponent(::Ice::Int index, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:566
memoryx::GaussianMixtureDistribution::getModalComponent
GaussianMixtureComponent getModalComponent(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:505
memoryx::GaussianMixtureDistribution::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:683
armarx::VariantType::IsotropicNormalDistribution
const armarx::VariantTypeId IsotropicNormalDistribution
Definition: ProbabilityMeasures.h:35
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:918
memoryx::DiscreteProbability::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProbabilityMeasures.h:58
memoryx::GaussianMixtureDistribution::addGaussian
void addGaussian(const NormalDistributionBasePtr &gaussian, float weight, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:545
memoryx::IsotropicNormalDistribution::getDensity
float getDensity(const Eigen::VectorXf &p) override
Definition: ProbabilityMeasures.h:199
memoryx::GaussianMixtureDistribution::size
::Ice::Int size(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:583
memoryx::UnivariateNormalDistribution::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.h:166
memoryx::IsotropicNormalDistribution::fromEigenCovariance
void fromEigenCovariance(const Eigen::MatrixXf &cov) override
Definition: ProbabilityMeasures.cpp:308
index
uint8_t index
Definition: EtherCATFrame.h:59
memoryx::DiscreteProbability::~DiscreteProbability
~DiscreteProbability() override
Definition: ProbabilityMeasures.cpp:38
memoryx::NormalDistribution::getCovariance
float getCovariance(int row, int col, const ::Ice::Current &=Ice::emptyCurrent) const override=0
memoryx::UnivariateNormalDistribution::clone
armarx::VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:157
memoryx::NormalDistribution::fromEigenCovariance
virtual void fromEigenCovariance(const Eigen::MatrixXf &cov)=0
memoryx::NormalDistribution::setMean
void setMean(const FloatVector &mean, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.h:99
memoryx::NormalDistribution::getMean
FloatVector getMean(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:95
memoryx::MultivariateNormalDistribution::getCovariance
float getCovariance(int row, int col, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:381
memoryx::UnivariateNormalDistribution::getVariance
::Ice::Float getVariance(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:185
memoryx::IsotropicNormalDistribution::setVariance
void setVariance(::Ice::Int dim, ::Ice::Float, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:278
memoryx::UnivariateNormalDistribution::getType
armarx::VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:162
memoryx::IsotropicNormalDistribution::getCovariance
float getCovariance(int row, int col, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:286
memoryx::GaussianMixtureDistribution::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:712
memoryx::DiscreteProbability::getProbability
::Ice::Float getProbability(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:40
memoryx::IsotropicNormalDistribution::IsotropicNormalDistribution
IsotropicNormalDistribution(int dimensions=0)
Definition: ProbabilityMeasures.cpp:244
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::IsotropicNormalDistribution::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProbabilityMeasures.h:205
memoryx::GaussianMixtureDistribution::getDimensions
::Ice::Int getDimensions(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:491
memoryx::GaussianMixtureDistribution::normalize
void normalize(const ::Ice::Current &=Ice::emptyCurrent) override
Normalize components weights (i.e.
Definition: ProbabilityMeasures.cpp:634
memoryx::GaussianMixtureDistribution::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:696
memoryx::IsotropicNormalDistribution::clone
armarx::VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:209
memoryx::UnivariateNormalDistribution::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:224
memoryx::MultivariateNormalDistribution::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:452
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::MultivariateNormalDistribution::getVarianceScalar
float getVarianceScalar(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:406
memoryx::GaussianMixtureDistribution::pruneComponents
void pruneComponents(::Ice::Float threshold, const ::Ice::Current &=Ice::emptyCurrent) override
Remove all components with weights lower than threshold value.
Definition: ProbabilityMeasures.cpp:616
memoryx::MultivariateNormalDistribution::CreateDefaultDistribution
static MultivariateNormalDistributionPtr CreateDefaultDistribution(float variance=10000)
Create a distribution with uncertainty of variance in all directions (default: variance = 10000,...
Definition: ProbabilityMeasures.h:251
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
memoryx::GaussianMixtureDistribution::addComponent
void addComponent(const GaussianMixtureComponent &component, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:523
memoryx::DiscreteProbability::getType
armarx::VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:72
memoryx::NormalDistribution::toEigenCovariance
virtual Eigen::MatrixXf toEigenCovariance() const =0
armarx::mean
std::optional< float > mean(const boost::circular_buffer< NameValueMap > &buffer, const std::string &key)
Definition: KinematicUnitGuiPlugin.cpp:1615
memoryx::GaussianMixtureDistribution::clone
armarx::VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:360
memoryx::MultivariateNormalDistribution::setCovariance
void setCovariance(::Ice::Int row, ::Ice::Int col, ::Ice::Float cov, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:392
memoryx::UnivariateNormalDistribution::toEigenCovariance
Eigen::MatrixXf toEigenCovariance() const override
Definition: ProbabilityMeasures.cpp:205
memoryx::NormalDistribution::getDimensions
int getDimensions(const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:91
armarx::FloatVector
::std::vector< ::Ice::Float > FloatVector
Definition: KinematicUnitGuiPlugin.h:327
memoryx::MultivariateNormalDistribution
The MultivariateNormalDistribution class.
Definition: ProbabilityMeasures.h:236
memoryx::DiscreteProbability
The DiscreteProbability class.
Definition: ProbabilityMeasures.h:46
memoryx::GaussianMixtureDistribution
The GaussianMixtureDistribution class.
Definition: ProbabilityMeasures.h:298
memoryx::NormalDistribution::toEigenMean
Eigen::VectorXf toEigenMean() const
Definition: ProbabilityMeasures.cpp:96
memoryx::IsotropicNormalDistribution::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:339
memoryx::IsotropicNormalDistribution::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.h:217
memoryx::UnivariateNormalDistribution::setVariance
void setVariance(::Ice::Float, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:190
memoryx::GaussianMixtureDistribution::getDensity
virtual float getDensity(const Eigen::VectorXf &point)
Definition: ProbabilityMeasures.cpp:644
memoryx::GaussianMixtureDistribution::setComponent
void setComponent(::Ice::Int index, const GaussianMixtureComponent &component, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:550
armarx::VariantType
Definition: ChannelRef.h:160
memoryx::DiscreteProbability::DiscreteProbability
DiscreteProbability()
Definition: ProbabilityMeasures.cpp:34
memoryx::NormalDistribution::NormalDistribution
NormalDistribution(int dimensions)
Definition: ProbabilityMeasures.cpp:69
armarx::VariantTypeId
Ice::Int VariantTypeId
Definition: Variant.h:44
memoryx::UnivariateNormalDistribution::UnivariateNormalDistribution
UnivariateNormalDistribution()
Definition: ProbabilityMeasures.cpp:161
memoryx::UnivariateNormalDistribution
The UnivariateNormalDistribution class.
Definition: ProbabilityMeasures.h:131
memoryx::MultivariateNormalDistribution::MultivariateNormalDistribution
MultivariateNormalDistribution(int dimensions=0)
Definition: ProbabilityMeasures.cpp:352
memoryx::GaussianMixtureDistribution::addComponents
void addComponents(const GaussianMixtureDistributionBasePtr &other, const ::Ice::Current &=Ice::emptyCurrent) override
Multiply weight of each GM component with a given constant.
Definition: ProbabilityMeasures.cpp:600
memoryx::MultivariateNormalDistributionPtr
IceInternal::Handle< MultivariateNormalDistribution > MultivariateNormalDistributionPtr
Definition: ProbabilityMeasures.h:231
memoryx::GaussianMixtureDistribution::FromProbabilityMeasure
static GaussianMixtureDistributionPtr FromProbabilityMeasure(const ProbabilityMeasureBasePtr &probMeasure)
Convert or approximate given ProbabilityMeasure to a gaussian mixture.
Definition: ProbabilityMeasures.cpp:658
memoryx::NormalDistribution::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:114
memoryx::MultivariateNormalDistribution::clone
armarx::VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:271
memoryx::GaussianMixtureDistribution::GaussianMixtureDistribution
GaussianMixtureDistribution()
GaussianMixtureDistribution implementation.
Definition: ProbabilityMeasures.cpp:471
memoryx::GaussianMixtureDistribution::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProbabilityMeasures.h:356
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
memoryx::IsotropicNormalDistribution::toEigenCovariance
Eigen::MatrixXf toEigenCovariance() const override
Definition: ProbabilityMeasures.cpp:296
memoryx::UnivariateNormalDistribution::fromEigenCovariance
void fromEigenCovariance(const Eigen::MatrixXf &cov) override
Definition: ProbabilityMeasures.cpp:212
memoryx::DiscreteProbability::clone
armarx::VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:62
memoryx::MultivariateNormalDistribution::toEigenCovariance
Eigen::MatrixXf toEigenCovariance() const override
Definition: ProbabilityMeasures.cpp:419
armarx::VariantType::UnivariateNormalDistribution
const armarx::VariantTypeId UnivariateNormalDistribution
Definition: ProbabilityMeasures.h:34
memoryx::UnivariateNormalDistribution::getDensity
float getDensity(const Eigen::VectorXf &p) override
Definition: ProbabilityMeasures.h:146
memoryx::GaussianMixtureDistribution::clear
void clear(const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:578
memoryx::DiscreteProbability::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:66
memoryx::UnivariateNormalDistribution::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:232
memoryx::MultivariateNormalDistribution::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:460
memoryx::NormalDistribution::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:141
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
memoryx::GaussianMixtureDistribution::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.h:368
memoryx::NormalDistribution::getDensity
virtual float getDensity(const Eigen::VectorXf &p)=0
memoryx::MultivariateNormalDistribution::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.h:279
memoryx::NormalDistribution::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:148
memoryx::MultivariateNormalDistribution::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProbabilityMeasures.h:267
memoryx::NormalDistribution
Definition: ProbabilityMeasures.h:87
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::GaussianMixtureDistribution::scaleComponents
void scaleComponents(::Ice::Float factor, const ::Ice::Current &=Ice::emptyCurrent) override
Multiply weight of each GM component with a given constant.
Definition: ProbabilityMeasures.cpp:608
memoryx::DiscreteProbability::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.cpp:57
memoryx::UnivariateNormalDistribution::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: ProbabilityMeasures.h:153
memoryx::DiscreteProbability::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:50
memoryx::MultivariateNormalDistribution::fromEigenCovariance
void fromEigenCovariance(const Eigen::MatrixXf &cov) override
Definition: ProbabilityMeasures.cpp:425
armarx::VariantType::DiscreteProbability
const armarx::VariantTypeId DiscreteProbability
Definition: ProbabilityMeasures.h:33
Variant.h
memoryx::DiscreteProbability::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: ProbabilityMeasures.h:76
memoryx::IsotropicNormalDistribution::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:331
memoryx::MultivariateNormalDistribution::getType
armarx::VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:275
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx::Variant::addTypeName
static VariantTypeId addTypeName(const std::string &typeName)
Register a new type for the use in a Variant.
Definition: Variant.cpp:751
memoryx::GaussianMixtureDistribution::getComponent
GaussianMixtureComponent getComponent(::Ice::Int index, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.cpp:496
memoryx::MultivariateNormalDistribution::getDensity
float getDensity(const Eigen::VectorXf &point) override
Definition: ProbabilityMeasures.cpp:437
armarx::VariantType::MultivariateNormalDistribution
const armarx::VariantTypeId MultivariateNormalDistribution
Definition: ProbabilityMeasures.h:36
memoryx::IsotropicNormalDistribution::getType
armarx::VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: ProbabilityMeasures.h:213