Allow multiple estimated_params statements

pac-components
Sébastien Villemot 2021-12-14 17:46:02 +01:00
parent 2d07186b8b
commit 60ef6bbdbd
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 9 additions and 5 deletions

View File

@ -1361,11 +1361,15 @@ EstimatedParamsStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
void
EstimatedParamsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
{
output << "estim_params_.var_exo = zeros(0, 10);" << endl
<< "estim_params_.var_endo = zeros(0, 10);" << endl
<< "estim_params_.corrx = zeros(0, 11);" << endl
<< "estim_params_.corrn = zeros(0, 11);" << endl
<< "estim_params_.param_vals = zeros(0, 10);" << endl;
/* Multiple estimated_params statements are allowed, so make sure we dont
overwrite previous ones. */
output << "if isempty(estim_params_)" << endl
<< " estim_params_.var_exo = zeros(0, 10);" << endl
<< " estim_params_.var_endo = zeros(0, 10);" << endl
<< " estim_params_.corrx = zeros(0, 11);" << endl
<< " estim_params_.corrn = zeros(0, 11);" << endl
<< " estim_params_.param_vals = zeros(0, 10);" << endl
<< "end" << endl;
for (const auto &it : estim_params_list)
{