diff --git a/src/ConfigFile.cc b/src/ConfigFile.cc index 198aa958..e6b0abbf 100644 --- a/src/ConfigFile.cc +++ b/src/ConfigFile.cc @@ -499,10 +499,10 @@ ConfigFile::addParallelConfFileElement(bool inNode, bool inCluster, const member exit(EXIT_FAILURE); } else - follower_nodes.emplace(name, FollowerNode{computerName, port, minCpuNbr, maxCpuNbr, userName, - password, remoteDrive, remoteDirectory, programPath, programConfig, - matlabOctavePath, singleCompThread, numberOfThreadsPerJob, - operatingSystem}); + follower_nodes.try_emplace(name, computerName, port, minCpuNbr, maxCpuNbr, userName, + password, remoteDrive, remoteDirectory, programPath, programConfig, + matlabOctavePath, singleCompThread, numberOfThreadsPerJob, + operatingSystem); //! ADD CLUSTER else if (inCluster) if (minCpuNbr > 0 || maxCpuNbr > 0 || !userName.empty() @@ -523,7 +523,7 @@ ConfigFile::addParallelConfFileElement(bool inNode, bool inCluster, const member { if (clusters.empty()) firstClusterName = name; - clusters.emplace(name, Cluster{member_nodes}); + clusters.emplace(name, member_nodes); } } diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index ba1cebb9..32ff9f2c 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -2363,7 +2363,7 @@ DynamicModel::computeChainRuleJacobian() assert(lag >= -1 && lag <= 1); if (eq >= nb_recursives && var >= nb_recursives && !(one_boundary && lag != 0)) - blocks_jacobian_sparse_column_major_order[blk].emplace(pair{eq-nb_recursives, var-nb_recursives+static_cast(!one_boundary)*(lag+1)*mfs_size}, d1); + blocks_jacobian_sparse_column_major_order[blk].try_emplace({eq-nb_recursives, var-nb_recursives+static_cast(!one_boundary)*(lag+1)*mfs_size}, d1); } blocks_jacobian_sparse_colptr[blk] = computeCSCColPtr(blocks_jacobian_sparse_column_major_order[blk], (one_boundary ? 1 : 3)*mfs_size); } diff --git a/src/ModelTree.cc b/src/ModelTree.cc index 02147440..f9330c07 100644 --- a/src/ModelTree.cc +++ b/src/ModelTree.cc @@ -146,7 +146,7 @@ ModelTree::ModelTree(SymbolTable &symbol_table_arg, { // Ensure that elements accessed by writeParamsDerivativesFileHelper() exist for (const auto &ord : {pair{0, 1}, pair{1, 1}, pair{0, 2}, pair{1, 2}, pair{2, 1}, pair{3, 1}}) - params_derivatives.emplace(ord, decltype(params_derivatives)::mapped_type{}); + params_derivatives.try_emplace(ord); } ModelTree::ModelTree(const ModelTree &m) : @@ -880,7 +880,7 @@ ModelTree::computeDerivatives(int order, const set &vars) // Compute the sparse representation of the Jacobian for (const auto &[indices, d1] : derivatives[1]) - jacobian_sparse_column_major_order.emplace(pair{indices[0], getJacobianCol(indices[1], true)}, d1); + jacobian_sparse_column_major_order.try_emplace({indices[0], getJacobianCol(indices[1], true)}, d1); jacobian_sparse_colptr = computeCSCColPtr(jacobian_sparse_column_major_order, getJacobianColsNbr(true)); // Higher-order derivatives diff --git a/src/StaticModel.cc b/src/StaticModel.cc index a6d87a9f..44b32806 100644 --- a/src/StaticModel.cc +++ b/src/StaticModel.cc @@ -689,7 +689,7 @@ StaticModel::computeChainRuleJacobian() auto &[eq, var, lag] { indices }; assert(lag == 0); if (eq >= nb_recursives && var >= nb_recursives) - blocks_jacobian_sparse_column_major_order[blk].emplace(pair{eq-nb_recursives, var-nb_recursives}, d1); + blocks_jacobian_sparse_column_major_order[blk].try_emplace({eq-nb_recursives, var-nb_recursives}, d1); } blocks_jacobian_sparse_colptr[blk] = computeCSCColPtr(blocks_jacobian_sparse_column_major_order[blk], blocks[blk].mfs_size); }