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

(cherry picked from commit fe974c4c31)
5.x
Sébastien Villemot 2021-12-06 16:30:38 +01:00
parent cac24dad7e
commit f257b96060
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 4 additions and 0 deletions

View File

@ -4923,6 +4923,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(),
@ -4936,6 +4938,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(),