Public Types | Protected Member Functions | Protected Attributes | List of all members
gtsam::Sampler Class Reference

#include <Sampler.h>

Public Types

typedef std::shared_ptr< Samplershared_ptr
 

Public Member Functions

constructors
 Sampler (const noiseModel::Diagonal::shared_ptr &model, uint_fast64_t seed=42u)
 
 Sampler (const Vector &sigmas, uint_fast64_t seed=42u)
 
access functions
size_t dim () const
 
Vector sigmas () const
 
const noiseModel::Diagonal::shared_ptrmodel () const
 

Protected Member Functions

Vector sampleDiagonal (const Vector &sigmas) const
 

Protected Attributes

std::mt19937_64 generator_
 
noiseModel::Diagonal::shared_ptr model_
 

basic functionality

Vector sample () const
 sample from distribution More...
 
static Vector sampleDiagonal (const Vector &sigmas, std::mt19937_64 *rng)
 sample with given random number generator More...
 

Detailed Description

Sampling structure that keeps internal random number generators for diagonal distributions specified by NoiseModel

Definition at line 31 of file Sampler.h.

Member Typedef Documentation

◆ shared_ptr

typedef std::shared_ptr<Sampler> gtsam::Sampler::shared_ptr

Definition at line 40 of file Sampler.h.

Constructor & Destructor Documentation

◆ Sampler() [1/2]

gtsam::Sampler::Sampler ( const noiseModel::Diagonal::shared_ptr model,
uint_fast64_t  seed = 42u 
)
explicit

Create a sampler for the distribution specified by a diagonal NoiseModel with a manually specified seed

NOTE: do not use zero as a seed, it will break the generator

Definition at line 23 of file Sampler.cpp.

◆ Sampler() [2/2]

gtsam::Sampler::Sampler ( const Vector sigmas,
uint_fast64_t  seed = 42u 
)
explicit

Create a sampler for a distribution specified by a vector of sigmas directly

NOTE: do not use zero as a seed, it will break the generator

Definition at line 32 of file Sampler.cpp.

Member Function Documentation

◆ dim()

size_t gtsam::Sampler::dim ( ) const
inline

Definition at line 66 of file Sampler.h.

◆ model()

const noiseModel::Diagonal::shared_ptr& gtsam::Sampler::model ( ) const
inline

Definition at line 70 of file Sampler.h.

◆ sample()

Vector gtsam::Sampler::sample ( ) const

sample from distribution

Definition at line 59 of file Sampler.cpp.

◆ sampleDiagonal() [1/2]

Vector gtsam::Sampler::sampleDiagonal ( const Vector sigmas,
std::mt19937_64 *  rng 
)
static

sample with given random number generator

Definition at line 36 of file Sampler.cpp.

◆ sampleDiagonal() [2/2]

Vector gtsam::Sampler::sampleDiagonal ( const Vector sigmas) const
protected

given sigmas for a diagonal model, returns a sample

Definition at line 54 of file Sampler.cpp.

◆ sigmas()

Vector gtsam::Sampler::sigmas ( ) const
inline

Definition at line 68 of file Sampler.h.

Member Data Documentation

◆ generator_

std::mt19937_64 gtsam::Sampler::generator_
mutableprotected

generator

Definition at line 37 of file Sampler.h.

◆ model_

noiseModel::Diagonal::shared_ptr gtsam::Sampler::model_
protected

noiseModel created at generation

Definition at line 34 of file Sampler.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:47:08