From a19fb28fab2fabc0a47f1fe49d97e2ed42cd4754 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Thu, 17 Oct 2024 02:06:10 +0900 Subject: [PATCH] Const correctness --- gtsam/discrete/DecisionTree-inl.h | 2 +- gtsam/discrete/DecisionTree.h | 2 +- gtsam/hybrid/HybridGaussianFactorGraph.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtsam/discrete/DecisionTree-inl.h b/gtsam/discrete/DecisionTree-inl.h index 434a6beac..1f50014d6 100644 --- a/gtsam/discrete/DecisionTree-inl.h +++ b/gtsam/discrete/DecisionTree-inl.h @@ -1060,7 +1060,7 @@ namespace gtsam { template template std::pair, DecisionTree> DecisionTree::split( - std::function(const Y&)> AB_of_Y) { + std::function(const Y&)> AB_of_Y) const { using AB = std::pair; const DecisionTree ab(*this, AB_of_Y); const DecisionTree a(ab, [](const AB& p) { return p.first; }); diff --git a/gtsam/discrete/DecisionTree.h b/gtsam/discrete/DecisionTree.h index 6a966e0dd..aba5b88b7 100644 --- a/gtsam/discrete/DecisionTree.h +++ b/gtsam/discrete/DecisionTree.h @@ -416,7 +416,7 @@ namespace gtsam { */ template std::pair, DecisionTree> split( - std::function(const Y&)> AB_of_Y); + std::function(const Y&)> AB_of_Y) const; /// @name Advanced Interface /// @{ diff --git a/gtsam/hybrid/HybridGaussianFactorGraph.cpp b/gtsam/hybrid/HybridGaussianFactorGraph.cpp index 8e6123f10..361cb6e81 100644 --- a/gtsam/hybrid/HybridGaussianFactorGraph.cpp +++ b/gtsam/hybrid/HybridGaussianFactorGraph.cpp @@ -390,7 +390,7 @@ HybridGaussianFactorGraph::eliminate(const Ordering &keys) const { }; // Perform elimination! - ResultTree eliminationResults(prunedProductFactor, eliminate); + const ResultTree eliminationResults(prunedProductFactor, eliminate); // If there are no more continuous parents we create a DiscreteFactor with the // error for each discrete choice. Otherwise, create a HybridGaussianFactor