From cc267561962d18d509981266e2f22d8d0b141db0 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sun, 5 Feb 2023 10:50:54 -0800 Subject: [PATCH] No emplace in case of tbb --- gtsam/inference/ClusterTree-inst.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtsam/inference/ClusterTree-inst.h b/gtsam/inference/ClusterTree-inst.h index 8b72370fc..fe5c53e36 100644 --- a/gtsam/inference/ClusterTree-inst.h +++ b/gtsam/inference/ClusterTree-inst.h @@ -209,9 +209,13 @@ struct EliminationData { // Fill nodes index - we do this here instead of calling insertRoot at the end to avoid // putting orphan subtrees in the index - they'll already be in the index of the ISAM2 // object they're added to. - for (const Key& j: myData.bayesTreeNode->conditional()->frontals()) + for (const Key& j : myData.bayesTreeNode->conditional()->frontals()) { +#ifdef GTSAM_USE_TBB + nodesIndex_.insert({j, myData.bayesTreeNode}); +#else nodesIndex_.emplace(j, myData.bayesTreeNode); - +#endif + } // Store remaining factor in parent's gathered factors if (!eliminationResult.second->empty()) { #ifdef GTSAM_USE_TBB