From 20d6d09e06e705d8384d685226239c109748e7a2 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Sat, 7 Dec 2024 19:12:06 -0500 Subject: [PATCH] use DiscreteFactor everywhere in DiscreteFactorGraph.cpp --- gtsam/discrete/DiscreteFactorGraph.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gtsam/discrete/DiscreteFactorGraph.cpp b/gtsam/discrete/DiscreteFactorGraph.cpp index 904108afb..a4f92e267 100644 --- a/gtsam/discrete/DiscreteFactorGraph.cpp +++ b/gtsam/discrete/DiscreteFactorGraph.cpp @@ -55,7 +55,7 @@ namespace gtsam { DiscreteKeys DiscreteFactorGraph::discreteKeys() const { DiscreteKeys result; for (auto&& factor : *this) { - if (auto p = std::dynamic_pointer_cast(factor)) { + if (auto p = std::dynamic_pointer_cast(factor)) { DiscreteKeys factor_keys = p->discreteKeys(); result.insert(result.end(), factor_keys.begin(), factor_keys.end()); } @@ -157,7 +157,7 @@ namespace gtsam { // max out frontals, this is the factor on the separator gttic(max); - DecisionTreeFactor::shared_ptr max = product->max(frontalKeys); + DiscreteFactor::shared_ptr max = product->max(frontalKeys); gttoc(max); // Ordering keys for the conditional so that frontalKeys are really in front @@ -244,7 +244,7 @@ namespace gtsam { // sum out frontals, this is the factor on the separator gttic_(sum); - DecisionTreeFactor::shared_ptr sum = product->sum(frontalKeys); + DiscreteFactor::shared_ptr sum = product->sum(frontalKeys); gttoc_(sum); // Ordering keys for the conditional so that frontalKeys are really in front @@ -257,8 +257,8 @@ namespace gtsam { // now divide product/sum to get conditional gttic_(divide); auto conditional = - std::make_shared(product, *sum, orderedKeys); - gttoc_(divide); + std::make_shared(product, sum, orderedKeys); + gttoc(divide); return {conditional, sum}; }