comparison src/DLD-FUNCTIONS/rand.cc @ 11662:a4d0680f4dda release-3-0-x

save state separately for each MT random number generator
author John W. Eaton <jwe@octave.org>
date Tue, 26 Feb 2008 05:30:39 -0500
parents 9bc096bc59d4
children 72830070a17b
comparison
equal deleted inserted replaced
11661:ef2b2df1ed9a 11662:a4d0680f4dda
111 { 111 {
112 retval = octave_rand::seed (); 112 retval = octave_rand::seed ();
113 } 113 }
114 else if (s_arg == "state" || s_arg == "twister") 114 else if (s_arg == "state" || s_arg == "twister")
115 { 115 {
116 retval = octave_rand::state (); 116 retval = octave_rand::state (fcn);
117 } 117 }
118 else if (s_arg == "uniform") 118 else if (s_arg == "uniform")
119 { 119 {
120 octave_rand::uniform_distribution (); 120 octave_rand::uniform_distribution ();
121 } 121 }
248 { 248 {
249 ColumnVector s = 249 ColumnVector s =
250 ColumnVector (args(idx+1).vector_value(false, true)); 250 ColumnVector (args(idx+1).vector_value(false, true));
251 251
252 if (! error_state) 252 if (! error_state)
253 octave_rand::state (s); 253 octave_rand::state (s, fcn);
254 } 254 }
255 else 255 else
256 error ("%s: unrecognized string argument", fcn); 256 error ("%s: unrecognized string argument", fcn);
257 } 257 }
258 else 258 else