Commit f77b101d authored by MichelJuillard's avatar MichelJuillard
Browse files

fixing bugs in random generator handling code

parent 378413ed
......@@ -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'])
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment