override sum and max in TableDistribution
parent
9960f2d8dc
commit
96a136b4e3
|
@ -91,6 +91,21 @@ bool TableDistribution::equals(const DiscreteFactor& other, double tol) const {
|
|||
}
|
||||
}
|
||||
|
||||
/* ****************************************************************************/
|
||||
DiscreteFactor::shared_ptr TableDistribution::sum(size_t nrFrontals) const {
|
||||
return table_.sum(nrFrontals);
|
||||
}
|
||||
|
||||
/* ****************************************************************************/
|
||||
DiscreteFactor::shared_ptr TableDistribution::sum(const Ordering& keys) const {
|
||||
return table_.sum(keys);
|
||||
}
|
||||
|
||||
/* ****************************************************************************/
|
||||
DiscreteFactor::shared_ptr TableDistribution::max(size_t nrFrontals) const {
|
||||
return table_.max(nrFrontals);
|
||||
}
|
||||
|
||||
/* ****************************************************************************/
|
||||
DiscreteFactor::shared_ptr TableDistribution::max(const Ordering& keys) const {
|
||||
return table_.max(keys);
|
||||
|
|
|
@ -111,14 +111,17 @@ class GTSAM_EXPORT TableDistribution : public DiscreteConditional {
|
|||
return table_.evaluate(values);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create new factor by maximizing over all
|
||||
* values with the same separator.
|
||||
*
|
||||
* @param keys The keys to sum over.
|
||||
* @return DiscreteFactor::shared_ptr
|
||||
*/
|
||||
virtual DiscreteFactor::shared_ptr max(const Ordering& keys) const override;
|
||||
/// Create new factor by summing all values with the same separator values
|
||||
DiscreteFactor::shared_ptr sum(size_t nrFrontals) const override;
|
||||
|
||||
/// Create new factor by summing all values with the same separator values
|
||||
DiscreteFactor::shared_ptr sum(const Ordering& keys) const override;
|
||||
|
||||
/// Create new factor by maximizing over all values with the same separator.
|
||||
DiscreteFactor::shared_ptr max(size_t nrFrontals) const override;
|
||||
|
||||
/// Create new factor by maximizing over all values with the same separator.
|
||||
DiscreteFactor::shared_ptr max(const Ordering& keys) const override;
|
||||
|
||||
/**
|
||||
* @brief Return assignment that maximizes value.
|
||||
|
|
Loading…
Reference in New Issue