RandomTT800.st
author Claus Gittinger <cg@exept.de>
Sat, 02 May 2020 21:40:13 +0200
changeset 5476 7355a4b11cb6
parent 5253 5e092489232f
permissions -rw-r--r--
#FEATURE by cg class: Socket class added: #newTCPclientToHost:port:domain:domainOrder:withTimeout: changed: #newTCPclientToHost:port:domain:withTimeout:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4321
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     1
"
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     2
    PLEASE READ THE FOLLOWING NOTICE AND DISCLAIMER CAREFULLY
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     3
    BEFORE DOWNLOADING THIS SOFTWARE.  BY DOWNLOADING THIS SOFTWARE
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     4
    YOU ARE AGREEING TO BE BOUND BY THESE TERMS.  IF YOU DO NOT AGREE
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     5
    TO THE TERMS, DO NOT DOWNLOAD.
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     6
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     7
    This software (Software), provided by IBM Corporation, may
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     8
    contain, or be derived from, code provided by Apple Computer,
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
     9
    Inc., and is provided subject to the provisions of the Apple
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    10
    Computer, Inc. Software License for the SQUEAK Smalltalk System
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    11
    which can be viewed at http://www.squeak.org/license.html. 
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    12
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    13
    This Software is provided AS IS, and IBM Corporation
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    14
    DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    15
    LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    16
    PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    17
    IBM DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    18
    WILL MEET THE USERS' REQUIREMENTS, THAT THE OPERATION OF THE
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    19
    SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    20
    IN THE SOFTWARE WILL BE CORRECTED.  UNDER NO CIRCUMSTANCES SHALL
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    21
    IBM CORPORATION BE LIABLE FOR INCIDENTAL, INDIRECT OR CONSEQUENTIAL
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    22
    DAMAGES ARISING FROM OR RELATING TO USE OF THIS SOFTWARE.  The
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    23
    user of this Software agrees to indemnify and hold IBM Corporation
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    24
    harmless from any and all damages, liabilities, costs and expenses
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    25
    (including attorney's fees) incurred by IBM Corporation as a
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    26
    result of any claim, proceeding or judgment to the extent it
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    27
    arises out of or is connected in any manner with the operation,
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    28
    use, distribution or modification of the Software, or the combination
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    29
    of the Software or modified Software with other programs.
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    30
"
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"{ Package: 'stx:libbasic2' }"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
4321
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    33
"{ NameSpace: Smalltalk }"
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    34
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
Object subclass:#RandomTT800
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
	instanceVariableNames:'k x mag01'
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
	classVariableNames:'M N'
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
	poolDictionaries:''
4589
6a6f26b00452 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 4321
diff changeset
    39
	category:'Magnitude-Numbers-Random'
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
RandomTT800 comment:'A pseudo-random number generator; see below for references.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
This generator is much slower than Squeak''s Random class.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
It automatically seeds itself based on the millisecond clock.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
Using the generator:
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        randy := RandomTT800 new.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        randy seed: anInteger. "optional; never use zero"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
        aRandom := randy next.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
Example (InspectIt):
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
        | r |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
        r := RandomTT800 new.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
        (1 to: 50) collect: [ :n | r next ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
===================================================================
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
Originally a C-program for TT800 : July 8th 1996 Version
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
by M. Matsumoto, email: matumoto@math.keio.ac.jp
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
Generates one pseudorandom number with double precision which is uniformly distributed on [0,1]-interval for each call.  One may choose any initial 25 seeds except all zeros.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
See: ACM Transactions on Modelling and Computer Simulation,
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
Vol. 4, No. 3, 1994, pages 254-266.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
ABSTRACT 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
The twisted GFSR generators proposed in a previous article have a defect in k-distribution for k larger than the order of recurrence. In this follow up article, we introduce and analyze a new TGFSR variant having better k-distribution property. We provide an efficient algorithm to obtain the order of equidistribution, together with a tight upper bound on the order. We discuss a method to search for generators attaining this bound, and we list some of these such generators. The upper bound turns out to be (sometimes far) less than the maximum order of equidistribution for a generator of that period length, but far more than that for a GFSR with a working are of the same size.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
Previous paper:
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
                
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
ACM Transactions on Modeling and Computer Simulation 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
Volume 2 , Issue 3 (1992) Pages 179-194 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
Twisted GFSR generators 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
Makoto Matsumoto, and Yoshiharu Kurita 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
ABSTRACT 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
The generalized feed back shift register (GFSR) algorithm suggested by Lewis and Payne is a widely used pseudorandom number generator, but has the following serious drawbacks: (1) an initialization scheme to assure higher order equidistribution is involved and is time consuming; (2) each bit of the
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
generated words constitutes an m-sequence based on a primitive trinomials, which shows poor randomness with respect to weight distribution; (3) a large working area is necessary; (4) the period of sequence is far shorter than the theoretical upper bound. This paper presents the twisted GFSR (TGFSR) algorithm, a slightly but essentially modified version of the GFSR, which solves all the above problems without loss of merit. Some practical TGFSR generators were implemented and passed strict empirical tests. These new generators are most suitable for simulation of a large distributive system, which requires a number of mutually independent pseudorandom number generators with compact size.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
'
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
!RandomTT800 class methodsFor:'documentation'!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
949
7cf579b6a2d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
    88
LICENSE
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
"
4321
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
    90
    see copyright
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
TT800OriginalCVersion
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
" From: http://random.mat.sbg.ac.at/ftp/pub/data/tt800.c 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
/* A C-program for TT800 : July 8th 1996 Version */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
/* by M. Matsumoto, email: matumoto@math.keio.ac.jp */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
/* genrand() generate one pseudorandom number with double precision */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
/* which is uniformly distributed on [0,1]-interval */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
/* for each call.  One may choose any initial 25 seeds */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
/* except all zeros. */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
/* See: ACM Transactions on Modelling and Computer Simulation, */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
/* Vol. 4, No. 3, 1994, pages 254-266. */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
/* ABSTRACT 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
The twisted GFSR generators proposed in a previous article have a defect in k-distribution for k larger than the order of recurrence. In this follow up article, we introduce and analyze a new TGFSR variant having better k-distribution property. We provide an efficient algorithm to obtain the order of equidistribution, together with a tight upper bound on the order. We discuss a method to search for generators attaining this bound, and we list some of these such generators. The upper bound turns out to be (sometimes far) less than the maximum order of equidistribution for a generator of that period length, but far more than that for a GFSR with a working are of the same size.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
*/
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
#include <stdio.h>
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
#define N 25
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
#define M 7
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
double
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
genrand()
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
{
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    unsigned long y;
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    static int k = 0;
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    static unsigned long x[N]={ /* initial 25 seeds, change as you wish */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
	0x95f24dab, 0x0b685215, 0xe76ccae7, 0xaf3ec239, 0x715fad23,
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
	0x24a590ad, 0x69e4b5ef, 0xbf456141, 0x96bc1b7b, 0xa7bdf825,
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
	0xc1de75b7, 0x8858a9c9, 0x2da87693, 0xb657f9dd, 0xffdc8a9f,
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
	0x8121da71, 0x8b823ecb, 0x885d05f5, 0x4e20cd47, 0x5a9ad5d9,
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
	0x512c0c03, 0xea857ccd, 0x4cc1d30f, 0x8891a8a1, 0xa6b7aadb
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    };
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    static unsigned long mag01[2]={ 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
        0x0, 0x8ebfd028 /* this is magic vector `a', don't change */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    };
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    if (k==N) { /* generate N words at one time */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
      int kk;
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
      for (kk=0;kk<N-M;kk++) {
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
	x[kk] = x[kk+M] ^ (x[kk] >> 1) ^ mag01[x[kk] % 2];
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
      }
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
      for (; kk<N;kk++) {
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
	x[kk] = x[kk+(M-N)] ^ (x[kk] >> 1) ^ mag01[x[kk] % 2];
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
      }
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
      k=0;
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    }
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    y = x[k];
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    y ^= (y << 7) & 0x2b5b2500; /* s and b, magic vectors */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    y ^= (y << 15) & 0xdb8b0000; /* t and c, magic vectors */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    y &= 0xffffffff; /* you may delete this line if word size = 32 */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
/* 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
   the following line was added by Makoto Matsumoto in the 1996 version
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
   to improve lower bit's corellation.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
   Delete this line to o use the code published in 1994.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
*/
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    y ^= (y >> 16); /* added to the 1994 version */
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    k++;
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    return( (double) y / (unsigned long) 0xffffffff);
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
}
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
4321
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   158
copyright
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   159
"
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   160
    PLEASE READ THE FOLLOWING NOTICE AND DISCLAIMER CAREFULLY
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   161
    BEFORE DOWNLOADING THIS SOFTWARE.  BY DOWNLOADING THIS SOFTWARE
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   162
    YOU ARE AGREEING TO BE BOUND BY THESE TERMS.  IF YOU DO NOT AGREE
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   163
    TO THE TERMS, DO NOT DOWNLOAD.
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   164
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   165
    This software (Software), provided by IBM Corporation, may
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   166
    contain, or be derived from, code provided by Apple Computer,
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   167
    Inc., and is provided subject to the provisions of the Apple
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   168
    Computer, Inc. Software License for the SQUEAK Smalltalk System
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   169
    which can be viewed at http://www.squeak.org/license.html. 
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   170
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   171
    This Software is provided AS IS, and IBM Corporation
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   172
    DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   173
    LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   174
    PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   175
    IBM DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE SOFTWARE
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   176
    WILL MEET THE USERS' REQUIREMENTS, THAT THE OPERATION OF THE
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   177
    SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   178
    IN THE SOFTWARE WILL BE CORRECTED.  UNDER NO CIRCUMSTANCES SHALL
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   179
    IBM CORPORATION BE LIABLE FOR INCIDENTAL, INDIRECT OR CONSEQUENTIAL
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   180
    DAMAGES ARISING FROM OR RELATING TO USE OF THIS SOFTWARE.  The
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   181
    user of this Software agrees to indemnify and hold IBM Corporation
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   182
    harmless from any and all damages, liabilities, costs and expenses
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   183
    (including attorney's fees) incurred by IBM Corporation as a
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   184
    result of any claim, proceeding or judgment to the extent it
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   185
    arises out of or is connected in any manner with the operation,
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   186
    use, distribution or modification of the Software, or the combination
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   187
    of the Software or modified Software with other programs.
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   188
"
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   189
!
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   190
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
documentation
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
"
3352
6263fe92efbf comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents: 3350
diff changeset
   193
    Warning: this generator should not be used for cryptographic work.
949
7cf579b6a2d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   194
3352
6263fe92efbf comment/format in: #documentation
Claus Gittinger <cg@exept.de>
parents: 3350
diff changeset
   195
    NO WARRANTY
3350
5e41f01f4dbb class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   196
949
7cf579b6a2d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   197
    Slightly adapted Squeak code for fileIn into ST/X.
7cf579b6a2d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   198
    The original comment was:
7cf579b6a2d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   199
7cf579b6a2d8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 946
diff changeset
   200
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    A pseudo-random number generator; see below for references.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    This generator is much slower than Squeak's Random class.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    It automatically seeds itself based on the millisecond clock.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    Using the generator:
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
            randy := RandomTT800 new.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
            randy seed: anInteger. 'optional; never use zero'
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
            aRandom := randy next.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
    Example (InspectIt):
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
            | r |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
            r := RandomTT800 new.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
            (1 to: 50) collect: [ :n | r next ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
    ===================================================================
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
    Originally a C-program for TT800 : July 8th 1996 Version
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
    by M. Matsumoto, email: matumoto@math.keio.ac.jp
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    Generates one pseudorandom number with double precision which is uniformly distributed 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
    on [0,1]-interval for each call.  One may choose any initial 25 seeds except all zeros.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    See: ACM Transactions on Modelling and Computer Simulation,
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
    Vol. 4, No. 3, 1994, pages 254-266.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    ABSTRACT 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    The twisted GFSR generators proposed in a previous article have a defect in k-distribution for k larger 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
    than the order of recurrence. 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
    In this follow up article, we introduce and analyze a new TGFSR variant having better k-distribution property. 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
    We provide an efficient algorithm to obtain the order of equidistribution, together with a tight upper bound 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
    on the order. 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    We discuss a method to search for generators attaining this bound, and we list some of these such generators. 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    The upper bound turns out to be (sometimes far) less than the maximum order of equidistribution for a generator 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    of that period length, but far more than that for a GFSR with a working are of the same size.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
    Previous paper:
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
    ACM Transactions on Modeling and Computer Simulation 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
    Volume 2 , Issue 3 (1992) Pages 179-194 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    Twisted GFSR generators 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    Makoto Matsumoto, and Yoshiharu Kurita 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    ABSTRACT 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
    The generalized feed back shift register (GFSR) algorithm suggested by Lewis and Payne is a widely used pseudorandom number generator, but has the following serious drawbacks: (1) an initialization scheme to assure higher order equidistribution is involved and is time consuming; (2) each bit of the
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
    generated words constitutes an m-sequence based on a primitive trinomials, which shows poor randomness with respect to weight distribution; (3) a large working area is necessary; (4) the period of sequence is far shorter than the theoretical upper bound. This paper presents the twisted GFSR (TGFSR) algorithm, a slightly but essentially modified version of the GFSR, which solves all the above problems without loss of merit. Some practical TGFSR generators were implemented and passed strict empirical tests. These new generators are most suitable for simulation of a large distributive system, which requires a number of mutually independent pseudorandom number generators with compact size.
998
5f66a2dd6b7d documentation
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   250
5f66a2dd6b7d documentation
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   251
    [see also:]
3392
2e2247b1dd41 documentation link
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
   252
        http://www0.cs.ucl.ac.uk/staff/d.jones/GoodPracticeRNG.pdf
3398
dbd427ec32dd documentation link
Claus Gittinger <cg@exept.de>
parents: 3392
diff changeset
   253
        RandomGenerator - the default; uses the machine's /dev/random if available
998
5f66a2dd6b7d documentation
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   254
        Random  - fast, but generates less quality random numbers
5f66a2dd6b7d documentation
Claus Gittinger <cg@exept.de>
parents: 949
diff changeset
   255
        RandomParkMiller - a good one (according to literature)
3392
2e2247b1dd41 documentation link
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
   256
        RandomMT19973 - a better one (according to literature)
2e2247b1dd41 documentation link
Claus Gittinger <cg@exept.de>
parents: 3385
diff changeset
   257
        RandomKISS - a fast, reasonably good one (according to literature)
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
examples
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
                                                                [exBegin]
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
    | r |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
    r := RandomTT800 new.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
    (1 to: 50) collect: [ :n | r next ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
                                                                [exEnd]
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
! !
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
!RandomTT800 class methodsFor:'initialization'!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
initialSeeds
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
 	" initial 25 seeds, change as you wish. (there must be N seeds) "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
	^ self originalSeeds
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
originalSeeds
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
    " original initial 25 seeds. DO NOT CHANGE "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
    ^ #(    16r95F24DAB  16r0B685215  16rE76CCAE7  16rAF3EC239  16r715FAD23
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
            16r24A590AD  16r69E4B5EF  16rBF456141  16r96BC1B7B  16rA7BDF825
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
            16rC1DE75B7  16r8858A9C9  16r2DA87693  16rB657F9DD  16rFFDC8A9F
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
            16r8121DA71  16r8B823ECB  16r885D05F5  16r4E20CD47  16r5A9AD5D9
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
            16r512C0C03  16rEA857CCD  16r4CC1D30F  16r8891A8A1  16rA6B7AADB ) copy
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
! !
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
!RandomTT800 class methodsFor:'instantiation'!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
new
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
	^ super new
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
		initialize
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
! !
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
!RandomTT800 class methodsFor:'testing'!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
bucketTest1
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
    " Answers an array with 50 elements each of which should hold an integer near the value 1000, 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
      the closer the better. "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
    " RandomTT800 bucketTest1 inspect "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
    | a r s k |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
    s := 50.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
    a := Array new: s.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
    a atAllPut: 0.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
    r := RandomTT800 new.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
    1 to: 50000 do: [ :n |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
            k := (r next * s) truncated + 1.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
            a at: k put: (a at: k) + 1 ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    ^ a
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
firstInteger: s
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
    " Answers an array with the first 's' raw integer elements generated by the RNG using the original seeds. 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
      Intended for testing only. "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
    " RandomTT800 firstInteger: 50 "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
    | a r |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
    a := Array new: s.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
    a atAllPut: 0.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
    r := RandomTT800 new.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    " set the original initial 25 seeds. "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
    r setSeeds: self originalSeeds.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
    1 to: s do: [ :n |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
            a at: n put: r nextInteger ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
    ^ a
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
theItsCompletelyBrokenTest
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
    " Test to see if generator is answering what it should. 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
      Assumes that the initial seeds are what is given in the original version. 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
      If this fails something is badly wrong; do not use this generator."
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
    " RandomTT800 theItsCompletelyBrokenTest "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
    | okResult |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
    okResult := #(
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
            16rBCF1F45A 16rA26BF07E 16r14AEFF49 16r6777A14E 16r880C242F 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
            16rECEF7842 16r3BD9352 16r1DD55C94 16r7BC39C7 16r75E78DC2 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
            16rF0CF8478 16rE2886F41 16rB63AC1A9 16r57858A58 16r16169989 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
            16rD8602211 16r31818D3 16r30D51520 16r1C61F026 16rB58FA81
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
            16r51AF5CAC 16r609D3850 16r278BF184 16r50C1F860 16rEE6F61B4 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
            16r33C2A07E 16r55EE93B7 16r40BD28C3 16r713DB4BE 16rDD9352E3 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
            16r9254D8B9 16r9C02EE00 16r5F1BB40C 16rF741D0A5 16r6EE25C13 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
            16r375DD95B 16rFB24339 16rF3E2C95A 16r8CAA8C6F 16r63858F2F 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
            16r70369B29 16r617E2292 16r357EC977 16rC0B7E080 16r16474ADA 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
            16rAFDF1588 16rA1502F9D 16rC4577788 16rE3A9893C 16r71662621 ).
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
    (self firstInteger: 50) = okResult ifFalse: [
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
            PopUpMenu notify: 'First 50 results do not match the expected results.' ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
    (self firstInteger: 1001) last = 16rD7B4E10B ifFalse: [
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
            PopUpMenu notify: 'Element 1001 does not match the expected result.' ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
    PopUpMenu notify: 'The expected results were obtained.'
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
! !
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
3415
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   363
!RandomTT800 methodsFor:'initialization'!
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   364
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   365
initialize
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   366
    N := 25.
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   367
    M := 7.
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   368
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   369
    k := 0.
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   370
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   371
    "x := self class initialSeeds.  (Done in #seed:) "
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   372
    self seed: (Random randomSeed bitAnd:16rFFFFFFFF).
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   373
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   374
    " this is magic vector `a', don't change "
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   375
    mag01 := #( 16r0 16r8EBFD028 ). 
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   376
!
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   377
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   378
seed: anInteger
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   379
    x := self class initialSeeds.
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   380
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   381
    1 to: x size do: [ :n |
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   382
            x at: n put: ((x at: n) bitXor: anInteger) ].
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   383
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   384
    k := 0.
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   385
!
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   386
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   387
setSeeds: anArray
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   388
    " Used only by class methods for testing. "
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   389
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   390
    anArray size = x size ifTrue: [
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   391
            x := anArray ]
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   392
! !
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   393
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   394
!RandomTT800 methodsFor:'random numbers'!
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
3337
c4e5a66cad48 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   396
nextBoolean
c4e5a66cad48 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   397
    " Answer the next boolean"
c4e5a66cad48 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   398
c4e5a66cad48 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   399
    ^ self nextInteger > 16r7FFFFFFF
c4e5a66cad48 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   400
!
c4e5a66cad48 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   401
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
nextInteger
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
    " Answer the next random number in its raw integer form "
3415
ca707bcf23c8 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3398
diff changeset
   404
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
    | y kk jLast |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
    " generate N words at one time "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
    k = N ifTrue: [
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
            "for (kk=0;kk<N-M;kk++) {"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
            0 to: N-M-1 by: 1 do: [ :j |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
                    jLast := j.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
                    kk := j+1.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
                    "x[kk] = x[kk+M] ^ (x[kk] >> 1) ^ mag01[x[kk] % 2];"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
                    x at: kk put: 
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
                            ( ((x at: kk+M) bitXor: (x at: kk) >> 1)
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
                                    bitXor: (mag01 at: (x at: kk) \\ 2 + 1) )
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
            ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
            "for (; kk<N;kk++) { "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
            jLast+1 to: N-1 by: 1 do: [ :j |
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
                    kk := j+1.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
                    "x[kk] = x[kk+(M-N)] ^ (x[kk] >> 1) ^ mag01[x[kk] % 2];"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
                    x at: kk put:
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
                            ( ((x at: kk+M-N) bitXor: (x at: kk) >> 1)
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
                                    bitXor: (mag01 at: (x at: kk) \\ 2 + 1) )
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
                    ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
            k := 0.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
            ].
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   428
    y := x at: k+1.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   429
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
    "y ^= (y << 7) & 0x2b5b2500; /* s and b, magic vectors */"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
    y := y bitXor: ((y << 7) bitAnd: 16r2B5B2500). " s and b, magic vectors "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
    y := y bitAnd: 16rFFFFFFFF.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
    "y ^= (y << 15) & 0xdb8b0000; /* t and c, magic vectors */"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
    y := y bitXor: ((y << 15) bitAnd: 16rDB8B0000). " t and c, magic vectors "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
    y := y bitAnd: 16rFFFFFFFF. " you may delete this line if word size = 32 "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
    "The following line was added by Makoto Matsumoto in the 1996 version
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
    to improve lower bit's corellation.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
    Delete this line to o use the code published in 1994. "
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
    y := y bitXor: y >> 16. "added to the 1994 version"
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
    k := k + 1.
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
    ^ y
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
! !
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
5253
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   448
!RandomTT800 methodsFor:'reading'!
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   449
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   450
next
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   451
    " Answer the next random number as a float in the range [0.0,1.0) "
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   452
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   453
    ^ self nextInteger asFloat / 4.29496729500000e9  "16rFFFFFFFF asFloat"
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   454
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   455
    " Note that: 4.29496729500000e9 asTrueFraction hex 
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   456
      is: '16rFFFFFFFF' "
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   457
! !
5e092489232f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 4589
diff changeset
   458
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
!RandomTT800 class methodsFor:'documentation'!
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
version
4321
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   462
    ^ '$Header$'
3350
5e41f01f4dbb class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   463
!
5e41f01f4dbb class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   464
5e41f01f4dbb class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 3337
diff changeset
   465
version_CVS
4321
adfa19e74a4a #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3415
diff changeset
   466
    ^ '$Header$'
946
3ffec3103f5c initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
! !
3337
c4e5a66cad48 class: RandomTT800
Claus Gittinger <cg@exept.de>
parents: 998
diff changeset
   468