diff --git a/gtsam/hybrid/HybridBayesNet.h b/gtsam/hybrid/HybridBayesNet.h index fba6bb6aa..94a0762de 100644 --- a/gtsam/hybrid/HybridBayesNet.h +++ b/gtsam/hybrid/HybridBayesNet.h @@ -128,7 +128,7 @@ class GTSAM_EXPORT HybridBayesNet : public BayesNet { * value assignment. Note this corresponds to the Gaussian posterior p(X|M=m) * of the continuous variables given the discrete assignment M=m. * - * @note Any pure discrete factors are ignored. + * @note Be careful, as any factors not Gaussian are ignored. * * @param assignment The discrete value assignment for the discrete keys. * @return Gaussian posterior as a GaussianBayesNet diff --git a/gtsam/hybrid/HybridGaussianFactorGraph.cpp b/gtsam/hybrid/HybridGaussianFactorGraph.cpp index 0e5a34359..0c4e9c489 100644 --- a/gtsam/hybrid/HybridGaussianFactorGraph.cpp +++ b/gtsam/hybrid/HybridGaussianFactorGraph.cpp @@ -542,7 +542,7 @@ AlgebraicDecisionTree HybridGaussianFactorGraph::discretePosterior( } /* ************************************************************************ */ -GaussianFactorGraph HybridGaussianFactorGraph::operator()( +GaussianFactorGraph HybridGaussianFactorGraph::choose( const DiscreteValues &assignment) const { GaussianFactorGraph gfg; for (auto &&f : *this) { diff --git a/gtsam/hybrid/HybridGaussianFactorGraph.h b/gtsam/hybrid/HybridGaussianFactorGraph.h index 3ef6218be..a5130ca08 100644 --- a/gtsam/hybrid/HybridGaussianFactorGraph.h +++ b/gtsam/hybrid/HybridGaussianFactorGraph.h @@ -230,8 +230,23 @@ class GTSAM_EXPORT HybridGaussianFactorGraph eliminate(const Ordering& keys) const; /// @} - /// Get the GaussianFactorGraph at a given discrete assignment. - GaussianFactorGraph operator()(const DiscreteValues& assignment) const; + /** + @brief Get the GaussianFactorGraph at a given discrete assignment. Note this + * corresponds to the Gaussian posterior p(X|M=m, Z=z) of the continuous + * variables X given the discrete assignment M=m and whatever measurements z + * where assumed in the creation of the factor Graph. + * + * @note Be careful, as any factors not Gaussian are ignored. + * + * @param assignment The discrete value assignment for the discrete keys. + * @return Gaussian factors as a GaussianFactorGraph + */ + GaussianFactorGraph choose(const DiscreteValues& assignment) const; + + /// Syntactic sugar for choose + GaussianFactorGraph operator()(const DiscreteValues& assignment) const { + return choose(assignment); + } }; // traits