Add no-argument solve and sample to DiscretePrior
parent
075a7cd0fd
commit
1d12995be5
|
@ -81,9 +81,25 @@ class GTSAM_EXPORT DiscretePrior : public DiscreteConditional {
|
|||
/// Evaluate given a single value.
|
||||
double operator()(size_t value) const;
|
||||
|
||||
/// Evaluate given a single value.
|
||||
/// We also want to keep the Base version, taking DiscreteValues:
|
||||
// TODO(dellaert): does not play well with wrapper!
|
||||
// using Base::operator();
|
||||
|
||||
/// Return entire probability mass function.
|
||||
std::vector<double> pmf() const;
|
||||
|
||||
/**
|
||||
* solve a conditional
|
||||
* @return MPE value of the child (1 frontal variable).
|
||||
*/
|
||||
size_t solve() const { return Base::solve({}); }
|
||||
|
||||
/**
|
||||
* sample
|
||||
* @return sample from conditional
|
||||
*/
|
||||
size_t sample() const { return Base::sample({}); }
|
||||
|
||||
/// @}
|
||||
};
|
||||
// DiscretePrior
|
||||
|
|
|
@ -81,6 +81,8 @@ virtual class DiscretePrior : gtsam::DiscreteConditional {
|
|||
gtsam::DefaultKeyFormatter) const;
|
||||
double operator()(size_t value) const;
|
||||
std::vector<double> pmf() const;
|
||||
size_t solve() const;
|
||||
size_t sample() const;
|
||||
};
|
||||
|
||||
#include <gtsam/discrete/DiscreteBayesNet.h>
|
||||
|
|
Loading…
Reference in New Issue