From cf146ec4e50b83bb17f6890b936d8d89e7ef6664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Mon, 22 Apr 2013 16:31:52 +0200 Subject: [PATCH] Reset oo_.{exo_}steady_state to zero before endval This is necessary to enforce the documented behavior which says that, if a variable is not given a value in the endval block, a zero value is assumed. --- preprocessor/NumericalInitialization.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/preprocessor/NumericalInitialization.cc b/preprocessor/NumericalInitialization.cc index 1c26d74f55..3b74bf32de 100644 --- a/preprocessor/NumericalInitialization.cc +++ b/preprocessor/NumericalInitialization.cc @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2012 Dynare Team + * Copyright (C) 2003-2013 Dynare Team * * This file is part of Dynare. * @@ -245,7 +245,9 @@ EndValStatement::writeOutput(ostream &output, const string &basename) const << "%" << endl; // Writing endval block to set terminal values for variables output << "ys0_= oo_.steady_state;" << endl - << "ex0_ = oo_.exo_steady_state;" << endl; + << "ex0_ = oo_.exo_steady_state;" << endl + << "oo_.steady_state = zeros(size(ys0_));" << endl + << "oo_.exo_steady_state = zeros(size(ex0_));" << endl; writeInitValues(output); } -- GitLab