Added value, for wrapper

release/4.3a0
Frank Dellaert 2021-12-13 19:38:07 -05:00
parent 44b4f21ad8
commit e22f3893c6
2 changed files with 11 additions and 2 deletions

View File

@ -83,6 +83,9 @@ public:
/// Find value for given assignment of values to variables /// Find value for given assignment of values to variables
virtual double operator()(const DiscreteValues&) const = 0; 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 /// Multiply in a DecisionTreeFactor and return the result as DecisionTreeFactor
virtual DecisionTreeFactor operator*(const DecisionTreeFactor&) const = 0; virtual DecisionTreeFactor operator*(const DecisionTreeFactor&) const = 0;

View File

@ -130,8 +130,14 @@ public:
/** return product of all factors as a single factor */ /** return product of all factors as a single factor */
DecisionTreeFactor product() const; 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 /// print
void print( void print(