diff --git a/gtsam/inference/BayesTreeCliqueBase-inl.h b/gtsam/inference/BayesTreeCliqueBase-inl.h index e119cd35b..81795bf22 100644 --- a/gtsam/inference/BayesTreeCliqueBase-inl.h +++ b/gtsam/inference/BayesTreeCliqueBase-inl.h @@ -332,7 +332,7 @@ namespace gtsam { // The variables we want to keepSet are exactly the ones in S sharedConditional p_F_S = this->conditional(); - std::vector indicesS = p_F_S->parents(); + std::vector indicesS(p_F_S->beginParents(), p_F_S->endParents()); inverseReduction.applyInverse(indicesS); gttoc(Reduce);