Commit 608c4345 authored by Sébastien Villemot's avatar Sébastien Villemot

Replace most calls to make_pair by braced-initializer lists or emplace()/emplace_back()

parent 7d9cd718
......@@ -1730,14 +1730,14 @@ public:
# ifdef DEBUGL
mexPrintf("FLDZ = %d size = %d\n", FLDZ, sizeof(FLDZ_));
# endif
tags_liste.push_back(make_pair(FLDZ, code));
tags_liste.emplace_back(FLDZ, code);
code += sizeof(FLDZ_);
break;
case FEND:
# ifdef DEBUGL
mexPrintf("FEND\n");
# endif
tags_liste.push_back(make_pair(FEND, code));
tags_liste.emplace_back(FEND, code);
code += sizeof(FEND_);
done = true;
break;
......@@ -1745,203 +1745,203 @@ public:
# ifdef DEBUGL
mexPrintf("FENDBLOCK\n");
# endif
tags_liste.push_back(make_pair(FENDBLOCK, code));
tags_liste.emplace_back(FENDBLOCK, code);
code += sizeof(FENDBLOCK_);
break;
case FENDEQU:
# ifdef DEBUGL
mexPrintf("FENDEQU\n");
# endif
tags_liste.push_back(make_pair(FENDEQU, code));
tags_liste.emplace_back(FENDEQU, code);
code += sizeof(FENDEQU_);
break;
case FCUML:
# ifdef DEBUGL
mexPrintf("FCUML\n");
# endif
tags_liste.push_back(make_pair(FCUML, code));
tags_liste.emplace_back(FCUML, code);
code += sizeof(FCUML_);
break;
case FDIMT:
# ifdef DEBUGL
mexPrintf("FDIMT = %d size = %d\n", FDIMT, sizeof(FDIMT_));
# endif
tags_liste.push_back(make_pair(FDIMT, code));
tags_liste.emplace_back(FDIMT, code);
code += sizeof(FDIMT_);
break;
case FDIMST:
# ifdef DEBUGL
mexPrintf("FDIMST\n");
# endif
tags_liste.push_back(make_pair(FDIMST, code));
tags_liste.emplace_back(FDIMST, code);
code += sizeof(FDIMST_);
break;
case FNUMEXPR:
# ifdef DEBUGL
mexPrintf("FNUMEXPR\n");
# endif
tags_liste.push_back(make_pair(FNUMEXPR, code));
tags_liste.emplace_back(FNUMEXPR, code);
code += sizeof(FNUMEXPR_);
break;
case FLDC:
# ifdef DEBUGL
mexPrintf("FLDC\n");
# endif
tags_liste.push_back(make_pair(FLDC, code));
tags_liste.emplace_back(FLDC, code);
code += sizeof(FLDC_);
break;
case FLDU:
# ifdef DEBUGL
mexPrintf("FLDU\n");
# endif
tags_liste.push_back(make_pair(FLDU, code));
tags_liste.emplace_back(FLDU, code);
code += sizeof(FLDU_);
break;
case FLDSU:
# ifdef DEBUGL
mexPrintf("FLDSU\n");
# endif
tags_liste.push_back(make_pair(FLDSU, code));
tags_liste.emplace_back(FLDSU, code);
code += sizeof(FLDSU_);
break;
case FLDR:
# ifdef DEBUGL
mexPrintf("FLDR\n");
# endif
tags_liste.push_back(make_pair(FLDR, code));
tags_liste.emplace_back(FLDR, code);
code += sizeof(FLDR_);
break;
case FLDT:
# ifdef DEBUGL
mexPrintf("FLDT\n");
# endif
tags_liste.push_back(make_pair(FLDT, code));
tags_liste.emplace_back(FLDT, code);
code += sizeof(FLDT_);
break;
case FLDST:
# ifdef DEBUGL
mexPrintf("FLDST\n");
# endif
tags_liste.push_back(make_pair(FLDST, code));
tags_liste.emplace_back(FLDST, code);
code += sizeof(FLDST_);
break;
case FSTPT:
# ifdef DEBUGL
mexPrintf("FSTPT = %d size = %d\n", FSTPT, sizeof(FSTPT_));
# endif
tags_liste.push_back(make_pair(FSTPT, code));
tags_liste.emplace_back(FSTPT, code);
code += sizeof(FSTPT_);
break;
case FSTPST:
# ifdef DEBUGL
mexPrintf("FSTPST\n");
# endif
tags_liste.push_back(make_pair(FSTPST, code));
tags_liste.emplace_back(FSTPST, code);
code += sizeof(FSTPST_);
break;
case FSTPR:
# ifdef DEBUGL
mexPrintf("FSTPR\n");
# endif
tags_liste.push_back(make_pair(FSTPR, code));
tags_liste.emplace_back(FSTPR, code);
code += sizeof(FSTPR_);
break;
case FSTPU:
# ifdef DEBUGL
mexPrintf("FSTPU\n");
# endif
tags_liste.push_back(make_pair(FSTPU, code));
tags_liste.emplace_back(FSTPU, code);
code += sizeof(FSTPU_);
break;
case FSTPSU:
# ifdef DEBUGL
mexPrintf("FSTPSU\n");
# endif
tags_liste.push_back(make_pair(FSTPSU, code));
tags_liste.emplace_back(FSTPSU, code);
code += sizeof(FSTPSU_);
break;
case FSTPG:
# ifdef DEBUGL
mexPrintf("FSTPG\n");
# endif
tags_liste.push_back(make_pair(FSTPG, code));
tags_liste.emplace_back(FSTPG, code);
code += sizeof(FSTPG_);
break;
case FSTPG2:
# ifdef DEBUGL
mexPrintf("FSTPG2\n");
# endif
tags_liste.push_back(make_pair(FSTPG2, code));
tags_liste.emplace_back(FSTPG2, code);
code += sizeof(FSTPG2_);
break;
case FSTPG3:
# ifdef DEBUGL
mexPrintf("FSTPG3\n");
# endif
tags_liste.push_back(make_pair(FSTPG3, code));
tags_liste.emplace_back(FSTPG3, code);
code += sizeof(FSTPG3_);
break;
case FUNARY:
# ifdef DEBUGL
mexPrintf("FUNARY\n");
# endif
tags_liste.push_back(make_pair(FUNARY, code));
tags_liste.emplace_back(FUNARY, code);
code += sizeof(FUNARY_);
break;
case FBINARY:
# ifdef DEBUGL
mexPrintf("FBINARY\n");
# endif
tags_liste.push_back(make_pair(FBINARY, code));
tags_liste.emplace_back(FBINARY, code);
code += sizeof(FBINARY_);
break;
case FTRINARY:
# ifdef DEBUGL
mexPrintf("FTRINARY\n");
# endif
tags_liste.push_back(make_pair(FTRINARY, code));
tags_liste.emplace_back(FTRINARY, code);
code += sizeof(FTRINARY_);
break;
case FOK:
# ifdef DEBUGL
mexPrintf("FOK\n");
# endif
tags_liste.push_back(make_pair(FOK, code));
tags_liste.emplace_back(FOK, code);
code += sizeof(FOK_);
break;
case FLDVS:
# ifdef DEBUGL
mexPrintf("FLDVS\n");
# endif
tags_liste.push_back(make_pair(FLDVS, code));
tags_liste.emplace_back(FLDVS, code);
code += sizeof(FLDVS_);
break;
case FLDSV:
# ifdef DEBUGL
mexPrintf("FLDSV\n");
# endif
tags_liste.push_back(make_pair(FLDSV, code));
tags_liste.emplace_back(FLDSV, code);
code += sizeof(FLDSV_);
break;
case FSTPSV:
# ifdef DEBUGL
mexPrintf("FSTPSV\n");
# endif
tags_liste.push_back(make_pair(FSTPSV, code));
tags_liste.emplace_back(FSTPSV, code);
code += sizeof(FSTPSV_);
break;
case FLDV:
# ifdef DEBUGL
mexPrintf("FLDV\n");
# endif
tags_liste.push_back(make_pair(FLDV, code));
tags_liste.emplace_back(FLDV, code);
code += sizeof(FLDV_);
break;
case FSTPV:
# ifdef DEBUGL
mexPrintf("FSTPV\n");
# endif
tags_liste.push_back(make_pair(FSTPV, code));
tags_liste.emplace_back(FSTPV, code);
code += sizeof(FSTPV_);
break;
case FBEGINBLOCK:
......@@ -1954,7 +1954,7 @@ public:
code = fbegin_block->load(code);
begin_block.push_back(tags_liste.size());
tags_liste.push_back(make_pair(FBEGINBLOCK, fbegin_block));
tags_liste.emplace_back(FBEGINBLOCK, fbegin_block));
nb_blocks++;
}
break;
......@@ -1962,14 +1962,14 @@ public:
# ifdef DEBUGL
mexPrintf("FJMPIFEVAL\n");
# endif
tags_liste.push_back(make_pair(FJMPIFEVAL, code));
tags_liste.emplace_back(FJMPIFEVAL, code);
code += sizeof(FJMPIFEVAL_);
break;
case FJMP:
# ifdef DEBUGL
mexPrintf("FJMP\n");
# endif
tags_liste.push_back(make_pair(FJMP, code));
tags_liste.emplace_back(FJMP, code);
code += sizeof(FJMP_);
break;
case FCALL:
......@@ -1981,7 +1981,7 @@ public:
code = fcall->load(code);
tags_liste.push_back(make_pair(FCALL, fcall));
tags_liste.emplace_back(FCALL, fcall));
# ifdef DEBUGL
mexPrintf("FCALL finish\n"); mexEvalString("drawnow;");
mexPrintf("-- *code=%d\n", *code); mexEvalString("drawnow;");
......@@ -1992,56 +1992,56 @@ public:
# ifdef DEBUGL
mexPrintf("FPUSH\n");
# endif
tags_liste.push_back(make_pair(FPUSH, code));
tags_liste.emplace_back(FPUSH, code);
code += sizeof(FPUSH_);
break;
case FPOP:
# ifdef DEBUGL
mexPrintf("FPOP\n");
# endif
tags_liste.push_back(make_pair(FPOP, code));
tags_liste.emplace_back(FPOP, code);
code += sizeof(FPOP_);
break;
case FLDTEF:
# ifdef DEBUGL
mexPrintf("FLDTEF\n");
# endif
tags_liste.push_back(make_pair(FLDTEF, code));
tags_liste.emplace_back(FLDTEF, code);
code += sizeof(FLDTEF_);
break;
case FSTPTEF:
# ifdef DEBUGL
mexPrintf("FSTPTEF\n");
# endif
tags_liste.push_back(make_pair(FSTPTEF, code));
tags_liste.emplace_back(FSTPTEF, code);
code += sizeof(FSTPTEF_);
break;
case FLDTEFD:
# ifdef DEBUGL
mexPrintf("FLDTEFD\n");
# endif
tags_liste.push_back(make_pair(FLDTEFD, code));
tags_liste.emplace_back(FLDTEFD, code);
code += sizeof(FLDTEFD_);
break;
case FSTPTEFD:
# ifdef DEBUGL
mexPrintf("FSTPTEFD\n");
# endif
tags_liste.push_back(make_pair(FSTPTEFD, code));
tags_liste.emplace_back(FSTPTEFD, code);
code += sizeof(FSTPTEFD_);
break;
case FLDTEFDD:
# ifdef DEBUGL
mexPrintf("FLDTEFDD\n");
# endif
tags_liste.push_back(make_pair(FLDTEFDD, code));
tags_liste.emplace_back(FLDTEFDD, code);
code += sizeof(FLDTEFDD_);
break;
case FSTPTEFDD:
# ifdef DEBUGL
mexPrintf("FSTPTEFDD\n");
# endif
tags_liste.push_back(make_pair(FSTPTEFDD, code));
tags_liste.emplace_back(FSTPTEFDD, code);
code += sizeof(FSTPTEFDD_);
break;
default:
......
......@@ -379,7 +379,7 @@ PacModelStatement::getPacModelInfoForPacExpectation(pair<string, pair<string, pa
int growth_symb_id = -1;
if (!growth.empty())
growth_symb_id = symbol_table.getID(growth);
pac_model_info = make_pair(name, make_pair(var_name, make_pair(discount, make_pair(growth_symb_id, undiff))));
pac_model_info = { name, { var_name, { discount, { growth_symb_id, undiff } } }};
}
VarModelStatement::VarModelStatement(SymbolList symbol_list_arg,
......@@ -407,7 +407,7 @@ VarModelStatement::getVarModelInfo(string &var_model_name,
else
{
auto it = options_list.num_options.find("var.order");
var_model_info[name] = make_pair(symbol_list, atoi(it->second.c_str()));
var_model_info[name] = { symbol_list, atoi(it->second.c_str()) };
}
}
......@@ -3134,7 +3134,7 @@ MarkovSwitchingStatement::MarkovSwitchingStatement(OptionsList options_list_arg)
exit(EXIT_FAILURE);
}
if (restriction_map.find(make_pair(from_regime, to_regime)) !=
if (restriction_map.find({ from_regime, to_regime }) !=
restriction_map.end())
{
cerr << "ERROR: two restrictions were given for: " << from_regime << ", "
......@@ -3149,7 +3149,7 @@ MarkovSwitchingStatement::MarkovSwitchingStatement(OptionsList options_list_arg)
<< " must be less than 1" << endl;
exit(EXIT_FAILURE);
}
restriction_map[make_pair(from_regime, to_regime)] = transition_probability;
restriction_map[{ from_regime, to_regime }] = transition_probability;
}
catch (const bad_lexical_cast &)
{
......@@ -3189,10 +3189,10 @@ MarkovSwitchingStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
vector<bool> all_restrictions_in_col(num_regimes, true);
for (int row = 0; row < num_regimes; row++)
for (int col = 0; col < num_regimes; col++)
if (restriction_map.find(make_pair(row+1, col+1)) != restriction_map.end())
if (restriction_map.find({ row+1, col+1 }) != restriction_map.end())
{
row_trans_prob_sum[row] += restriction_map[make_pair(row+1, col+1)];
col_trans_prob_sum[col] += restriction_map[make_pair(row+1, col+1)];
row_trans_prob_sum[row] += restriction_map[{ row+1, col+1 }];
col_trans_prob_sum[col] += restriction_map[{ row+1, col+1 }];
}
else
{
......
......@@ -65,7 +65,7 @@ DataTree::AddNonNegativeConstant(const string &value)
VariableNode *
DataTree::AddVariableInternal(int symb_id, int lag)
{
auto it = variable_node_map.find(make_pair(symb_id, lag));
auto it = variable_node_map.find({ symb_id, lag });
if (it != variable_node_map.end())
return it->second;
else
......@@ -506,7 +506,7 @@ DataTree::AddVarExpectation(const int symb_id, const int forecast_horizon, const
{
assert(symbol_table.getType(symb_id) == eEndogenous);
auto it = var_expectation_node_map.find(make_pair(model_name, make_pair(symb_id, forecast_horizon)));
auto it = var_expectation_node_map.find({ model_name, { symb_id, forecast_horizon } });
if (it != var_expectation_node_map.end())
return it->second;
......@@ -548,7 +548,7 @@ DataTree::AddExternalFunction(int symb_id, const vector<expr_t> &arguments)
{
assert(symbol_table.getType(symb_id) == eExternalFunction);
auto it = external_function_node_map.find(make_pair(arguments, symb_id));
auto it = external_function_node_map.find({ arguments, symb_id });
if (it != external_function_node_map.end())
return it->second;
......@@ -561,8 +561,7 @@ DataTree::AddFirstDerivExternalFunction(int top_level_symb_id, const vector<expr
assert(symbol_table.getType(top_level_symb_id) == eExternalFunction);
auto it
= first_deriv_external_function_node_map.find(make_pair(make_pair(arguments, input_index),
top_level_symb_id));
= first_deriv_external_function_node_map.find({ { arguments, input_index }, top_level_symb_id });
if (it != first_deriv_external_function_node_map.end())
return it->second;
......@@ -575,9 +574,8 @@ DataTree::AddSecondDerivExternalFunction(int top_level_symb_id, const vector<exp
assert(symbol_table.getType(top_level_symb_id) == eExternalFunction);
auto it
= second_deriv_external_function_node_map.find(make_pair(make_pair(arguments,
make_pair(input_index1, input_index2)),
top_level_symb_id));
= second_deriv_external_function_node_map.find({ { arguments, { input_index1, input_index2 } },
top_level_symb_id });
if (it != second_deriv_external_function_node_map.end())
return it->second;
......
......@@ -330,7 +330,7 @@ inline expr_t
DataTree::AddUnaryOp(UnaryOpcode op_code, expr_t arg, int arg_exp_info_set, int param1_symb_id, int param2_symb_id, const string &adl_param_name, const vector<int> &adl_lags)
{
// If the node already exists in tree, share it
auto it = unary_op_node_map.find(make_pair(make_pair(arg, op_code), make_pair(make_pair(arg_exp_info_set, make_pair(param1_symb_id, param2_symb_id)), make_pair(adl_param_name, adl_lags))));
auto it = unary_op_node_map.find({ { arg, op_code }, { { arg_exp_info_set, { param1_symb_id, param2_symb_id } }, { adl_param_name, adl_lags } } });
if (it != unary_op_node_map.end())
return it->second;
......@@ -355,7 +355,7 @@ DataTree::AddUnaryOp(UnaryOpcode op_code, expr_t arg, int arg_exp_info_set, int
inline expr_t
DataTree::AddBinaryOp(expr_t arg1, BinaryOpcode op_code, expr_t arg2, int powerDerivOrder)
{
auto it = binary_op_node_map.find(make_pair(make_pair(make_pair(arg1, arg2), powerDerivOrder), op_code));
auto it = binary_op_node_map.find({ { { arg1, arg2 }, powerDerivOrder }, op_code });
if (it != binary_op_node_map.end())
return it->second;
......@@ -376,7 +376,7 @@ DataTree::AddBinaryOp(expr_t arg1, BinaryOpcode op_code, expr_t arg2, int powerD
inline expr_t
DataTree::AddTrinaryOp(expr_t arg1, TrinaryOpcode op_code, expr_t arg2, expr_t arg3)
{
auto it = trinary_op_node_map.find(make_pair(make_pair(make_pair(arg1, arg2), arg3), op_code));
auto it = trinary_op_node_map.find({ { { arg1, arg2 }, arg3 }, op_code });
if (it != trinary_op_node_map.end())
return it->second;
......
......@@ -62,7 +62,7 @@ DynamicModel::AddVariable(int symb_id, int lag)
void
DynamicModel::compileDerivative(ofstream &code_file, unsigned int &instruction_number, int eq, int symb_id, int lag, const map_idx_t &map_idx) const
{
auto it = first_derivatives.find(make_pair(eq, getDerivID(symbol_table.getID(eEndogenous, symb_id), lag)));
auto it = first_derivatives.find({ eq, getDerivID(symbol_table.getID(eEndogenous, symb_id), lag) });
if (it != first_derivatives.end())
(it->second)->compile(code_file, instruction_number, false, temporary_terms, map_idx, true, false);
else
......@@ -75,7 +75,7 @@ DynamicModel::compileDerivative(ofstream &code_file, unsigned int &instruction_n
void
DynamicModel::compileChainRuleDerivative(ofstream &code_file, unsigned int &instruction_number, int eqr, int varr, int lag, const map_idx_t &map_idx) const
{
auto it = first_chain_rule_derivatives.find(make_pair(eqr, make_pair(varr, lag)));
auto it = first_chain_rule_derivatives.find({ eqr, { varr, lag } });
if (it != first_chain_rule_derivatives.end())
(it->second)->compile(code_file, instruction_number, false, temporary_terms, map_idx, true, false);
else
......@@ -256,7 +256,7 @@ DynamicModel::writeModelEquationsOrdered_M(const string &dynamic_basename) const
unsigned int prev_var, count_col, count_col_endo, count_col_exo, count_col_exo_det, count_col_other_endo;
map<pair<int, pair<int, int>>, expr_t> tmp_block_endo_derivative;
for (auto it = blocks_derivatives[block].begin(); it != (blocks_derivatives[block]).end(); it++)
tmp_block_endo_derivative[make_pair(it->second.first, make_pair(it->first.second, it->first.first))] = it->second.second;
tmp_block_endo_derivative[{ it->second.first, { it->first.second, it->first.first } }] = it->second.second;
prev_var = 999999999;
prev_lag = -9999999;
count_col_endo = 0;
......@@ -273,7 +273,7 @@ DynamicModel::writeModelEquationsOrdered_M(const string &dynamic_basename) const
}
map<pair<int, pair<int, int>>, expr_t> tmp_block_exo_derivative;
for (auto it = derivative_exo[block].begin(); it != (derivative_exo[block]).end(); it++)
tmp_block_exo_derivative[make_pair(it->first.first, make_pair(it->first.second.second, it->first.second.first))] = it->second;
tmp_block_exo_derivative[{ it->first.first, { it->first.second.second, it->first.second.first } }] = it->second;
prev_var = 999999999;
prev_lag = -9999999;
count_col_exo = 0;
......@@ -290,7 +290,7 @@ DynamicModel::writeModelEquationsOrdered_M(const string &dynamic_basename) const
}
map<pair<int, pair<int, int>>, expr_t> tmp_block_exo_det_derivative;
for (auto it = derivative_exo_det[block].begin(); it != (derivative_exo_det[block]).end(); it++)
tmp_block_exo_det_derivative[make_pair(it->first.first, make_pair(it->first.second.second, it->first.second.first))] = it->second;
tmp_block_exo_det_derivative[{ it->first.first, { it->first.second.second, it->first.second.first } }] = it->second;
prev_var = 999999999;
prev_lag = -9999999;
count_col_exo_det = 0;
......@@ -307,7 +307,7 @@ DynamicModel::writeModelEquationsOrdered_M(const string &dynamic_basename) const
}
map<pair<int, pair<int, int>>, expr_t> tmp_block_other_endo_derivative;
for (auto it = derivative_other_endo[block].begin(); it != (derivative_other_endo[block]).end(); it++)
tmp_block_other_endo_derivative[make_pair(it->first.first, make_pair(it->first.second.second, it->first.second.first))] = it->second;
tmp_block_other_endo_derivative[{ it->first.first, { it->first.second.second, it->first.second.first } }] = it->second;
prev_var = 999999999;
prev_lag = -9999999;
count_col_other_endo = 0;
......@@ -840,9 +840,9 @@ DynamicModel::writeModelEquationsCode(string &file_name, const string &bin_basen
unsigned int var = symbol_table.getTypeSpecificID(symb);
int lag = getLagByDerivID(deriv_id);
if (getTypeByDerivID(deriv_id) == eEndogenous)
first_derivatives_reordered_endo[make_pair(lag, make_pair(var, eq))] = first_derivative.second;
first_derivatives_reordered_endo[{ lag, make_pair(var, eq) }] = first_derivative.second;
else if (getTypeByDerivID(deriv_id) == eExogenous || getTypeByDerivID(deriv_id) == eExogenousDet)
first_derivatives_reordered_exo[make_pair(make_pair(lag, getTypeByDerivID(deriv_id)), make_pair(var, eq))] = first_derivative.second;
first_derivatives_reordered_exo[{ { lag, getTypeByDerivID(deriv_id) }, { var, eq } }] = first_derivative.second;
}
int prev_var = -1;
int prev_lag = -999999999;
......@@ -937,7 +937,7 @@ DynamicModel::writeModelEquationsCode(string &file_name, const string &bin_basen
fnumexpr.write(code_file, instruction_number);
if (!derivatives[eq].size())
derivatives[eq].clear();
derivatives[eq].push_back(make_pair(make_pair(var, lag), count_u));
derivatives[eq].emplace_back(make_pair(var, lag), count_u);
d1->compile(code_file, instruction_number, false, temporary_terms, map_idx, true, false);
FSTPU_ fstpu(count_u);
......@@ -1110,16 +1110,16 @@ DynamicModel::writeModelEquationsCode_Block(string &file_name, const string &bin
}
map<pair<int, pair<int, int>>, expr_t> tmp_block_endo_derivative;
for (auto it = blocks_derivatives[block].begin(); it != (blocks_derivatives[block]).end(); it++)
tmp_block_endo_derivative[make_pair(it->second.first, make_pair(it->first.second, it->first.first))] = it->second.second;
tmp_block_endo_derivative[{ it->second.first, { it->first.second, it->first.first } }] = it->second.second;
map<pair<int, pair<int, int>>, expr_t> tmp_exo_derivative;
for (auto it = derivative_exo[block].begin(); it != (derivative_exo[block]).end(); it++)
tmp_exo_derivative[make_pair(it->first.first, make_pair(it->first.second.second, it->first.second.first))] = it->second;
tmp_exo_derivative[{ it->first.first, { it->first.second.second, it->first.second.first } }] = it->second;
map<pair<int, pair<int, int>>, expr_t> tmp_exo_det_derivative;
for (auto it = derivative_exo_det[block].begin(); it != (derivative_exo_det[block]).end(); it++)
tmp_exo_det_derivative[make_pair(it->first.first, make_pair(it->first.second.second, it->first.second.first))] = it->second;
tmp_exo_det_derivative[{ it->first.first, { it->first.second.second, it->first.second.first } }] = it->second;
map<pair<int, pair<int, int>>, expr_t> tmp_other_endo_derivative;
for (auto it = derivative_other_endo[block].begin(); it != (derivative_other_endo[block]).end(); it++)
tmp_other_endo_derivative[make_pair(it->first.first, make_pair(it->first.second.second, it->first.second.first))] = it->second;
tmp_other_endo_derivative[{ it->first.first, { it->first.second.second, it->first.second.first } }] = it->second;
int prev_var = -1;
int prev_lag = -999999999;
int count_col_endo = 0;
......@@ -3121,7 +3121,7 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
count_lead_lag_incidence = 0;
dynamic_jacob_map_t reordered_dynamic_jacobian;
for (const auto & it : blocks_derivatives[block])
reordered_dynamic_jacobian[make_pair(it.second.first, make_pair(it.first.second, it.first.first))] = it.second.second;
reordered_dynamic_jacobian[{ it.second.first, { it.first.second, it.first.first } }] = it.second.second;
output << "block_structure.block(" << block+1 << ").lead_lag_incidence = [];\n";
int last_var = -1;
vector<int> local_state_var;
......@@ -3195,7 +3195,7 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
for (int i = 0; i < block_size; i++)
{
unsigned int eq = getBlockEquationID(block, i);
auto it = derivative_other_endo[block].find(make_pair(lag, make_pair(eq, other_endogenou)));
auto it = derivative_other_endo[block].find({ lag, { eq, other_endogenou } });
if (it != derivative_other_endo[block].end())
{
count_lead_lag_incidence++;
......@@ -3243,7 +3243,7 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
int symb = getSymbIDByDerivID(deriv_id);
int var = symbol_table.getTypeSpecificID(symb);
int lag = getLagByDerivID(deriv_id);
lag_row_incidence[make_pair(lag, make_pair(eq, var))] = 1;
lag_row_incidence[{ lag, { eq, var } }] = 1;
}
}
int prev_lag = -1000000;
......@@ -3304,7 +3304,7 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de
{
vector<int>::const_iterator it_state_equ = find(state_equ.begin(), state_equ.end(), getBlockEquationID(block, it->first.first)+1);
if (it_state_equ != state_equ.end())
row_state_var_incidence.insert(make_pair(it_state_equ - state_equ.begin(), it_state_var - state_var.begin()));
row_state_var_incidence.emplace(it_state_equ - state_equ.begin(), it_state_var - state_var.