From 8cb95d5b5a7aad89fbad616cefb69d7f90b7a1e6 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Mon, 16 Sep 2024 13:31:03 -0400 Subject: [PATCH] remove redundancy from HybridConditional constructors --- gtsam/hybrid/HybridConditional.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/gtsam/hybrid/HybridConditional.cpp b/gtsam/hybrid/HybridConditional.cpp index 8a8511aef9..ed8125c2b7 100644 --- a/gtsam/hybrid/HybridConditional.cpp +++ b/gtsam/hybrid/HybridConditional.cpp @@ -28,14 +28,9 @@ HybridConditional::HybridConditional(const KeyVector &continuousFrontals, const DiscreteKeys &discreteFrontals, const KeyVector &continuousParents, const DiscreteKeys &discreteParents) - : HybridConditional( - CollectKeys( - {continuousFrontals.begin(), continuousFrontals.end()}, - KeyVector{continuousParents.begin(), continuousParents.end()}), - CollectDiscreteKeys( - {discreteFrontals.begin(), discreteFrontals.end()}, - {discreteParents.begin(), discreteParents.end()}), - continuousFrontals.size() + discreteFrontals.size()) {} + : HybridConditional(CollectKeys(continuousFrontals, continuousParents), + CollectDiscreteKeys(discreteFrontals, discreteParents), + continuousFrontals.size() + discreteFrontals.size()) {} /* ************************************************************************ */ HybridConditional::HybridConditional( @@ -56,9 +51,7 @@ HybridConditional::HybridConditional( /* ************************************************************************ */ HybridConditional::HybridConditional( const std::shared_ptr &gaussianMixture) - : BaseFactor(KeyVector(gaussianMixture->keys().begin(), - gaussianMixture->keys().begin() + - gaussianMixture->nrContinuous()), + : BaseFactor(gaussianMixture->continuousKeys(), gaussianMixture->discreteKeys()), BaseConditional(gaussianMixture->nrFrontals()) { inner_ = gaussianMixture;