From 517fe3963e4098c3b654e21ea0519af50b871c32 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Tue, 4 Jan 2022 10:40:56 -0500 Subject: [PATCH] Fix compile issues on Ubuntu/windows --- gtsam/discrete/DecisionTree-inl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gtsam/discrete/DecisionTree-inl.h b/gtsam/discrete/DecisionTree-inl.h index a0df966a0..633cc1670 100644 --- a/gtsam/discrete/DecisionTree-inl.h +++ b/gtsam/discrete/DecisionTree-inl.h @@ -580,7 +580,7 @@ namespace gtsam { size_t split = size / nrChoices; for (size_t i = 0; i < nrChoices; i++, beginY += split) { NodePtr f = create(labelC, end, beginY, beginY + split); - functions += DecisionTree(f); + functions.emplace_back(f); } return compose(functions.begin(), functions.end(), begin->first); } @@ -613,8 +613,7 @@ namespace gtsam { // put together via Shannon expansion otherwise not sorted. std::vector functions; for(auto && branch: choice->branches()) { - LY converted(convertFrom(branch, L_of_M, Y_of_X)); - functions += converted; + functions.emplace_back(convertFrom(branch, L_of_M, Y_of_X)); } return LY::compose(functions.begin(), functions.end(), newLabel); }