max returns DiscreteFactor
parent
2410d4f442
commit
5e4cf89ba9
|
@ -479,10 +479,9 @@ double DiscreteConditional::evaluate(const HybridValues& x) const {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
DiscreteConditional::shared_ptr DiscreteConditional::max(
|
||||
DiscreteFactor::shared_ptr DiscreteConditional::max(
|
||||
const Ordering& keys) const {
|
||||
auto m = *BaseFactor::max(keys);
|
||||
return std::make_shared<DiscreteConditional>(m.discreteKeys().size(), m);
|
||||
return BaseFactor::max(keys);
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
@ -215,13 +215,13 @@ class GTSAM_EXPORT DiscreteConditional
|
|||
size_t argmax(const DiscreteValues& parentsValues = DiscreteValues()) const;
|
||||
|
||||
/**
|
||||
* @brief Create new conditional by maximizing over all
|
||||
* @brief Create new factor by maximizing over all
|
||||
* values with the same separator.
|
||||
*
|
||||
* @param keys The keys to sum over.
|
||||
* @return DiscreteConditional::shared_ptr
|
||||
* @return DiscreteFactor::shared_ptr
|
||||
*/
|
||||
virtual DiscreteConditional::shared_ptr max(const Ordering& keys) const;
|
||||
virtual DiscreteFactor::shared_ptr max(const Ordering& keys) const;
|
||||
|
||||
/// @}
|
||||
/// @name Advanced Interface
|
||||
|
|
|
@ -114,11 +114,8 @@ bool TableDistribution::equals(const DiscreteFactor& other, double tol) const {
|
|||
}
|
||||
|
||||
/* ****************************************************************************/
|
||||
DiscreteConditional::shared_ptr TableDistribution::max(
|
||||
const Ordering& keys) const {
|
||||
auto m = *table_.max(keys);
|
||||
|
||||
return std::make_shared<TableDistribution>(m);
|
||||
DiscreteFactor::shared_ptr TableDistribution::max(const Ordering& keys) const {
|
||||
return table_.max(keys);
|
||||
}
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
|
|
@ -132,14 +132,13 @@ class GTSAM_EXPORT TableDistribution : public DiscreteConditional {
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief Create new conditional by maximizing over all
|
||||
* @brief Create new factor by maximizing over all
|
||||
* values with the same separator.
|
||||
*
|
||||
* @param keys The keys to sum over.
|
||||
* @return DiscreteConditional::shared_ptr
|
||||
* @return DiscreteFactor::shared_ptr
|
||||
*/
|
||||
virtual DiscreteConditional::shared_ptr max(
|
||||
const Ordering& keys) const override;
|
||||
virtual DiscreteFactor::shared_ptr max(const Ordering& keys) const override;
|
||||
|
||||
/**
|
||||
* @brief Return assignment that maximizes value.
|
||||
|
|
Loading…
Reference in New Issue