RandomBlumBlumShub.st
changeset 5449 2d0307116c52
parent 4596 1dabbb7b319d
equal deleted inserted replaced
5448:a2bd67c9fc67 5449:2d0307116c52
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2014 Claus Gittinger
     4  COPYRIGHT (c) 2014 Claus Gittinger
     3               All Rights Reserved
     5               All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
    60 ! !
    62 ! !
    61 
    63 
    62 !RandomBlumBlumShub class methodsFor:'instance creation'!
    64 !RandomBlumBlumShub class methodsFor:'instance creation'!
    63 
    65 
    64 new
    66 new
    65     ^ self basicNew 
    67     ^ self new:(Random randomSeed)
    66         initialize;
       
    67         seed:(Random randomSeed)
       
    68 !
    68 !
    69 
    69 
    70 new:seed
    70 new:seed
    71     self isSupported ifFalse:[ self error:'this generator needs a cpu with rdgen instruction' ].
    71     ^ self basicNew initialize; seed:seed
    72     ^ self basicNew 
       
    73         initialize;
       
    74         seed:seed
       
    75 ! !
    72 ! !
    76 
    73 
    77 !RandomBlumBlumShub methodsFor:'initialization'!
    74 !RandomBlumBlumShub methodsFor:'initialization'!
    78 
    75 
    79 initialize
    76 initialize