diff --git a/DynamicModel.cc b/DynamicModel.cc index 1c9a2db7..ba5764c4 100644 --- a/DynamicModel.cc +++ b/DynamicModel.cc @@ -2929,20 +2929,17 @@ DynamicModel::writeOutput(ostream &output, const string &basename, bool block_de // Write number of non-zero derivatives // Use -1 if the derivatives have not been computed - output << "M_.NNZDerivatives = zeros(3, 1);" << endl - << "M_.NNZDerivatives(1) = " << NNZDerivatives[0] << ";" << endl; + output << "M_.NNZDerivatives = [" << NNZDerivatives[0] << "; "; if (order > 1) - { - output << "M_.NNZDerivatives(2) = " << NNZDerivatives[1] << ";" << endl; - if (order > 2) - output << "M_.NNZDerivatives(3) = " << NNZDerivatives[2] << ";" << endl; - else - output << "M_.NNZDerivatives(3) = -1;" << endl; - } + output << NNZDerivatives[1] << "; "; else - output << "M_.NNZDerivatives(2) = -1;" << endl - << "M_.NNZDerivatives(3) = -1;" << endl; + output << "-1; "; + if (order > 2) + output << NNZDerivatives[2]; + else + output << "-1"; + output << "];" << endl; } map >, expr_t> diff --git a/NumericalInitialization.cc b/NumericalInitialization.cc index 85055905..f8491d8b 100644 --- a/NumericalInitialization.cc +++ b/NumericalInitialization.cc @@ -274,7 +274,7 @@ HistValStatement::writeOutput(ostream &output, const string &basename, bool mini output << "%" << endl << "% HISTVAL instructions" << endl << "%" << endl - << "M_.endo_histval = zeros(M_.endo_nbr,M_.maximum_endo_lag);" << endl; + << "M_.endo_histval = zeros(M_.endo_nbr,M_.maximum_lag);" << endl; for (hist_values_t::const_iterator it = hist_values.begin(); it != hist_values.end(); it++) @@ -310,7 +310,7 @@ HistValStatement::writeOutput(ostream &output, const string &basename, bool mini int tsid = symbol_table.getTypeSpecificID(symb_id) + 1; if (type == eEndogenous) - output << "M_.endo_histval( " << tsid << ", M_.maximum_endo_lag + " << lag << ") = "; + output << "M_.endo_histval( " << tsid << ", M_.maximum_lag + " << lag << ") = "; else if (type == eExogenous) output << "oo_.exo_simul( M_.maximum_lag + " << lag << ", " << tsid << " ) = "; else if (type != eExogenousDet) diff --git a/SymbolTable.cc b/SymbolTable.cc index ff8a5bce..81350d3b 100644 --- a/SymbolTable.cc +++ b/SymbolTable.cc @@ -282,11 +282,9 @@ SymbolTable::writeOutput(ostream &output) const throw (NotYetFrozenException) int ic = 1; output << "options_.varobs = cell(1);" << endl; for (vector::const_iterator it = varobs.begin(); - it != varobs.end(); it++) - { - output << "options_.varobs(" << ic << ") = {'" << getName(*it) << "'};" << endl; - ic++; - } + it != varobs.end(); it++, ic++) + output << "options_.varobs(" << ic << ") = {'" << getName(*it) << "'};" << endl; + output << "options_.varobs_id = [ "; for (vector::const_iterator it = varobs.begin(); it != varobs.end(); it++)