[scilab-Users] generators for grand

michael.baudin at scilab.org michael.baudin at scilab.org
Sun Dec 5 11:47:03 CET 2010


 The fsultra.c source code is there :

 http://gitweb.scilab.org/?p=scilab.git;a=blob;f=scilab/modules/randlib/src/c/fsultra.c;h=9f4ee42ee889bab842f4c17919e01a47bf5af12a;hb=HEAD

 Could it be a portability issue for "unsigned long" or "long" integers 
 on 64 bits machines?
 I'll test this tomorrow.

 Best regards,

 Michaël Baudin

 PS
 This is clcg2 / clcg4 :
 http://gitweb.scilab.org/?p=scilab.git;a=blob;f=scilab/modules/randlib/src/c/clcg2.c;h=2effae97e31ad57364d13353ad767cd706257566;hb=HEAD
 http://gitweb.scilab.org/?p=scilab.git;a=blob;f=scilab/modules/randlib/src/c/clcg4.c;h=cbd8d1623053985481de546a59652e6b94f96fe5;hb=HEAD

 On Sun, 05 Dec 2010 11:29:37 +0100, <michael.baudin at scilab.org> wrote:
> Hi,
>
> Your report is that, on your machine:
>  * mt, urand, kiss : work
>  * fsultra, clcg2, clcg4 : fail
> It may happen that there is a bad portability of the source code of
> these generators on 64 bits systems.
>
> I am not exactly sure of what you are testing, because you mix the
> set and get of the seed, with various commands to draw numbers from
> the exponential law and the multinomial distribution: that's a total
> of 10 different functions... What we need to help you is the simplest
> sequence of statements which fails.
>
> For example, on my Scilab (Windows), the following script entirely 
> pass:
>
> for rngen = [ "mt", "kiss", "clcg2", "clcg4", "urand", "fsultra" ]
>   mprintf("rngen:%s\n",rngen);
>   grand ( "setgen" , rngen );
>   r = grand(1,1,"exp",1);
>   m = grand(1,"mul",10,[0.2;0.5]);
> end
>
> Does it work on your machine ?
> Does the following work (after a restart of Scilab):
>
>   grand ( "setgen" , "fsultra" );
>   m = grand(1,"mul",10,[0.2;0.5]);
>
> Best regards,
>
> Michaël Baudin
>
>
>
> On Sat, 04 Dec 2010 17:51:25 +0100, Daniele Andreucci
> <andreucci at dmmm.uniroma1.it> wrote:
>> Hi!
>>
>> I have problems with using the procedure "grand" in my Linux Debian
>> Squeeze-amd64 installation. These problem do not show up in a Debian
>> Squeeze i386 (that is 32 bit) system (in a different PC).
>>
>> Essentially, grand does not seem to work with the generator 
>> "fsultra",
>> while it works with "mt" (I did not test well the other generators, 
>> but
>> a one-shot trial seems to indicate that kiss and urand are also not
>> working, while clcg2/4 do work).
>>
>> I report below what I obtain with Scilab 5.2.2 (standard Debian
>> package), but the same happens with a just installed Scilab 
>> 5.3.0-beta5
>> (64 bit), anyway.
>>
>> I can't find any relevant help searching the list for "grand"; am I
>> mistaken on the use of generators?
>>
>> Thanks a lot for any help.
>>
>> Daniele
>>
>> **** Scilab output:
>>
>> -->grand("setgen","mt")
>>  ans  =
>>
>>  mt
>>
>> -->grand(1,1,"exp",1)
>>  ans  =
>>
>>     0.6700172
>>
>> -->grand(1,"mul",10,[0.2;0.5])
>>  ans  =
>>
>>     1.
>>     3.
>>     6.
>>
>> -->grand("setgen","fsultra")
>>  ans  =
>>
>>  fsultra
>>
>> -->grand(1,1,"exp",1)
>>  ans  =
>>
>>     31399633.
>>
>>
>> -->grand("getsd")
>>  ans  =
>>
>>     20.
>>     1.
>>     9.915D+17
>>     1.845D+19
>>     1.845D+19
>>     4.130D+09
>>     1.845D+19
>>     1.845D+19
>>     1.845D+19
>>     1.845D+19
>>     2.026D+09
>>     6.134D+09
>>     1.845D+19
>>     3.569D+09
>>     2.550D+09
>>     2.170D+09
>> [Continue display? n (no) to stop, any other key to continue]
>>
>> ->grand("setsd",123456,987654)
>>
>> -->grand("getsd")
>>  ans  =
>>
>>     0.
>>     0.
>>     2.513D+18
>>     1.845D+19
>>     4.782D+08
>>     3.907D+08
>>     1.845D+19
>>     3.132D+08
>>     1.925D+09
>>     1.845D+19
>>     1.845D+19
>>     1.663D+08
>>     2.602D+09
>>     1.845D+19
>>     1.845D+19
>>     1.845D+19
>>
>> -->grand(1,1,"exp",1)
>>  ans  =
>>
>>     40105477.
>>
>>
>> -->grand(1,"mul",10,[0.2;0.5])
>> [Scilab is stuck, and I have to xkill it]
>>
>> ***** end of Scilab output




More information about the users mailing list