From f63ce0185959ebcc9647902ffb1fce3ec21ecdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= <stephane.adjemian@univ-lemans.fr> Date: Sat, 21 Jan 2012 14:13:31 +0100 Subject: [PATCH] Put debug and memory modes in options_.ep. --- matlab/ep/extended_path.m | 14 ++++++-------- matlab/global_initialization.m | 4 ++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/matlab/ep/extended_path.m b/matlab/ep/extended_path.m index 92f5623f43..f7035080e5 100644 --- a/matlab/ep/extended_path.m +++ b/matlab/ep/extended_path.m @@ -31,11 +31,9 @@ function time_series = extended_path(initial_conditions,sample_size) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see <http://www.gnu.org/licenses/>. global M_ options_ oo_ - -memory = 0; -debug = 0; + options_.verbosity = options_.ep.verbosity; -verbosity = options_.ep.verbosity+debug; +verbosity = options_.ep.verbosity+options_.ep.debug; % Test if bytecode and block options are used (these options are mandatory) if ~( options_.bytecode && options_.block ) @@ -159,7 +157,7 @@ t = 0; hh = dyn_waitbar(0,'Please wait. Extended Path simulations...'); set(hh,'Name','EP simulations.'); -if memory +if options_.ep.memory mArray1 = zeros(M_.endo_nbr,100,nnn,sample_size); mArray2 = zeros(M_.exo_nbr,100,nnn,sample_size); end @@ -308,7 +306,7 @@ while (t<sample_size) oo_.endo_simul = tmp; end % Save results of the perfect foresight model solver. - if memory + if options_.ep.memory mArray1(:,:,s,t) = oo_.endo_simul(:,1:100); mArrat2(:,:,s,t) = transpose(oo_.exo_simul(1:100,:)); end @@ -327,6 +325,6 @@ dyn_waitbar_close(hh); oo_.endo_simul = oo_.steady_state; -if memory - save([M_.fname '_memory'],'mArray1','mArray2','www'); +if options_.ep.memory + save([M_.fname '_options_.ep.memory'],'mArray1','mArray2','www'); end \ No newline at end of file diff --git a/matlab/global_initialization.m b/matlab/global_initialization.m index a11067a770..544902faa1 100644 --- a/matlab/global_initialization.m +++ b/matlab/global_initialization.m @@ -109,6 +109,10 @@ options_.SpectralDensity = 0; % Extended path options % +% Set debug flag +ep.debug = 0; +% Set memory flag +ep.memory = 0; % Set verbose mode ep.verbosity = 0; % Initialization of the perfect foresight equilibrium paths -- GitLab