On Feb 14, 2008, at 8:44 PM, Carl Witty wrote:

[...]

>   randstate_python()
>     Returns an instance of random.Random.  The first time it is called
>     on a given instance of randgen, a new random.Random is created and
>     seeded from the gmp_randstate_t; this is saved, and subsequent
> calls
>     return the same random.Random instance.
>   ... There will be similar methods for every subsystem of the first
> kind
>   (with separate random state objects) (if there are any more, other
> than
>   Python).
>
>   set_seed_libc(force=False)
>   set_seed_ntl(force=False)
>   set_seed_pari(force=False)
>   set_seed_magma(force=False)
>   set_seed_mathematica(force=False)
>   set_seed_...()
>     Sets the seed of the specified random number generator, from a new
>     random number from the gmp_randstate_t.
>
>     Whenever library code is about to use a generator, it should call
>     the corresponding method.

Rather than requiring library code to call these functions, I think  
all relevant seeds/states should be set on creation/reseeding of a  
randgen object. Then library code can operate under the assumption  
that the needed random states are initialized and ready to be used at  
any time. For interfaces, it would just store the random seed to be  
retrieved when the interface starts up if an interface is not yet  
running.

That being said, I think this is a good proposal.

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to