ProbabilityMeasures.cpp
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 WorkingMemory
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#include "ProbabilityMeasures.h"
24
25#include <Eigen/LU>
26
28
29namespace memoryx
30{
31 /*
32 * DiscreteProbability class
33 *
34 */
36 DiscreteProbabilityBase::DiscreteProbabilityBase(0.)
37 {
38 }
39
41 DiscreteProbabilityBase::DiscreteProbabilityBase(prob)
42 {
43 }
44
48
49 Ice::Float
50 DiscreteProbability::getProbability(const Ice::Current& c) const
51 {
52 return prob;
53 }
54
55 void
56 DiscreteProbability::setProbability(Ice::Float prob, const Ice::Current&)
57 {
58 this->prob = prob;
59 }
60
61 void
62 DiscreteProbability::serialize(const armarx::ObjectSerializerBasePtr& serializer,
63 const Ice::Current&) const
64 {
66 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
67
68 obj->setFloat("prob", prob);
69 }
70
71 void
72 DiscreteProbability::deserialize(const armarx::ObjectSerializerBasePtr& serializer,
73 const Ice::Current&)
74 {
76 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
77
78 prob = obj->getFloat("prob");
79 }
80
81 /*
82 * NormalDistribution class
83 *
84 */
86 {
87 this->dimensions = dimensions;
88 this->mean.resize(dimensions);
89 }
90
91 NormalDistribution::NormalDistribution(const FloatVector& mean) :
92 NormalDistributionBase(mean.size(), mean)
93 {
94 }
95
96 NormalDistribution::NormalDistribution(const Eigen::VectorXf& mean)
97 {
98 this->dimensions = mean.rows();
99 this->mean.resize(dimensions);
100 fromEigenMean(mean);
101 }
102
104 IceUtil::Shared(other), NormalDistributionBase()
105 // NormalDistributionBase(other)
106 {
107 this->dimensions = other.dimensions;
108 this->mean = other.mean;
109 }
110
111 Eigen::VectorXf
113 {
114 Eigen::VectorXf result =
115 Eigen::Map<const Eigen::VectorXf>(this->mean.data(), this->dimensions);
116 return result;
117 }
118
119 void
120 NormalDistribution::fromEigenMean(const Eigen::VectorXf& mean)
121 {
122 if (this->dimensions == mean.rows())
123 {
124 Eigen::Map<Eigen::VectorXf>(this->mean.data(), this->dimensions) = mean;
125 }
126 else
127 {
129 }
130 }
131
132 std::string
133 NormalDistribution::output(const Ice::Current& c) const
134 {
135 std::stringstream s;
136 Eigen::MatrixXf cov = this->toEigenCovariance();
137 if (dimensions > 0)
138 {
139 s << "Standard deviation(mm): " << pow(cov.determinant(), 0.5 / dimensions);
140 }
141
142 s << " mean: (";
143
144 for (size_t i = 0; i < mean.size(); ++i)
145 {
146 s << mean[i] << ((i != mean.size() - 1) ? ", " : ") ");
147 }
148
149 s << "cov: (";
150
151 for (int i = 0; i < dimensions; ++i)
152 for (int j = 0; j < dimensions; ++j)
153 {
154 s << getCovariance(i, j)
155 << ((i != dimensions - 1 || j != dimensions - 1) ? ", " : ")");
156 }
157
158 return s.str();
159 }
160
161 void
162 NormalDistribution::serialize(const armarx::ObjectSerializerBasePtr& serializer,
163 const Ice::Current&) const
164 {
166 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
167
168 obj->setFloatArray("mean", mean);
169 }
170
171 void
172 NormalDistribution::deserialize(const armarx::ObjectSerializerBasePtr& serializer,
173 const Ice::Current&)
174 {
176 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
177
178 obj->getFloatArray("mean", mean);
179 dimensions = mean.size();
180 }
181
182 /*
183 * UnivariateNormalDistribution class
184 *
185 */
187 UnivariateNormalDistributionBase::UnivariateNormalDistributionBase(),
189 {
190 variance = 0.0f;
191 }
192
194 UnivariateNormalDistributionBase::UnivariateNormalDistributionBase(),
196 {
197 variance = var;
198 this->mean.push_back(mean);
199 }
200
202 const UnivariateNormalDistribution& other) :
203 IceUtil::Shared(other),
204 NormalDistributionBase(/*other*/),
205 UnivariateNormalDistributionBase(/*other*/),
206 NormalDistribution(other)
207 {
208 variance = other.variance;
209 }
210
211 Ice::Float
213 {
214 return variance;
215 }
216
217 void
218 UnivariateNormalDistribution::setVariance(Ice::Float var, const Ice::Current&)
219 {
220 variance = var;
221 }
222
223 float
224 UnivariateNormalDistribution::getCovariance(int row, int col, const ::Ice::Current&) const
225 {
226 if ((row == 0) && (col == 0))
227 {
228 return variance;
229 }
230
231 return 0;
232 }
233
234 Eigen::MatrixXf
236 {
237 Eigen::MatrixXf result(1, 1);
238 result << this->variance;
239 return result;
240 }
241
242 void
244 {
245 if (cov.rows() == 1 && cov.cols() == 1)
246 {
247 this->variance = cov(1, 1);
248 }
249 else
250 {
252 }
253 }
254
255 void
256 UnivariateNormalDistribution::serialize(const armarx::ObjectSerializerBasePtr& serializer,
257 const Ice::Current& c) const
258 {
260 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
261
263 obj->setFloat("var", variance);
264 }
265
266 void
267 UnivariateNormalDistribution::deserialize(const armarx::ObjectSerializerBasePtr& serializer,
268 const Ice::Current& c)
269 {
271 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
272
274 variance = obj->getFloat("var");
275 }
276
277 /*
278 * IsotropicNormalDistribution class
279 *
280 */
283 {
284 this->varVector.resize(dimensions);
285 }
286
288 const FloatVector& vars) :
290 {
291 this->varVector = vars;
292 }
293
295 const Eigen::VectorXf& vars) :
297 {
298 this->varVector.resize(dimensions);
300 }
301
303 const IsotropicNormalDistribution& other) :
304 IceUtil::Shared(other),
305 NormalDistributionBase(other),
306 IsotropicNormalDistributionBase(other),
307 NormalDistribution(other)
308 {
309 this->varVector.assign(other.varVector.begin(), other.varVector.end());
310 }
311
312 Ice::Float
313 IsotropicNormalDistribution::getVariance(Ice::Int dim, const Ice::Current&) const
314 {
315 return (size_t)dim < varVector.size() ? varVector[dim] : -1.;
316 }
317
318 void
319 IsotropicNormalDistribution::setVariance(Ice::Int dim, Ice::Float var, const Ice::Current&)
320 {
321 if ((size_t)dim < varVector.size())
322 {
323 varVector[dim] = var;
324 }
325 }
326
327 float
328 IsotropicNormalDistribution::getCovariance(int row, int col, const ::Ice::Current&) const
329 {
330 if (row != col)
331 {
332 return 0.;
333 }
334
335 return varVector[row];
336 }
337
338 Eigen::MatrixXf
340 {
341 Eigen::MatrixXf result(dimensions, dimensions);
342
343 for (int i = 0; i < dimensions; ++i)
344 {
345 result(i, i) = varVector[i];
346 }
347
348 return result;
349 }
350
351 void
353 {
354 if (cov.rows() == 1 && cov.cols() == dimensions)
355 {
356 for (int i = 0; i < dimensions; ++i)
357 {
358 varVector[i] = cov(0, i);
359 }
360 }
361 else if (cov.rows() == dimensions && cov.cols() == dimensions)
362 {
363 for (int i = 0; i < dimensions; ++i)
364 {
365 varVector[i] = cov(i, i);
366 }
367 }
368 else
369 {
371 }
372 }
373
374 void
375 IsotropicNormalDistribution::serialize(const armarx::ObjectSerializerBasePtr& serializer,
376 const Ice::Current& c) const
377 {
379 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
380
382 obj->setFloatArray("var", varVector);
383 }
384
385 void
386 IsotropicNormalDistribution::deserialize(const armarx::ObjectSerializerBasePtr& serializer,
387 const Ice::Current& c)
388 {
390 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
391
393 obj->getFloatArray("var", varVector);
394 }
395
396 /*
397 * MultivariateNormalDistribution class
398 *
399 */
402 {
403 this->covMatrix.resize(dimensions * dimensions);
404 }
405
407 const FloatVector& vars) :
409 {
410 this->covMatrix = vars;
411 }
412
414 const Eigen::MatrixXf& vars) :
416 {
417 this->covMatrix.resize(dimensions * dimensions);
419 }
420
422 const MultivariateNormalDistribution& other) :
423 IceUtil::Shared(other),
424 NormalDistributionBase(/*other*/),
425 MultivariateNormalDistributionBase(/*other*/),
426 NormalDistribution(other)
427 {
428 this->covMatrix = other.covMatrix;
429 }
430
431 Ice::Float
432 MultivariateNormalDistribution::getCovariance(int row, int col, const Ice::Current&) const
433 {
434 const int index = row * dimensions + col;
435
436 if (index >= 0 && (size_t)index < covMatrix.size())
437 {
438 return covMatrix[index];
439 }
440 throw armarx::IndexOutOfBoundsException();
441 }
442
443 void
445 Ice::Int col,
446 Ice::Float cov,
447 const Ice::Current&)
448 {
449 const int index = row * dimensions + col;
450
451 if (index >= 0 && (size_t)index < covMatrix.size())
452 {
453 covMatrix[index] = cov;
454 }
455 else
456 {
457 throw armarx::IndexOutOfBoundsException();
458 }
459 }
460
461 Ice::Float
463 {
464 if (dimensions > 0)
465 {
466 Eigen::MatrixXf cov = toEigenCovariance();
467 return pow(cov.determinant(), 0.5 / dimensions);
468 }
469 else
470 {
471 return 0;
472 }
473 }
474
475 Eigen::MatrixXf
477 {
478 Eigen::MatrixXf result =
479 Eigen::Map<const Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>>(
480 this->covMatrix.data(), this->dimensions, this->dimensions);
481 return result;
482 }
483
484 void
486 {
487 if (cov.rows() == this->dimensions && cov.cols() == this->dimensions)
488 {
489 Eigen::Map<Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>>(
490 this->covMatrix.data(), this->dimensions, this->dimensions) = cov;
491 }
492 else
493 {
495 }
496 }
497
498 float
499 MultivariateNormalDistribution::getDensity(const Eigen::VectorXf& point)
500 {
501 if (point.rows() != dimensions)
502 {
504 }
505
506 Eigen::MatrixXf cov = toEigenCovariance();
507 Eigen::VectorXf m = toEigenMean();
509 -0.5 * (point - m).transpose() * cov.inverse() * (point - m);
510 float e = expf(inner(0, 0));
511
512 return pow(2 * M_PI, -dimensions / 2.0f) * pow(cov.determinant(), -0.5) * e;
513 }
514
515 void
516 MultivariateNormalDistribution::serialize(const armarx::ObjectSerializerBasePtr& serializer,
517 const Ice::Current& c) const
518 {
520 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
521
523 obj->setFloatArray("cov", covMatrix);
524 }
525
526 void
527 MultivariateNormalDistribution::deserialize(const armarx::ObjectSerializerBasePtr& serializer,
528 const Ice::Current& c)
529 {
531 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
532
534 obj->getFloatArray("cov", covMatrix);
535 }
536
537 /**
538 * GaussianMixtureDistribution implementation
539 */
541 {
542 this->dimensions = 0;
543 }
544
546 const GaussianMixtureDistribution& other) :
547 IceUtil::Shared(other), GaussianMixtureDistributionBase(other)
548 {
549 clear();
550
551 for (GaussianMixtureComponentList::const_iterator it = other.components.begin();
552 it != other.components.end();
553 ++it)
554 {
555 GaussianMixtureComponent comp;
556 comp.gaussian = NormalDistributionBasePtr::dynamicCast(it->gaussian->clone());
557 comp.weight = it->weight;
558 addComponent(comp);
559 }
560 }
561
562 ::Ice::Int
564 {
565 return dimensions;
566 }
567
568 GaussianMixtureComponent
569 GaussianMixtureDistribution::getComponent(::Ice::Int index, const ::Ice::Current&) const
570 {
571 if (index >= 0 && (size_t)index < components.size())
572 {
573 return components[index];
574 }
575 throw armarx::IndexOutOfBoundsException();
576 }
577
578 GaussianMixtureComponent
580 {
581 if (components.empty())
582 {
583 return GaussianMixtureComponent();
584 }
585
586 GaussianMixtureComponentList::const_iterator res = components.end();
587
588 for (GaussianMixtureComponentList::const_iterator it = components.begin();
589 it != components.end();
590 ++it)
591 if (res == components.end() || it->weight > res->weight)
592 {
593 res = it;
594 }
595
596 return *res;
597 }
598
599 void
600 GaussianMixtureDistribution::addComponent(const GaussianMixtureComponent& component,
601 const ::Ice::Current&)
602 {
603 if (components.empty())
604 {
605 dimensions = component.gaussian->getDimensions();
606 }
607 else if (component.gaussian->getDimensions() != dimensions)
608 {
610 }
611
612 components.push_back(component);
613 }
614
615 void
616 GaussianMixtureDistribution::addComponent(const NormalDistributionBasePtr& gaussian,
617 float weight)
618 {
619 GaussianMixtureComponent comp;
620 comp.gaussian = gaussian;
621 comp.weight = weight;
622 addComponent(comp);
623 }
624
625 void
626 GaussianMixtureDistribution::addGaussian(const NormalDistributionBasePtr& gaussian,
627 float weight,
628 const ::Ice::Current& c)
629 {
630 addComponent(gaussian, weight);
631 }
632
633 void
635 const GaussianMixtureComponent& component,
636 const ::Ice::Current&)
637 {
638 if (index < 0 && (size_t)index >= components.size())
639 {
640 throw armarx::IndexOutOfBoundsException();
641 }
642 else if (component.gaussian->getDimensions() != dimensions)
643 {
645 }
646 else
647 {
648 components[index] = component;
649 }
650 }
651
652 void
653 GaussianMixtureDistribution::removeComponent(::Ice::Int index, const ::Ice::Current&)
654 {
655 if (index >= 0 && (size_t)index < components.size())
656 {
657 components.erase(components.begin() + index);
658 }
659 else
660 {
661 throw armarx::IndexOutOfBoundsException();
662 }
663 }
664
665 void
667 {
668 components.clear();
669 }
670
671 ::Ice::Int
672 GaussianMixtureDistribution::size(const ::Ice::Current&) const
673 {
674 return (::Ice::Int)components.size();
675 }
676
677 float
678 GaussianMixtureDistribution::getTotalWeight() const
679 {
680 float result = 0.;
681
682 for (GaussianMixtureComponentList::const_iterator it = components.begin();
683 it != components.end();
684 ++it)
685 {
686 result += it->weight;
687 }
688
689 return result;
690 }
691
692 void
693 GaussianMixtureDistribution::addComponents(const GaussianMixtureDistributionBasePtr& other,
694 const ::Ice::Current& c)
695 {
696 for (int i = 0; i < other->size(); ++i)
697 {
698 addComponent(other->getComponent(i));
699 }
700 }
701
702 void
703 GaussianMixtureDistribution::scaleComponents(::Ice::Float factor, const ::Ice::Current&)
704 {
705 for (GaussianMixtureComponentList::iterator it = components.begin(); it != components.end();
706 ++it)
707 {
708 it->weight *= factor;
709 }
710 }
711
712 void
713 GaussianMixtureDistribution::pruneComponents(::Ice::Float threshold, const ::Ice::Current&)
714 {
715 const float totalWeight = getTotalWeight();
716 GaussianMixtureComponentList::iterator it = components.begin();
717
718 while (it != components.end())
719 {
720 if (it->weight / totalWeight < threshold)
721 {
722 it = components.erase(it);
723 }
724 else
725 {
726 ++it;
727 }
728 }
729 }
730
731 void
733 {
734 const float totalWeight = getTotalWeight();
735
736 for (GaussianMixtureComponentList::iterator it = components.begin(); it != components.end();
737 ++it)
738 {
739 it->weight /= totalWeight;
740 }
741 }
742
743 float
744 GaussianMixtureDistribution::getDensity(const Eigen::VectorXf& point)
745 {
746 const float totalWeight = getTotalWeight();
747 float result = 0.f;
748
749 for (GaussianMixtureComponentList::iterator it = components.begin(); it != components.end();
750 ++it)
751 {
752 const NormalDistributionPtr gaussian = NormalDistributionPtr::dynamicCast(it->gaussian);
753 result += gaussian->getDensity(point) * it->weight / totalWeight;
754 }
755
756 return result;
757 }
758
761 const ProbabilityMeasureBasePtr& probMeasure)
762 {
763 // check if argument is already GM - in that case, we just need to cast
765 GaussianMixtureDistributionPtr::dynamicCast(probMeasure);
766
767 if (gm)
768 {
769 return gm;
770 }
771
772 // check if argument is a guassian
773 NormalDistributionBasePtr gaussian = NormalDistributionBasePtr::dynamicCast(probMeasure);
774
775 if (gaussian)
776 {
777 // if so, create GM with a single component
779 result->addComponent(gaussian, 1.);
780 return result;
781 }
782
783 // unable to convert -> return empty pointer
785 }
786
787 std::string
788 GaussianMixtureDistribution::output(const Ice::Current& c) const
789 {
790 std::stringstream s;
791
792 for (GaussianMixtureComponentList::const_iterator it = components.begin();
793 it != components.end();
794 ++it)
795 {
796 s << "{ gaussian: " << it->gaussian->output() << "weight: " << it->weight << "} \n";
797 }
798
799 return s.str();
800 }
801
802 void
803 GaussianMixtureDistribution::serialize(const armarx::ObjectSerializerBasePtr& serializer,
804 const Ice::Current& c) const
805 {
807 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
808
809 obj->setElementType(armarx::ElementTypes::eArray);
810
811 for (GaussianMixtureComponentList::const_iterator it = components.begin();
812 it != components.end();
813 ++it)
814 {
816 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer)->createElement();
817 armarx::VariantPtr gaussianVar =
818 new armarx::Variant(armarx::VariantDataClassPtr::dynamicCast(it->gaussian));
819 compValue->setVariant("gaussian", gaussianVar);
820 compValue->setFloat("weight", it->weight);
821 obj->append(compValue);
822 }
823 }
824
825 void
826 GaussianMixtureDistribution::deserialize(const armarx::ObjectSerializerBasePtr& serializer,
827 const Ice::Current& c)
828 {
830 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
831
832 clear();
833
834 for (unsigned int i = 0; i < obj->size(); ++i)
835 {
836 const armarx::AbstractObjectSerializerPtr compValue = obj->getElement(i);
837
838 GaussianMixtureComponent comp;
839 armarx::VariantPtr gaussianVar = compValue->getVariant("gaussian");
840 comp.gaussian = gaussianVar->getClass<NormalDistributionBase>();
841 comp.weight = compValue->getFloat("weight");
842 addComponent(comp);
843 }
844 }
845} // namespace memoryx
uint8_t index
#define M_PI
Definition MathTools.h:17
constexpr T c
The Variant class is described here: Variants.
Definition Variant.h:224
::Ice::Float getProbability(const ::Ice::Current &=Ice::emptyCurrent) const override
void setProbability(::Ice::Float, const ::Ice::Current &=Ice::emptyCurrent) override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
void addComponents(const GaussianMixtureDistributionBasePtr &other, const ::Ice::Current &=Ice::emptyCurrent) override
Multiply weight of each GM component with a given constant.
void clear(const ::Ice::Current &=Ice::emptyCurrent) override
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
GaussianMixtureDistribution()
GaussianMixtureDistribution implementation.
void removeComponent(::Ice::Int index, const ::Ice::Current &=Ice::emptyCurrent) override
GaussianMixtureComponent getModalComponent(const ::Ice::Current &=Ice::emptyCurrent) const override
void pruneComponents(::Ice::Float threshold, const ::Ice::Current &=Ice::emptyCurrent) override
Remove all components with weights lower than threshold value.
GaussianMixtureComponent getComponent(::Ice::Int index, const ::Ice::Current &=Ice::emptyCurrent) const override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
void scaleComponents(::Ice::Float factor, const ::Ice::Current &=Ice::emptyCurrent) override
Multiply weight of each GM component with a given constant.
virtual float getDensity(const Eigen::VectorXf &point)
void addComponent(const GaussianMixtureComponent &component, const ::Ice::Current &=Ice::emptyCurrent) override
static GaussianMixtureDistributionPtr FromProbabilityMeasure(const ProbabilityMeasureBasePtr &probMeasure)
Convert or approximate given ProbabilityMeasure to a gaussian mixture.
::Ice::Int getDimensions(const ::Ice::Current &=Ice::emptyCurrent) const override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
void normalize(const ::Ice::Current &=Ice::emptyCurrent) override
Normalize components weights (i.e.
void addGaussian(const NormalDistributionBasePtr &gaussian, float weight, const ::Ice::Current &=Ice::emptyCurrent) override
::Ice::Int size(const ::Ice::Current &=Ice::emptyCurrent) const override
void setComponent(::Ice::Int index, const GaussianMixtureComponent &component, const ::Ice::Current &=Ice::emptyCurrent) override
void fromEigenCovariance(const Eigen::MatrixXf &cov) override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
::Ice::Float getVariance(::Ice::Int dim, const ::Ice::Current &=Ice::emptyCurrent) const override
float getCovariance(int row, int col, const ::Ice::Current &=Ice::emptyCurrent) const override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Eigen::MatrixXf toEigenCovariance() const override
void setVariance(::Ice::Int dim, ::Ice::Float, const ::Ice::Current &=Ice::emptyCurrent) override
void fromEigenCovariance(const Eigen::MatrixXf &cov) override
void setCovariance(::Ice::Int row, ::Ice::Int col, ::Ice::Float cov, const ::Ice::Current &=Ice::emptyCurrent) override
float getCovariance(int row, int col, const ::Ice::Current &=Ice::emptyCurrent) const override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
float getDensity(const Eigen::VectorXf &point) override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Eigen::MatrixXf toEigenCovariance() const override
float getVarianceScalar(const ::Ice::Current &=Ice::emptyCurrent) const override
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
void fromEigenMean(const Eigen::VectorXf &mean)
float getCovariance(int row, int col, const ::Ice::Current &=Ice::emptyCurrent) const override=0
Eigen::VectorXf toEigenMean() const
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
virtual Eigen::MatrixXf toEigenCovariance() const =0
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
::Ice::Float getVariance(const ::Ice::Current &=Ice::emptyCurrent) const override
void setVariance(::Ice::Float, const ::Ice::Current &=Ice::emptyCurrent) override
void fromEigenCovariance(const Eigen::MatrixXf &cov) override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
float getCovariance(int row, int col, const ::Ice::Current &=Ice::emptyCurrent) const override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Eigen::MatrixXf toEigenCovariance() const override
IceInternal::Handle< Variant > VariantPtr
Definition Variant.h:41
IceInternal::Handle< AbstractObjectSerializer > AbstractObjectSerializerPtr
VirtualRobot headers.
IceInternal::Handle< NormalDistribution > NormalDistributionPtr
IceInternal::Handle< GaussianMixtureDistribution > GaussianMixtureDistributionPtr