On Sun 14/11/10 00:04 , alfC alfredo.correa@gmail.com sent:
On Nov 13, 2:09 pm, Juan Antonio Farré Basurte <j...@tinet.org>
wrote:
> Hello,
>
> I'm using mt19937 random number generator, belonging to Boost.Random
> library, and it looks to ignore my call to seed.
> I show relevant code.
>
> static mt19937 gen;
> static MiniUni cien(1, 100);
> static variate_generator d100(gen, cien);
>
> .....
>
> int main() {
> {
> struct timeval time;
> gettimeofday(
> gen.seed(time.tv_usec);
> }
>
> ....
>
> And it generates the same sequence over and over. I've double-checked
> that time.tv_usec really changes.
> Any help would be appreciated.
> Thanks,
Try with a negative seed.
gen.seed( - time.tv_usec);
-- Alfredo
Mmmm... I'm afraid it didn't work...
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users">http://lists.boost.org/mailman/listinfo.cgi/boost-users