Minor simplification using if with initialization
parent
62c455ff56
commit
ae83974e0e
|
@ -2109,13 +2109,11 @@ DynamicModel::computingPass(int derivsOrder, int paramsDerivsOrder, const eval_c
|
||||||
|
|
||||||
// Compute derivatives w.r. to all endogenous, exogenous and exogenous deterministic
|
// Compute derivatives w.r. to all endogenous, exogenous and exogenous deterministic
|
||||||
set<int> vars;
|
set<int> vars;
|
||||||
for (auto &it : deriv_id_table)
|
for (auto &[symb_lag, deriv_id] : deriv_id_table)
|
||||||
{
|
if (SymbolType type = symbol_table.getType(symb_lag.first);
|
||||||
SymbolType type = symbol_table.getType(it.first.first);
|
type == SymbolType::endogenous || type == SymbolType::exogenous
|
||||||
if (type == SymbolType::endogenous || type == SymbolType::exogenous
|
|
||||||
|| type == SymbolType::exogenousDet)
|
|| type == SymbolType::exogenousDet)
|
||||||
vars.insert(it.second);
|
vars.insert(deriv_id);
|
||||||
}
|
|
||||||
|
|
||||||
// Launch computations
|
// Launch computations
|
||||||
cout << "Computing " << modelClassName() << " derivatives (order " << derivsOrder << ")." << endl;
|
cout << "Computing " << modelClassName() << " derivatives (order " << derivsOrder << ")." << endl;
|
||||||
|
|
Loading…
Reference in New Issue