diff --git a/gtsam/discrete/DiscreteFactor.h b/gtsam/discrete/DiscreteFactor.h index e2be94b94..edcfcb8a4 100644 --- a/gtsam/discrete/DiscreteFactor.h +++ b/gtsam/discrete/DiscreteFactor.h @@ -83,6 +83,9 @@ public: /// Find value for given assignment of values to variables virtual double operator()(const DiscreteValues&) const = 0; + /// Synonym for operator(), mostly for wrapper + double value(const DiscreteValues& values) const { return operator()(values); } + /// Multiply in a DecisionTreeFactor and return the result as DecisionTreeFactor virtual DecisionTreeFactor operator*(const DecisionTreeFactor&) const = 0; diff --git a/gtsam/discrete/DiscreteFactorGraph.h b/gtsam/discrete/DiscreteFactorGraph.h index a8ba7ab03..06c52dd7b 100644 --- a/gtsam/discrete/DiscreteFactorGraph.h +++ b/gtsam/discrete/DiscreteFactorGraph.h @@ -130,8 +130,14 @@ public: /** return product of all factors as a single factor */ DecisionTreeFactor product() const; - /** Evaluates the factor graph given values, returns the joint probability of the factor graph given specific instantiation of values*/ - double operator()(const DiscreteValues & values) const; + /** + * Evaluates the factor graph given values, returns the joint probability of + * the factor graph given specific instantiation of values + */ + double operator()(const DiscreteValues& values) const; + + /// Synonym for operator(), mostly for wrapper + double value(const DiscreteValues& values) const { return operator()(values); } /// print void print(