override operator/ in TableDistribution

release/4.3a0
Varun Agrawal 2025-01-06 23:13:06 -05:00
parent 96a136b4e3
commit 3fb6f39b30
2 changed files with 10 additions and 0 deletions

View File

@ -111,6 +111,12 @@ DiscreteFactor::shared_ptr TableDistribution::max(const Ordering& keys) const {
return table_.max(keys);
}
/* ****************************************************************************/
DiscreteFactor::shared_ptr TableDistribution::operator/(
const DiscreteFactor::shared_ptr& f) const {
return table_ / f;
}
/* ************************************************************************ */
DiscreteValues TableDistribution::argmax() const {
uint64_t maxIdx = 0;

View File

@ -123,6 +123,10 @@ class GTSAM_EXPORT TableDistribution : public DiscreteConditional {
/// Create new factor by maximizing over all values with the same separator.
DiscreteFactor::shared_ptr max(const Ordering& keys) const override;
/// divide by DiscreteFactor::shared_ptr f (safely)
DiscreteFactor::shared_ptr operator/(
const DiscreteFactor::shared_ptr& f) const override;
/**
* @brief Return assignment that maximizes value.
*