From 214bf4ec1a2ce6329d930b03b8f8f279c6f71de9 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Sun, 8 Dec 2024 17:15:40 -0500 Subject: [PATCH] more fixes --- gtsam/discrete/DiscreteFactorGraph.cpp | 4 ++-- gtsam_unstable/discrete/SingleValue.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtsam/discrete/DiscreteFactorGraph.cpp b/gtsam/discrete/DiscreteFactorGraph.cpp index 04849985f..e31f94eae 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 6b78f38f5..9762aec0f 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_); }