return DiscreteFactor shared_ptr as leftover from elimination

release/4.3a0
Varun Agrawal 2024-12-07 11:07:26 -05:00
parent a68da21527
commit a09b77ef40
2 changed files with 6 additions and 5 deletions

View File

@ -112,7 +112,7 @@ namespace gtsam {
/* ************************************************************************ */ /* ************************************************************************ */
// Alternate eliminate function for MPE // Alternate eliminate function for MPE
std::pair<DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr> // std::pair<DiscreteConditional::shared_ptr, DiscreteFactor::shared_ptr>
EliminateForMPE(const DiscreteFactorGraph& factors, EliminateForMPE(const DiscreteFactorGraph& factors,
const Ordering& frontalKeys) { const Ordering& frontalKeys) {
// PRODUCT: multiply all factors // PRODUCT: multiply all factors
@ -201,7 +201,7 @@ namespace gtsam {
} }
/* ************************************************************************ */ /* ************************************************************************ */
std::pair<DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr> // std::pair<DiscreteConditional::shared_ptr, DiscreteFactor::shared_ptr>
EliminateDiscrete(const DiscreteFactorGraph& factors, EliminateDiscrete(const DiscreteFactorGraph& factors,
const Ordering& frontalKeys) { const Ordering& frontalKeys) {
// PRODUCT: multiply all factors // PRODUCT: multiply all factors

View File

@ -48,7 +48,7 @@ class DiscreteJunctionTree;
* @ingroup discrete * @ingroup discrete
*/ */
GTSAM_EXPORT GTSAM_EXPORT
std::pair<DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr> std::pair<DiscreteConditional::shared_ptr, DiscreteFactor::shared_ptr>
EliminateDiscrete(const DiscreteFactorGraph& factors, EliminateDiscrete(const DiscreteFactorGraph& factors,
const Ordering& frontalKeys); const Ordering& frontalKeys);
@ -61,7 +61,7 @@ EliminateDiscrete(const DiscreteFactorGraph& factors,
* @ingroup discrete * @ingroup discrete
*/ */
GTSAM_EXPORT GTSAM_EXPORT
std::pair<DiscreteConditional::shared_ptr, DecisionTreeFactor::shared_ptr> std::pair<DiscreteConditional::shared_ptr, DiscreteFactor::shared_ptr>
EliminateForMPE(const DiscreteFactorGraph& factors, EliminateForMPE(const DiscreteFactorGraph& factors,
const Ordering& frontalKeys); const Ordering& frontalKeys);
@ -133,6 +133,7 @@ class GTSAM_EXPORT DiscreteFactorGraph
/// @} /// @}
//TODO(Varun): Make compatible with TableFactor
/** Add a decision-tree factor */ /** Add a decision-tree factor */
template <typename... Args> template <typename... Args>
void add(Args&&... args) { void add(Args&&... args) {
@ -146,7 +147,7 @@ class GTSAM_EXPORT DiscreteFactorGraph
DiscreteKeys discreteKeys() const; DiscreteKeys discreteKeys() const;
/** return product of all factors as a single factor */ /** return product of all factors as a single factor */
DecisionTreeFactor product() const; DiscreteFactor::shared_ptr product() const;
/** /**
* Evaluates the factor graph given values, returns the joint probability of * Evaluates the factor graph given values, returns the joint probability of