fixing bugs in random generator handling code

time-shift
Michel Juillard 2012-08-29 22:12:50 +02:00
parent 378413ed14
commit f77b101d7b
2 changed files with 3 additions and 2 deletions

View File

@ -135,7 +135,8 @@ jloop=0;
JSUM = 0;
for b = fblck:nblck,
jloop=jloop+1;
set_dynare_seed(options_.DynareRandomStreams.seed+b);
set_dynare_random_generator_state(record.Seeds(b).Unifor, ...
record.Seeds(b).Normal);
if (options_.load_mh_file~=0) && (fline(b)>1) && OpenOldFile(b)
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...
'_blck' int2str(b) '.mat'])

View File

@ -46,7 +46,7 @@ function [state_u,state_n] = get_dynare_random_generator_state(state_u,state_n)
'don''t understand the origin of the problem, ' ...
'please, contact Dynare''s development team.'])
end
s_new = RandStream(s.type,'State',state_u);
s.State = state_u;
if matlab_ver_less_than('7.12')
RandStream.setDefaultStream(s);
else