g2o
Public Member Functions | Protected Attributes | List of all members
g2o::GaussianSampler< SampleType, CovarianceType > Class Template Reference

#include <sampler.h>

Collaboration diagram for g2o::GaussianSampler< SampleType, CovarianceType >:
Collaboration graph
[legend]

Public Member Functions

 GaussianSampler (bool hasGenerator=true)
 
 ~GaussianSampler ()
 
void setDistribution (const CovarianceType &cov)
 
SampleType generateSample ()
 

Protected Attributes

CovarianceType _cholesky
 
std::mt19937 * _generator
 

Detailed Description

template<class SampleType, class CovarianceType>
class g2o::GaussianSampler< SampleType, CovarianceType >

Definition at line 48 of file sampler.h.

Constructor & Destructor Documentation

template<class SampleType, class CovarianceType>
g2o::GaussianSampler< SampleType, CovarianceType >::GaussianSampler ( bool  hasGenerator = true)
inline

Definition at line 50 of file sampler.h.

50  :
51  _generator(0)
52  {
53  if (hasGenerator){
54  _generator = new std::mt19937;
55  }
56  }
std::mt19937 * _generator
Definition: sampler.h:76
template<class SampleType, class CovarianceType>
g2o::GaussianSampler< SampleType, CovarianceType >::~GaussianSampler ( )
inline

Definition at line 57 of file sampler.h.

57  {
58  delete _generator;
59  }
std::mt19937 * _generator
Definition: sampler.h:76

Member Function Documentation

template<class SampleType, class CovarianceType>
SampleType g2o::GaussianSampler< SampleType, CovarianceType >::generateSample ( )
inline
template<class SampleType, class CovarianceType>
void g2o::GaussianSampler< SampleType, CovarianceType >::setDistribution ( const CovarianceType &  cov)
inline

Definition at line 60 of file sampler.h.

Referenced by main().

60  {
61  Eigen::LLT<CovarianceType> cholDecomp;
62  cholDecomp.compute(cov);
63  if (cholDecomp.info()==Eigen::NumericalIssue)
64  return;
65  _cholesky=cholDecomp.matrixL();
66  }
CovarianceType _cholesky
Definition: sampler.h:75

Member Data Documentation

template<class SampleType, class CovarianceType>
CovarianceType g2o::GaussianSampler< SampleType, CovarianceType >::_cholesky
protected
template<class SampleType, class CovarianceType>
std::mt19937* g2o::GaussianSampler< SampleType, CovarianceType >::_generator
protected

The documentation for this class was generated from the following file: