When looking for unused endos/exos, also search in equations marked [static]

pac-components
Sébastien Villemot 2021-12-06 16:30:38 +01:00
parent 8d4cab6fe3
commit fe974c4c31
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 4 additions and 0 deletions

View File

@ -4585,6 +4585,8 @@ DynamicModel::findUnusedEndogenous()
set<int> usedEndo, unusedEndo;
for (auto &equation : equations)
equation->collectVariables(SymbolType::endogenous, usedEndo);
for (auto &equation : static_only_equations)
equation->collectVariables(SymbolType::endogenous, usedEndo);
set<int> allEndo = symbol_table.getEndogenous();
set_difference(allEndo.begin(), allEndo.end(),
usedEndo.begin(), usedEndo.end(),
@ -4598,6 +4600,8 @@ DynamicModel::findUnusedExogenous()
set<int> usedExo, unusedExo, unobservedExo;
for (auto &equation : equations)
equation->collectVariables(SymbolType::exogenous, usedExo);
for (auto &equation : static_only_equations)
equation->collectVariables(SymbolType::exogenous, usedExo);
set<int> observedExo = symbol_table.getObservedExogenous();
set<int> allExo = symbol_table.getExogenous();
set_difference(allExo.begin(), allExo.end(),