From 6734cd332ff540d8cfb92a044fe9985decf56aee Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Tue, 29 Oct 2024 14:45:43 -0400 Subject: [PATCH] formatting --- gtsam/hybrid/tests/Switching.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gtsam/hybrid/tests/Switching.h b/gtsam/hybrid/tests/Switching.h index fdf9092b6..270792701 100644 --- a/gtsam/hybrid/tests/Switching.h +++ b/gtsam/hybrid/tests/Switching.h @@ -52,7 +52,8 @@ using symbol_shorthand::X; * @return HybridGaussianFactorGraph::shared_ptr */ inline HybridGaussianFactorGraph::shared_ptr makeSwitchingChain( - size_t K, std::function x = X, std::function m = M) { + size_t K, std::function x = X, std::function m = M, + const std::string &transitionProbabilityTable = "0 1 1 3") { HybridGaussianFactorGraph hfg; hfg.add(JacobianFactor(x(1), I_3x3, Z_3x1)); @@ -68,7 +69,8 @@ inline HybridGaussianFactorGraph::shared_ptr makeSwitchingChain( hfg.add(HybridGaussianFactor({m(k), 2}, components)); if (k > 1) { - hfg.add(DecisionTreeFactor({{m(k - 1), 2}, {m(k), 2}}, "0 1 1 3")); + hfg.add(DecisionTreeFactor({{m(k - 1), 2}, {m(k), 2}}, + transitionProbabilityTable)); } } @@ -171,8 +173,8 @@ struct Switching { // Add "motion models" ϕ(X(k),X(k+1),M(k)). for (size_t k = 0; k < K - 1; k++) { auto motion_models = motionModels(k, between_sigma); - nonlinearFactorGraph_.emplace_shared(modes[k], - motion_models); + nonlinearFactorGraph_.emplace_shared( + modes[k], motion_models); binaryFactors.push_back(nonlinearFactorGraph_.back()); } @@ -193,7 +195,8 @@ struct Switching { linearizationPoint.insert(X(k), static_cast(k + 1)); } - linearizedFactorGraph = *nonlinearFactorGraph_.linearize(linearizationPoint); + linearizedFactorGraph = + *nonlinearFactorGraph_.linearize(linearizationPoint); } // Create motion models for a given time step