On 12 August 2010 04:34, Geoffrey Hutchison <[email protected]> wrote:
>> I've always wondered why OBRandom exists -- I would assume that the
>> built in standard random number generators would be decent on each
>> platform?
>
> No, that's not true. In fact, the BSD and Mac "man" pages for rand() say:
> "-- bad random number generator"
>
>> Is it common to rewrite random number generators? Perhaps we
>> should take a look at the common implementations with the same test
>> and then just use stdlib if they're ok.
>
> OBRandom allows you to use the system random number generator if you wish, 
> and if available, will use the "sranddev" function available on some 
> platforms which pulls from the hardware random generator.
>
> Feel free to re-implement OBRandom if you want -- there are a number of 
> methods which are improved on this one from 1998.
>
> -Geoff

In relation to OBRandom and conformer search, I just want to point out
that I've just implemented a random number generator that iterates
over 1...N in a deterministic systematic random way (google LFSR). I'm
using this to avoid bias when iterating exhaustively over conformers.
Note that a PRNG operates differently - it could give you the same
number twice. Maybe the LFSR would be more appropriate for the random
conformer search - after all, there's no benefit testing the same
conformer twice.

If interested, I'll make one change to the class (before someone pulls
it from my github!) and send it around. It can handle sequences of
integers to 2^31 -1 long, and has no memory overhead.

Just to be clear, this would not be a replacement for OBRandom. It
doesn't do the same thing.

- Noel

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to