use default RNG object for mt19937_64 everywhere
parent
bc7646f82f
commit
995bedb4ca
|
@ -26,9 +26,6 @@
|
|||
using namespace std;
|
||||
using namespace gtsam;
|
||||
|
||||
// In Wrappers we have no access to this so have a default ready
|
||||
static std::mt19937_64 kRandomNumberGenerator(42);
|
||||
|
||||
namespace gtsam {
|
||||
|
||||
// Instantiate base class
|
||||
|
@ -76,15 +73,6 @@ namespace gtsam {
|
|||
return result;
|
||||
}
|
||||
|
||||
/* ************************************************************************ */
|
||||
VectorValues GaussianBayesNet::sample() const {
|
||||
return sample(&kRandomNumberGenerator);
|
||||
}
|
||||
|
||||
VectorValues GaussianBayesNet::sample(const VectorValues& given) const {
|
||||
return sample(given, &kRandomNumberGenerator);
|
||||
}
|
||||
|
||||
/* ************************************************************************ */
|
||||
VectorValues GaussianBayesNet::optimizeGradientSearch() const
|
||||
{
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace gtsam {
|
|||
* std::mt19937_64 rng(42);
|
||||
* auto sample = gbn.sample(&rng);
|
||||
*/
|
||||
VectorValues sample(std::mt19937_64* rng) const;
|
||||
VectorValues sample(std::mt19937_64* rng = nullptr) const;
|
||||
|
||||
/**
|
||||
* Sample from an incomplete BayesNet, given missing variables
|
||||
|
@ -140,13 +140,7 @@ namespace gtsam {
|
|||
* VectorValues given = ...;
|
||||
* auto sample = gbn.sample(given, &rng);
|
||||
*/
|
||||
VectorValues sample(const VectorValues& given, std::mt19937_64* rng) const;
|
||||
|
||||
/// Sample using ancestral sampling, use default rng
|
||||
VectorValues sample() const;
|
||||
|
||||
/// Sample from an incomplete BayesNet, use default rng
|
||||
VectorValues sample(const VectorValues& given) const;
|
||||
VectorValues sample(const VectorValues& given, std::mt19937_64* rng = nullptr) const;
|
||||
|
||||
/**
|
||||
* Return ordering corresponding to a topological sort.
|
||||
|
|
|
@ -560,8 +560,9 @@ virtual class GaussianConditional : gtsam::JacobianFactor {
|
|||
const gtsam::VectorValues& frontalValues) const;
|
||||
gtsam::JacobianFactor* likelihood(gtsam::Vector frontal) const;
|
||||
|
||||
gtsam::VectorValues sample(std::mt19937_64@ rng = nullptr) const;
|
||||
gtsam::VectorValues sample(const gtsam::VectorValues& parents, std::mt19937_64@ rng = nullptr) const;
|
||||
gtsam::VectorValues sample(std::mt19937_64 @rng = nullptr) const;
|
||||
gtsam::VectorValues sample(const gtsam::VectorValues& parents,
|
||||
std::mt19937_64 @rng = nullptr) const;
|
||||
|
||||
// Advanced Interface
|
||||
gtsam::VectorValues solveOtherRHS(const gtsam::VectorValues& parents,
|
||||
|
@ -627,9 +628,10 @@ virtual class GaussianBayesNet {
|
|||
gtsam::VectorValues optimize() const;
|
||||
gtsam::VectorValues optimize(const gtsam::VectorValues& given) const;
|
||||
gtsam::VectorValues optimizeGradientSearch() const;
|
||||
|
||||
gtsam::VectorValues sample(const gtsam::VectorValues& given) const;
|
||||
gtsam::VectorValues sample() const;
|
||||
|
||||
gtsam::VectorValues sample(const gtsam::VectorValues& given,
|
||||
std::mt19937_64 @rng = nullptr) const;
|
||||
gtsam::VectorValues sample(std::mt19937_64 @rng = nullptr) const;
|
||||
gtsam::VectorValues backSubstitute(const gtsam::VectorValues& gx) const;
|
||||
gtsam::VectorValues backSubstituteTranspose(const gtsam::VectorValues& gx) const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue