diff --git a/matlab/global_initialization.m b/matlab/global_initialization.m index df423b8cf..c3e70fac4 100644 --- a/matlab/global_initialization.m +++ b/matlab/global_initialization.m @@ -11,7 +11,7 @@ function global_initialization() % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2015 Dynare Team +% Copyright (C) 2003-2016 Dynare Team % % This file is part of Dynare. % @@ -510,12 +510,12 @@ M_.Correlation_matrix = []; M_.Correlation_matrix_ME = []; M_.parameter_used_with_lead_lag = false; -M_.xref1.params = {}; +M_.xref1.param = {}; M_.xref1.endo = {}; M_.xref1.exo = {}; M_.xref1.exo_det = {}; -M_.xref2.params = {}; +M_.xref2.param = {}; M_.xref2.endo = {}; M_.xref2.exo = {}; M_.xref2.exo_det = {}; diff --git a/preprocessor/ModelTree.cc b/preprocessor/ModelTree.cc index 52830bba3..72aa04889 100644 --- a/preprocessor/ModelTree.cc +++ b/preprocessor/ModelTree.cc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2015 Dynare Team + * Copyright (C) 2003-2016 Dynare Team * * This file is part of Dynare. * @@ -269,28 +269,37 @@ ModelTree::computeRevXref(map > &xrefset, const set &eiref, i void ModelTree::writeXrefs(ostream &output) const { + output << "M_.xref1.param = cell(1, M_.eq_nbr);" << endl + << "M_.xref1.endo = cell(1, M_.eq_nbr);" << endl + << "M_.xref1.exo = cell(1, M_.eq_nbr);" << endl + << "M_.xref1.exo_det = cell(1, M_.eq_nbr);" << endl + << "M_.xref2.param = cell(1, M_.eq_nbr);" << endl + << "M_.xref2.endo = cell(1, M_.eq_nbr);" << endl + << "M_.xref2.exo = cell(1, M_.eq_nbr);" << endl + << "M_.xref2.exo_det = cell(1, M_.eq_nbr);" << endl; + int i = 1; for (map::const_iterator it = xrefs.begin(); - it != xrefs.end(); it++) + it != xrefs.end(); it++, i++) { - output << "M_.xref1.params{end+1} = [ "; + output << "M_.xref1.param{" << i << "} = [ "; for (set::const_iterator it1 = it->second.param.begin(); it1 != it->second.param.end(); it1++) output << symbol_table.getTypeSpecificID(*it1) + 1 << " "; output << "];" << endl; - output << "M_.xref1.endo{end+1} = [ "; + output << "M_.xref1.endo{" << i << "} = [ "; for (set::const_iterator it1 = it->second.endo.begin(); it1 != it->second.endo.end(); it1++) output << symbol_table.getTypeSpecificID(*it1) + 1 << " "; output << "];" << endl; - output << "M_.xref1.exo{end+1} = [ "; + output << "M_.xref1.exo{" << i << "} = [ "; for (set::const_iterator it1 = it->second.exo.begin(); it1 != it->second.exo.end(); it1++) output << symbol_table.getTypeSpecificID(*it1) + 1 << " "; output << "];" << endl; - output << "M_.xref1.exo_det{end+1} = [ "; + output << "M_.xref1.exo_det{" << i << "} = [ "; for (set::const_iterator it1 = it->second.exo_det.begin(); it1 != it->second.exo_det.end(); it1++) output << symbol_table.getTypeSpecificID(*it1) + 1 << " ";