[m-users.] Random supply, mdi and muo
Mark Brown
mark at mercurylang.org
Sun Aug 11 03:14:40 AEST 2019
Hi,
On Sat, Aug 10, 2019 at 7:01 PM emacstheviking <objitsu at gmail.com> wrote:
>
> I googled and foind one old posting from 200 about the "rnd" module which doesn't seem to be alive anymore, it's random.m now isn't it?
Perhaps you are thinking of extras/monte/rnd.m?
>
> I cannot find anything in the documentation about "mdi" and "muo"; I can see that it's some kind of safeguard against using the same random generator twice or something but I can't understand the code I am writing for lack of details!!!
>
> All I seek is
> (a) what is the intent of mdi/muo and
Just as you say; it is a safeguard against using the same supply. Note
that the predicates also have in/out modes, and you can just stick to
those if you wish.
> (b) how to use it correctly!
If you want to use the mdi/muo modes, you can change in/out to mdi/muo
in your own declarations wherever you are threading the random supply
around. (The drawback will be that these modes aren't well supported
by the rest of the library.) In any case, be sure to check that this
kind of RNG meets your needs.
Aside: there is another RNG implemented in extras/gator/tausworthe3.m
but this is broken, at least on 64-bit machines, since it ought to be
using 32-bit arithmetic. Now that Mercury has fixed sized integers,
this should be easy to fix...
Mark
More information about the users
mailing list