Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] reset of the random number generator in the sorted_erdos_renyi_iterator
From: Marti Cuquet (cuquet_at_[hidden])
Date: 2009-10-09 06:08:29


Jeremiah Willcock wrote:
> On Thu, 8 Oct 2009, Marti Cuquet wrote:
>
>> Hi,
>>
>> I noticed that when generating several graphs with the
>> sorted_erdos_renyi_iterator with the same random generator all of them
>> happen to be the same. Looking at erdos_renyi_generator.hpp I see that
>> there is a reset in the generator.
>>
>> This does not happens in the normal (unsorted) erdos_renyi_iterator
>> since the generator is passed by reference in the constructor.
>>
>> I'm still not confortable with the BGL and the random libraries, but I
>> might say that it is better to pass the random generator by reference.
>> Is there a special reason for not doing so?
>
> The generator needs to be wrapped in the constructor (even though it is
> passed by reference) in order to get a uniform_01 interface from it.
> Please check r56651 to see if it addresses your issue; I changed the
> construction of the wrapper to use a pointer to the generator instead.
> Thank you for noticing this issue.

Yes, this solves the problem. Thank you.

Marti Cuquet


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net