Commit c0ed97d2 authored by Sébastien Villemot's avatar Sébastien Villemot

Port to C++11 auto keyword

Performed using modernize-use-auto from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html
parent dcfc5981
This diff is collapsed.
......@@ -402,7 +402,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
else
try
{
double weight = lexical_cast<double>(token.c_str());
auto weight = lexical_cast<double>(token.c_str());
if (weight <= 0)
{
cerr << "ERROR (in config file): Misspecification of weights passed to Members option." << endl;
......
......@@ -55,7 +55,7 @@ DataTree::AddNonNegativeConstant(const string &value)
{
int id = num_constants.AddNonNegativeConstant(value);
num_const_node_map_t::iterator it = num_const_node_map.find(id);
auto it = num_const_node_map.find(id);
if (it != num_const_node_map.end())
return it->second;
else
......@@ -65,7 +65,7 @@ DataTree::AddNonNegativeConstant(const string &value)
VariableNode *
DataTree::AddVariableInternal(int symb_id, int lag)
{
variable_node_map_t::iterator it = variable_node_map.find(make_pair(symb_id, lag));
auto it = variable_node_map.find(make_pair(symb_id, lag));
if (it != variable_node_map.end())
return it->second;
else
......@@ -94,7 +94,7 @@ DataTree::AddPlus(expr_t iArg1, expr_t iArg2)
if (iArg1 != Zero && iArg2 != Zero)
{
// Simplify x+(-y) in x-y
UnaryOpNode *uarg2 = dynamic_cast<UnaryOpNode *>(iArg2);
auto *uarg2 = dynamic_cast<UnaryOpNode *>(iArg2);
if (uarg2 != NULL && uarg2->get_op_code() == oUminus)
return AddMinus(iArg1, uarg2->get_arg());
......@@ -137,7 +137,7 @@ DataTree::AddUMinus(expr_t iArg1)
if (iArg1 != Zero)
{
// Simplify -(-x) in x
UnaryOpNode *uarg = dynamic_cast<UnaryOpNode *>(iArg1);
auto *uarg = dynamic_cast<UnaryOpNode *>(iArg1);
if (uarg != NULL && uarg->get_op_code() == oUminus)
return uarg->get_arg();
......@@ -506,7 +506,7 @@ DataTree::AddVarExpectation(const int symb_id, const int forecast_horizon, const
{
assert(symbol_table.getType(symb_id) == eEndogenous);
var_expectation_node_map_t::iterator it = var_expectation_node_map.find(make_pair(model_name, make_pair(symb_id, forecast_horizon)));
auto it = var_expectation_node_map.find(make_pair(model_name, make_pair(symb_id, forecast_horizon)));
if (it != var_expectation_node_map.end())
return it->second;
......@@ -516,7 +516,7 @@ DataTree::AddVarExpectation(const int symb_id, const int forecast_horizon, const
expr_t
DataTree::AddPacExpectation(const string &model_name)
{
pac_expectation_node_map_t::iterator it = pac_expectation_node_map.find(model_name);
auto it = pac_expectation_node_map.find(model_name);
if (it != pac_expectation_node_map.end())
return it->second;
......@@ -535,7 +535,7 @@ DataTree::AddLocalVariable(int symb_id, expr_t value) throw (LocalVariableExcept
assert(symbol_table.getType(symb_id) == eModelLocalVariable);
// Throw an exception if symbol already declared
map<int, expr_t>::iterator it = local_variables_table.find(symb_id);
auto it = local_variables_table.find(symb_id);
if (it != local_variables_table.end())
throw LocalVariableException(symbol_table.getName(symb_id));
......@@ -548,7 +548,7 @@ DataTree::AddExternalFunction(int symb_id, const vector<expr_t> &arguments)
{
assert(symbol_table.getType(symb_id) == eExternalFunction);
external_function_node_map_t::iterator it = external_function_node_map.find(make_pair(arguments, symb_id));
auto it = external_function_node_map.find(make_pair(arguments, symb_id));
if (it != external_function_node_map.end())
return it->second;
......@@ -560,7 +560,7 @@ DataTree::AddFirstDerivExternalFunction(int top_level_symb_id, const vector<expr
{
assert(symbol_table.getType(top_level_symb_id) == eExternalFunction);
first_deriv_external_function_node_map_t::iterator it
auto it
= first_deriv_external_function_node_map.find(make_pair(make_pair(arguments, input_index),
top_level_symb_id));
if (it != first_deriv_external_function_node_map.end())
......@@ -574,7 +574,7 @@ DataTree::AddSecondDerivExternalFunction(int top_level_symb_id, const vector<exp
{
assert(symbol_table.getType(top_level_symb_id) == eExternalFunction);
second_deriv_external_function_node_map_t::iterator it
auto it
= second_deriv_external_function_node_map.find(make_pair(make_pair(arguments,
make_pair(input_index1, input_index2)),
top_level_symb_id));
......
......@@ -330,13 +330,13 @@ 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
unary_op_node_map_t::iterator 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(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))));
if (it != unary_op_node_map.end())
return it->second;
// Try to reduce to a constant
// Case where arg is a constant and op_code == oUminus (i.e. we're adding a negative constant) is skipped
NumConstNode *carg = dynamic_cast<NumConstNode *>(arg);
auto *carg = dynamic_cast<NumConstNode *>(arg);
if (op_code != oUminus || carg == NULL)
{
try
......@@ -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)
{
binary_op_node_map_t::iterator it = binary_op_node_map.find(make_pair(make_pair(make_pair(arg1, arg2), powerDerivOrder), op_code));
auto it = binary_op_node_map.find(make_pair(make_pair(make_pair(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)
{
trinary_op_node_map_t::iterator it = trinary_op_node_map.find(make_pair(make_pair(make_pair(arg1, arg2), arg3), op_code));
auto it = trinary_op_node_map.find(make_pair(make_pair(make_pair(arg1, arg2), arg3), op_code));
if (it != trinary_op_node_map.end())
return it->second;
......
This diff is collapsed.
......@@ -543,7 +543,7 @@ public:
virtual int
getBlockVariableExoID(int block_number, int variable_number) const
{
map<int, var_t>::const_iterator it = exo_block[block_number].find(variable_number);
auto it = exo_block[block_number].find(variable_number);
return (it->first);
};
//! Return the position of equation_number in the block number belonging to the block block_number
......@@ -568,10 +568,10 @@ public:
virtual int
getBlockInitialExogenousID(int block_number, int variable_number) const
{
map< int, map<int, int> >::const_iterator it = block_exo_index.find(block_number);
auto it = block_exo_index.find(block_number);
if (it != block_exo_index.end())
{
map<int, int>::const_iterator it1 = it->second.find(variable_number);
auto it1 = it->second.find(variable_number);
if (it1 != it->second.end())
return it1->second;
else
......@@ -584,10 +584,10 @@ public:
virtual int
getBlockInitialDetExogenousID(int block_number, int variable_number) const
{
map< int, map<int, int> >::const_iterator it = block_det_exo_index.find(block_number);
auto it = block_det_exo_index.find(block_number);
if (it != block_det_exo_index.end())
{
map<int, int>::const_iterator it1 = it->second.find(variable_number);
auto it1 = it->second.find(variable_number);
if (it1 != it->second.end())
return it1->second;
else
......@@ -600,10 +600,10 @@ public:
virtual int
getBlockInitialOtherEndogenousID(int block_number, int variable_number) const
{
map< int, map<int, int> >::const_iterator it = block_other_endo_index.find(block_number);
auto it = block_other_endo_index.find(block_number);
if (it != block_other_endo_index.end())
{
map<int, int>::const_iterator it1 = it->second.find(variable_number);
auto it1 = it->second.find(variable_number);
if (it1 != it->second.end())
return it1->second;
else
......
This diff is collapsed.
......@@ -81,7 +81,7 @@ public:
inline bool
ExternalFunctionsTable::exists(int symb_id) const
{
external_function_table_type::const_iterator iter = externalFunctionTable.find(symb_id);
auto iter = externalFunctionTable.find(symb_id);
return (iter != externalFunctionTable.end());
}
......
......@@ -61,15 +61,15 @@ ModFile::evalAllExpressions(bool warn_uninit, const bool nopreprocessoroutput)
// Loop over all statements, and fill global eval context if relevant
for (vector<Statement *>::const_iterator it = statements.begin(); it != statements.end(); it++)
{
InitParamStatement *ips = dynamic_cast<InitParamStatement *>(*it);
auto *ips = dynamic_cast<InitParamStatement *>(*it);
if (ips)
ips->fillEvalContext(global_eval_context);
InitOrEndValStatement *ies = dynamic_cast<InitOrEndValStatement *>(*it);
auto *ies = dynamic_cast<InitOrEndValStatement *>(*it);
if (ies)
ies->fillEvalContext(global_eval_context);
LoadParamsAndSteadyStateStatement *lpass = dynamic_cast<LoadParamsAndSteadyStateStatement *>(*it);
auto *lpass = dynamic_cast<LoadParamsAndSteadyStateStatement *>(*it);
if (lpass)
lpass->fillEvalContext(global_eval_context);
}
......@@ -310,7 +310,7 @@ ModFile::checkPass(bool nostrict, bool stochastic)
if (parameters_intersect.size() > 0)
{
cerr << "ERROR: some estimated parameters (";
for (set<int>::const_iterator it = parameters_intersect.begin();
for (auto it = parameters_intersect.begin();
it != parameters_intersect.end();)
{
cerr << symbol_table.getName(*it);
......@@ -381,7 +381,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
for (vector<Statement *>::const_iterator it = statements.begin();
it != statements.end(); it++)
{
VarModelStatement *vms = dynamic_cast<VarModelStatement *>(*it);
auto *vms = dynamic_cast<VarModelStatement *>(*it);
if (vms != NULL)
{
string var_model_name;
......@@ -403,7 +403,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
make_pair(diff, orig_diff_var)),
make_pair(make_pair(max_lag, nonstationary), eqnumber));
}
PacModelStatement *pms = dynamic_cast<PacModelStatement *>(*it);
auto *pms = dynamic_cast<PacModelStatement *>(*it);
if (pms != NULL)
{
pair<string, pair<string, pair<string, pair<int, map<string, int> > > > >
......@@ -462,7 +462,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
StaticModel *planner_objective = NULL;
for (auto & statement : statements)
{
PlannerObjectiveStatement *pos = dynamic_cast<PlannerObjectiveStatement *>(statement);
auto *pos = dynamic_cast<PlannerObjectiveStatement *>(statement);
if (pos != NULL)
planner_objective = pos->getPlannerObjective();
}
......@@ -523,7 +523,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
for (vector<Statement *>::const_iterator it = statements.begin();
it != statements.end(); it++)
{
VarModelStatement *vms = dynamic_cast<VarModelStatement *>(*it);
auto *vms = dynamic_cast<VarModelStatement *>(*it);
if (vms != NULL)
{
string var_model_name;
......@@ -597,7 +597,7 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
if (mod_file_struct.ramsey_policy_present)
for (auto & statement : statements)
{
RamseyPolicyStatement *rps = dynamic_cast<RamseyPolicyStatement *>(statement);
auto *rps = dynamic_cast<RamseyPolicyStatement *>(statement);
if (rps != NULL)
rps->checkRamseyPolicyList();
}
......@@ -988,7 +988,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
/* Special treatment for initval block: insert initial values for the
auxiliary variables and initialize exo det */
InitValStatement *ivs = dynamic_cast<InitValStatement *>(statement);
auto *ivs = dynamic_cast<InitValStatement *>(statement);
if (ivs != NULL)
{
static_model.writeAuxVarInitval(mOutputFile, oMatlabOutsideModel);
......@@ -996,17 +996,17 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
}
// Special treatment for endval block: insert initial values for the auxiliary variables
EndValStatement *evs = dynamic_cast<EndValStatement *>(statement);
auto *evs = dynamic_cast<EndValStatement *>(statement);
if (evs != NULL)
static_model.writeAuxVarInitval(mOutputFile, oMatlabOutsideModel);
// Special treatment for load params and steady state statement: insert initial values for the auxiliary variables
LoadParamsAndSteadyStateStatement *lpass = dynamic_cast<LoadParamsAndSteadyStateStatement *>(statement);
auto *lpass = dynamic_cast<LoadParamsAndSteadyStateStatement *>(statement);
if (lpass && !no_static)
static_model.writeAuxVarInitval(mOutputFile, oMatlabOutsideModel);
// Special treatement for Var Models
VarModelStatement *vms = dynamic_cast<VarModelStatement *>(statement);
auto *vms = dynamic_cast<VarModelStatement *>(statement);
if (vms != NULL)
vms->createVarModelMFunction(mOutputFile, dynamic_model.getVarExpectationFunctionsToWrite());
}
......@@ -1489,7 +1489,7 @@ ModFile::writeJsonOutputParsingCheck(const string &basename, JsonFileOutputType
if (!statements.empty())
{
output << ", \"statements\": [";
for (vector<Statement *>::const_iterator it = statements.begin();
for (auto it = statements.begin();
it != statements.end(); it++)
{
if (it != statements.begin())
......
......@@ -234,7 +234,7 @@ ModelTree::computeNormalizedEquations(multimap<int, int> &endo2eqs) const
{
for (size_t i = 0; i < equations.size(); i++)
{
VariableNode *lhs = dynamic_cast<VariableNode *>(equations[i]->get_arg1());
auto *lhs = dynamic_cast<VariableNode *>(equations[i]->get_arg1());
if (lhs == NULL)
continue;
......@@ -450,13 +450,13 @@ ModelTree::equationTypeDetermination(const map<pair<int, pair<int, int> >, expr_
eq_node = equations[eq];
lhs = eq_node->get_arg1();
Equation_Simulation_Type = E_SOLVE;
map<pair<int, pair<int, int> >, expr_t>::const_iterator derivative = first_order_endo_derivatives.find(make_pair(eq, make_pair(var, 0)));
auto derivative = first_order_endo_derivatives.find(make_pair(eq, make_pair(var, 0)));
pair<bool, expr_t> res;
if (derivative != first_order_endo_derivatives.end())
{
set<pair<int, int> > result;
derivative->second->collectEndogenous(result);
set<pair<int, int> >::const_iterator d_endo_variable = result.find(make_pair(var, 0));
auto d_endo_variable = result.find(make_pair(var, 0));
//Determine whether the equation could be evaluated rather than to be solved
if (lhs->isVariableNodeEqualTo(eEndogenous, Index_Var_IM[i], 0) && derivative->second->isNumConstNodeEqualTo(1))
{
......@@ -836,7 +836,7 @@ ModelTree::reduceBlocksAndTypeDetermination(const dynamic_jacob_map_t &dynamic_j
{
int curr_variable = it.first;
int curr_lag = it.second;
vector<int>::const_iterator it1 = find(variable_reordered.begin()+first_count_equ, variable_reordered.begin()+(first_count_equ+Blck_Size), curr_variable);
auto it1 = find(variable_reordered.begin()+first_count_equ, variable_reordered.begin()+(first_count_equ+Blck_Size), curr_variable);
if (it1 != variable_reordered.begin()+(first_count_equ+Blck_Size))
if (dynamic_jacobian.find(make_pair(curr_lag, make_pair(equation_reordered[count_equ], curr_variable))) != dynamic_jacobian.end())
{
......@@ -891,7 +891,7 @@ ModelTree::reduceBlocksAndTypeDetermination(const dynamic_jacob_map_t &dynamic_j
{
for (int j = first_equation; j < first_equation+c_Size; j++)
{
dynamic_jacob_map_t::const_iterator it = dynamic_jacobian.find(make_pair(-1, make_pair(equation_reordered[eq], variable_reordered[j])));
auto it = dynamic_jacobian.find(make_pair(-1, make_pair(equation_reordered[eq], variable_reordered[j])));
if (it != dynamic_jacobian.end())
is_lag = true;
it = dynamic_jacobian.find(make_pair(+1, make_pair(equation_reordered[eq], variable_reordered[j])));
......@@ -1025,7 +1025,7 @@ ModelTree::writeDerivative(ostream &output, int eq, int symb_id, int lag,
ExprNodeOutputType output_type,
const temporary_terms_t &temporary_terms) const
{
first_derivatives_t::const_iterator it = first_derivatives.find(make_pair(eq, getDerivID(symb_id, lag)));
auto it = first_derivatives.find(make_pair(eq, getDerivID(symb_id, lag)));
if (it != first_derivatives.end())
(it->second)->writeOutput(output, output_type, temporary_terms, {});
else
......@@ -1221,7 +1221,7 @@ ModelTree::writeTemporaryTerms(const temporary_terms_t &tt,
{
// Local var used to keep track of temp nodes already written
temporary_terms_t tt2 = ttm1;
for (temporary_terms_t::const_iterator it = tt.begin();
for (auto it = tt.begin();
it != tt.end(); it++)
{
if (dynamic_cast<AbstractExternalFunctionNode *>(*it) != NULL)
......@@ -1278,7 +1278,7 @@ ModelTree::writeJsonTemporaryTerms(const temporary_terms_t &tt, const temporary_
wrote_term = false;
output << "]"
<< ", \"temporary_terms_" << concat << "\": [";
for (temporary_terms_t::const_iterator it = tt.begin();
for (auto it = tt.begin();
it != tt.end(); it++)
if (ttm1.find(*it) == ttm1.end())
{
......@@ -1733,7 +1733,7 @@ ModelTree::writeLatexModelFile(const string &basename, ExprNodeOutputType output
void
ModelTree::addEquation(expr_t eq, int lineno)
{
BinaryOpNode *beq = dynamic_cast<BinaryOpNode *>(eq);
auto *beq = dynamic_cast<BinaryOpNode *>(eq);
assert(beq != NULL && beq->get_op_code() == oEqual);
equations.push_back(beq);
......@@ -1752,7 +1752,7 @@ ModelTree::addEquation(expr_t eq, int lineno, const vector<pair<string, string>
void
ModelTree::addAuxEquation(expr_t eq)
{
BinaryOpNode *beq = dynamic_cast<BinaryOpNode *>(eq);
auto *beq = dynamic_cast<BinaryOpNode *>(eq);
assert(beq != NULL && beq->get_op_code() == oEqual);
aux_equations.push_back(beq);
......
......@@ -33,7 +33,7 @@ NumericalConstants::AddNonNegativeConstant(const string &iConst)
if (iter != numConstantsIndex.end())
return iter->second;
int id = (int) mNumericalConstants.size();
auto id = (int) mNumericalConstants.size();
mNumericalConstants.push_back(iConst);
numConstantsIndex[iConst] = id;
......
......@@ -174,7 +174,7 @@ InitOrEndValStatement::writeInitValues(ostream &output) const
void
InitOrEndValStatement::writeJsonInitValues(ostream &output) const
{
for (init_values_t::const_iterator it = init_values.begin();
for (auto it = init_values.begin();
it != init_values.end(); it++)
{
if (it != init_values.begin())
......@@ -414,7 +414,7 @@ void
HistValStatement::writeJsonOutput(ostream &output) const
{
output << "{\"statementName\": \"hist_val\", \"vals\": [";
for (hist_values_t::const_iterator it = hist_values.begin();
for (auto it = hist_values.begin();
it != hist_values.end(); it++)
{
if (it != hist_values.begin())
......@@ -510,7 +510,7 @@ HomotopyStatement::writeJsonOutput(ostream &output) const
{
output << "{\"statementName\": \"homotopy\", "
<< "\"values\": [";
for (homotopy_values_t::const_iterator it = homotopy_values.begin();
for (auto it = homotopy_values.begin();
it != homotopy_values.end(); it++)
{
if (it != homotopy_values.begin())
......@@ -617,7 +617,7 @@ LoadParamsAndSteadyStateStatement::writeJsonOutput(ostream &output) const
{
output << "{\"statementName\": \"load_params_and_steady_state\""
<< "\"values\": [";
for (map<int, string>::const_iterator it = content.begin();
for (auto it = content.begin();
it != content.end(); it++)
{
if (it != content.begin())
......
......@@ -426,7 +426,7 @@ ParsingDriver::declare_or_change_type(SymbolType new_type, string *name)
mod_file->symbol_table.changeType(symb_id, new_type);
// change in equations in ModelTree
DynamicModel *dm = new DynamicModel(mod_file->symbol_table,
auto *dm = new DynamicModel(mod_file->symbol_table,
mod_file->num_constants,
mod_file->external_functions_table);
mod_file->dynamic_model.updateAfterVariableChange(*dm);
......@@ -434,7 +434,7 @@ ParsingDriver::declare_or_change_type(SymbolType new_type, string *name)
// remove error messages
undeclared_model_vars.erase(*name);
for (vector<pair<string, string> >::iterator it = undeclared_model_variable_errors.begin();
for (auto it = undeclared_model_variable_errors.begin();
it != undeclared_model_variable_errors.end();)
if (it->first == *name)
it = undeclared_model_variable_errors.erase(it);
......@@ -593,7 +593,7 @@ void
ParsingDriver::add_VAR_exclusion_restriction(string *lagstr)
{
int lag = atoi(lagstr->c_str());
map<int, map<int, SymbolList> >::iterator it = exclusion_restrictions.find(lag);
auto it = exclusion_restrictions.find(lag);
if (it == exclusion_restrictions.end())
exclusion_restrictions[lag] = exclusion_restriction;
else
......@@ -1250,7 +1250,7 @@ ParsingDriver::combine_lag_and_restriction(string *lag)
for (map<int, vector<int> >::const_iterator it = svar_equation_restrictions.begin();
it != svar_equation_restrictions.end(); it++)
for (vector<int>::const_iterator it1 = it->second.begin();
for (auto it1 = it->second.begin();
it1 != it->second.end(); it1++)
{
SvarIdentificationStatement::svar_identification_restriction new_restriction;
......@@ -2869,7 +2869,7 @@ ParsingDriver::add_diff(expr_t arg1)
expr_t
ParsingDriver::add_adl(expr_t arg1, string *name, string *lag)
{
vector<int> *lags = new vector<int>();
auto *lags = new vector<int>();
for (int i = 1; i <= atoi(lag->c_str()); i++)
lags->push_back(i);
......@@ -3126,8 +3126,8 @@ ParsingDriver::is_there_one_integer_argument() const
if (stack_external_function_args.top().size() != 1)
return make_pair(false, 0);
NumConstNode *numNode = dynamic_cast<NumConstNode *>(stack_external_function_args.top().front());
UnaryOpNode *unaryNode = dynamic_cast<UnaryOpNode *>(stack_external_function_args.top().front());
auto *numNode = dynamic_cast<NumConstNode *>(stack_external_function_args.top().front());
auto *unaryNode = dynamic_cast<UnaryOpNode *>(stack_external_function_args.top().front());
if (numNode == NULL && unaryNode == NULL)
return make_pair(false, 0);
......
......@@ -71,14 +71,14 @@ void
AbstractShocksStatement::writeJsonDetShocks(ostream &output) const
{
output << "\"deterministic_shocks\": [";
for (det_shocks_t::const_iterator it = det_shocks.begin();
for (auto it = det_shocks.begin();
it != det_shocks.end(); it++)
{
if (it != det_shocks.begin())
output << ", ";
output << "{\"var\": \"" << symbol_table.getName(it->first) << "\", "
<< "\"values\": [";
for (vector<DetShockElement>::const_iterator it1 = it->second.begin();
for (auto it1 = it->second.begin();
it1 != it->second.end(); it1++)
{
if (it1 != it->second.begin())
......@@ -165,7 +165,7 @@ ShocksStatement::writeJsonOutput(ostream &output) const
writeJsonDetShocks(output);
}
output<< ", \"variance\": [";
for (var_and_std_shocks_t::const_iterator it = var_shocks.begin(); it != var_shocks.end(); it++)
for (auto it = var_shocks.begin(); it != var_shocks.end(); it++)
{
if (it != var_shocks.begin())
output << ", ";
......@@ -176,7 +176,7 @@ ShocksStatement::writeJsonOutput(ostream &output) const
}
output << "]"
<< ", \"stderr\": [";
for (var_and_std_shocks_t::const_iterator it = std_shocks.begin(); it != std_shocks.end(); it++)
for (auto it = std_shocks.begin(); it != std_shocks.end(); it++)
{
if (it != std_shocks.begin())
output << ", ";
......@@ -187,7 +187,7 @@ ShocksStatement::writeJsonOutput(ostream &output) const
}
output << "]"
<< ", \"covariance\": [";
for (covar_and_corr_shocks_t::const_iterator it = covar_shocks.begin(); it != covar_shocks.end(); it++)
for (auto it = covar_shocks.begin(); it != covar_shocks.end(); it++)
{
if (it != covar_shocks.begin())
output << ", ";
......@@ -200,7 +200,7 @@ ShocksStatement::writeJsonOutput(ostream &output) const
}
output << "]"
<< ", \"correlation\": [";
for (covar_and_corr_shocks_t::const_iterator it = corr_shocks.begin(); it != corr_shocks.end(); it++)
for (auto it = corr_shocks.begin(); it != corr_shocks.end(); it++)
{
if (it != corr_shocks.begin())
output << ", ";
......@@ -468,7 +468,7 @@ ConditionalForecastPathsStatement::writeOutput(ostream &output, const string &ba
<< "constrained_paths_ = zeros(" << paths.size() << ", " << path_length << ");" << endl;
int k = 1;
for (AbstractShocksStatement::det_shocks_t::const_iterator it = paths.begin();
for (auto it = paths.begin();
it != paths.end(); it++, k++)
{
if (it == paths.begin())
......@@ -513,7 +513,7 @@ MomentCalibration::writeJsonOutput(ostream &output) const
{
output << "{\"statementName\": \"moment_calibration\""
<< ", \"moment_calibration_criteria\": [";
for (constraints_t::const_iterator it = constraints.begin(); it != constraints.end(); it++)
for (auto it = constraints.begin(); it != constraints.end(); it++)
{
if (it != constraints.begin())
output << ", ";
......@@ -563,7 +563,7 @@ IrfCalibration::writeJsonOutput(ostream &output) const
}
output << ", \"irf_restrictions\": [";
for (constraints_t::const_iterator it = constraints.begin(); it != constraints.end(); it++)
for (auto it = constraints.begin(); it != constraints.end(); it++)
{
if (it != constraints.begin())
output << ", ";
......@@ -588,9 +588,9 @@ ShockGroupsStatement::writeOutput(ostream &output, const string &basename, bool
{
int i = 1;
bool unique_label = true;
for (vector<Group>::const_iterator it = shock_groups.begin(); it != shock_groups.end(); it++, unique_label = true)
for (auto it = shock_groups.begin(); it != shock_groups.end(); it++, unique_label = true)
{
for (vector<Group>::const_iterator it1 = it+1; it1 != shock_groups.end(); it1++)
for (auto it1 = it+1; it1 != shock_groups.end(); it1++)
if (it->name == it1->name)
{
unique_label = false;
......
......@@ -165,7 +165,7 @@ OptionsList::writeOutput(ostream &output) const
if (vector_int_option.second.size() > 1)
{
output << "[";
for (vector<int>::const_iterator viit = vector_int_option.second.begin();
for (auto viit = vector_int_option.second.begin();
viit != vector_int_option.second.end(); viit++)
output << *viit << ";";
output << "];" << endl;
......@@ -180,7 +180,7 @@ OptionsList::writeOutput(ostream &output) const
if (vector_str_option.second.size() > 1)
{
output << "{";
for (vector<string>::const_iterator viit = vector_str_option.second.begin();
for (auto viit = vector_str_option.second.begin();
viit != vector_str_option.second.end(); viit++)
output << "'" << *viit << "';";
output << "};" << endl;
......@@ -226,7 +226,7 @@ OptionsList::writeOutput(ostream &output, const string &option_group) const
if (vector_int_option.second.size() > 1)
{
output << "[";
for (vector<int>::const_iterator viit = vector_int_option.second.begin();
for (auto viit = vector_int_option.second.begin();
viit != vector_int_option.second.end(); viit++)
output << *viit << ";";
output << "];" << endl;
......@@ -241,7 +241,7 @@ OptionsList::writeOutput(ostream &output, const string &option_group) const
if (vector_str_option.second.size() > 1)
{
output << "{";
for (vector<string>::const_iterator viit = vector_str_option.second.begin();
for (auto viit = vector_str_option.second.begin();
viit != vector_str_option.second.end(); viit++)
output << "'" << *viit << "';";
output << "};" << endl;
......@@ -258,7 +258,7 @@ OptionsList::writeJsonOutput(ostream &output) const
return;
output << "\"options\": {";
for (num_options_t::const_iterator it = num_options.begin();
for (auto it = num_options.begin();
it != num_options.end();)
{
output << "\""<< it->first << "\": " << it->second;
......@@ -272,7 +272,7 @@ OptionsList::writeJsonOutput(ostream &output) const
output << ", ";
}
for (paired_num_options_t::const_iterator it = paired_num_options.begin();
for (auto it = paired_num_options.begin();
it != paired_num_options.end();)
{
output << "\""<< it->first << "\": [" << it->second.first << " " << it->second.second << "]";
......@@ -285,7 +285,7 @@ OptionsList::writeJsonOutput(ostream &output) const
output << ", ";
}
for (string_options_t::const_iterator it = string_options.begin();
for (auto it = string_options.begin();
it != string_options.end();)
{
output << "\""<< it->first << "\": \"" << it->second << "\"";
......@@ -297,7 +297,7 @@ OptionsList::writeJsonOutput(ostream &output) const
output << ", ";
}
for (date_options_t::const_iterator it = date_options.begin();
for (auto it = date_options.begin();
it != date_options.end();)
{
output << "\""<< it->first << "\": \"" << it->second << "\"";
......@@ -308,7 +308,7 @@ OptionsList::writeJsonOutput(ostream &output) const
output << ", ";
}
for (symbol_list_options_t::const_iterator it = symbol_list_options.begin();
for (auto it = symbol_list_options.begin();
it != symbol_list_options.end(); it++)
{
output << "\""<< it->first << "\":";
......@@ -319,13 +319,13 @@ OptionsList::writeJsonOutput(ostream &output) const
output << ", ";
}
for (vec_int_options_t::const_iterator it = vector_int_options.begin();
for (auto it = vector_int_options.begin();
it != vector_int_options.end();)
{
output << "\""<< it->first << "\": [";
if (it->second.size() > 1)
{
for (vector<int>::const_iterator viit = it->second.begin();