Forbid exogenous and exogenous deterministic variables in STEADY_STATE operator

Closes: dynare#825
issue#70
Sébastien Villemot 2019-11-27 17:26:16 +01:00
parent 61ea8811de
commit d008113d69
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 9 additions and 0 deletions

View File

@ -2902,6 +2902,15 @@ ParsingDriver::add_erf(expr_t arg1)
expr_t
ParsingDriver::add_steady_state(expr_t arg1)
{
// Forbid exogenous variables, see dynare#825
set<int> r;
arg1->collectVariables(SymbolType::exogenous, r);
if (r.size() > 0)
error("Exogenous variables are not allowed in the context of the STEADY_STATE() operator.");
arg1->collectVariables(SymbolType::exogenousDet, r);
if (r.size() > 0)
error("Exogenous deterministic variables are not allowed in the context of the STEADY_STATE() operator.");
return data_tree->AddSteadyState(arg1);
}