Loading...
Searching...
No Matches
Sampler.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/linear/NoiseModel.h>
#include <random>
namespace gtsam {
class GTSAM_EXPORT Sampler {
protected:
noiseModel::Diagonal::shared_ptr model_;
mutable std::mt19937_64 generator_;
public:
typedef boost::shared_ptr<Sampler> shared_ptr;
explicit Sampler(const noiseModel::Diagonal::shared_ptr& model,
uint_fast64_t seed = 42u);
explicit Sampler(const Vector& sigmas, uint_fast64_t seed = 42u);
size_t dim() const { return model_->dim(); }
Vector sigmas() const { return model_->sigmas(); }
const noiseModel::Diagonal::shared_ptr& model() const { return model_; }
Vector sample() const;
static Vector sampleDiagonal(const Vector& sigmas, std::mt19937_64* rng);
protected:
Vector sampleDiagonal(const Vector& sigmas) const;
};
} // namespace gtsam
NoiseModel.h
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::Sampler::Sampler
Sampler(const noiseModel::Diagonal::shared_ptr &model, uint_fast64_t seed=42u)
Create a sampler for the distribution specified by a diagonal NoiseModel with a manually specified se...
Definition Sampler.cpp:23
gtsam::Sampler::model_
noiseModel::Diagonal::shared_ptr model_
noiseModel created at generation
Definition Sampler.h:34
gtsam::Sampler::generator_
std::mt19937_64 generator_
generator
Definition Sampler.h:37