diff --git a/gtsam/discrete/DiscreteFactorGraph.cpp b/gtsam/discrete/DiscreteFactorGraph.cpp index 04849985f0..e31f94eae3 100644 --- a/gtsam/discrete/DiscreteFactorGraph.cpp +++ b/gtsam/discrete/DiscreteFactorGraph.cpp @@ -67,7 +67,7 @@ namespace gtsam { DecisionTreeFactor DiscreteFactorGraph::product() const { DecisionTreeFactor result; for (const sharedFactor& factor : *this) { - if (factor) result = result * (*factor); + if (factor) result = (*factor) * result; } return result; } @@ -254,7 +254,7 @@ namespace gtsam { // now divide product/sum to get conditional gttic_(divide); auto conditional = - std::make_shared(product, sum, orderedKeys); + std::make_shared(product, *sum, orderedKeys); gttoc_(divide); return {conditional, sum}; diff --git a/gtsam_unstable/discrete/SingleValue.cpp b/gtsam_unstable/discrete/SingleValue.cpp index 6b78f38f54..9762aec0f0 100644 --- a/gtsam_unstable/discrete/SingleValue.cpp +++ b/gtsam_unstable/discrete/SingleValue.cpp @@ -22,7 +22,7 @@ void SingleValue::print(const string& s, const KeyFormatter& formatter) const { } /* ************************************************************************* */ -double SingleValue::operator()(const DiscreteValues& values) const { +double SingleValue::operator()(const Assignment& values) const { return (double)(values.at(keys_[0]) == value_); }