Sampler.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #pragma once
20 
22 
23 #include <random>
24 
25 namespace gtsam {
26 
31 class GTSAM_EXPORT Sampler {
32  protected:
35 
37  mutable std::mt19937_64 generator_;
38 
39  public:
40  typedef boost::shared_ptr<Sampler> shared_ptr;
41 
44 
52  uint_fast64_t seed = 42u);
53 
60  explicit Sampler(const Vector& sigmas, uint_fast64_t seed = 42u);
61 
65 
66  size_t dim() const {
67  assert(model_.get());
68  return model_->dim();
69  }
70 
71  Vector sigmas() const {
72  assert(model_.get());
73  return model_->sigmas();
74  }
75 
76  const noiseModel::Diagonal::shared_ptr& model() const { return model_; }
77 
81 
83  Vector sample() const;
84 
86 
87  protected:
89  Vector sampleDiagonal(const Vector& sigmas) const;
90 };
91 
92 } // namespace gtsam
std::mt19937_64 generator_
Definition: Sampler.h:37
noiseModel::Diagonal::shared_ptr model_
Definition: Sampler.h:34
noiseModel::Diagonal::shared_ptr model
size_t dim() const
Definition: Sampler.h:66
Eigen::VectorXd Vector
Definition: Vector.h:38
const noiseModel::Diagonal::shared_ptr & model() const
Definition: Sampler.h:76
boost::shared_ptr< Diagonal > shared_ptr
Definition: NoiseModel.h:301
Vector sigmas() const
Definition: Sampler.h:71
traits
Definition: chartTesting.h:28
boost::shared_ptr< Sampler > shared_ptr
Definition: Sampler.h:40
uint64_t uint_fast64_t
Definition: ms_stdint.h:116


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:43:53