home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / fortran / 3579 < prev    next >
Encoding:
Internet Message Format  |  1992-09-15  |  6.2 KB

  1. Path: sparky!uunet!stanford.edu!bcm!lib!odin.mda.uth.tmc.edu
  2. From: bwb@odin.mda.uth.tmc.edu (Barry W. Brown)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Random Number Library Available (REPOST)
  5. Message-ID: <7340@lib.tmc.edu>
  6. Date: 16 Sep 1992 01:40:34 GMT
  7. Sender: usenet@lib.tmc.edu
  8. Organization: University of Texas M.D. Anderson Cancer Center
  9. Lines: 141
  10. Nntp-Posting-Host: odin.mda.uth.tmc.edu
  11. Originator: bwb@odin
  12.  
  13.  
  14.                       Fortran version of RANLIB
  15.  
  16.  
  17. RANLIB is a collection of  Fortran routines that provide generators of
  18. random numbers from a variety of distributions.  RANLIB uses published
  19. algorithms, where available  (literature citations are included in the
  20. documentation).
  21.  
  22. RANLIB  is  available  via  anonymous   FTP from  odin.mda.uth.tmc.edu
  23. (129.106.3.17).  It is
  24.                         /pub/unix/ranlib.f.tar.Z
  25.  
  26. RANLIB   is  also   available   by   electronic   mail (or  ftp)  from
  27. statlib@lib.stat.cmu.edu.   The  file 'ranlib'  contains   an expanded
  28. description of the package; the file, 'ranlib.shar' contains  the full
  29. code and documentation.  To obtain both,  send mail with the following
  30. two lines to statlib@lib.stat.cmu.edu.
  31.          send ranlib from general
  32.          send ranlib.shar from general
  33. Those who are unfamiliar with statlib might want to add a third line
  34. to obtain an introductory document.
  35.          send index
  36.  
  37.                     Summary of Ranlib Capabilities
  38.  
  39. The bottom level routines provide 32 virtual random number generators.
  40. Each generator can provide 1,048,576 blocks of numbers, and each block
  41. is of length 1,073,741,824.  Any generator can be set to the beginning
  42. or end  of the current  block or to  its starting value.  Packaging is
  43. provided   so  that  if  these capabilities  are not  needed, a single
  44. generator with period 2.3 X 10^18 is seen.
  45.  
  46. Using this base, routines are provided that return:
  47.     (1)  Beta random deviates
  48.     (2)  Chi-square random deviates
  49.     (3)  Exponential random deviates
  50.     (4)  F random deviates
  51.     (5)  Gamma random deviates
  52.     (6)  Multivariate normal random deviates (mean and covariance
  53.          matrix specified)
  54.     (7)  Noncentral chi-square random deviates
  55.     (8)  Noncentral F random deviates
  56.     (9)  Univariate normal random deviates
  57.     (10) Random permutations of an integer array
  58.     (11) Real uniform random deviates between specified limits
  59.     (12) Binomial random deviates
  60.     (13) Poisson random deviates
  61.     (14) Integer uniform deviates between specified limits
  62.     (15) Seeds for the random number generator calculated from a
  63.          character string
  64.  
  65.  
  66.                          C version of RANLIB
  67.  
  68. RANLIB is a Fortran library containing  random number generators for a
  69. number of statistical  distributions.  RANLIB.C   is a translation  of
  70. RANLIB into the C language.
  71.  
  72. Numerous individuals suggested that I use the f2c  converter from Bell
  73. Labs  to convert RANLIB to C.   In my opinion,  the  quality of the  C
  74. generated by   f2c is greatly   inferior  to  that generated  by   the
  75. commercial product, PROMULA.FORTRAN,  which was used.   Information on
  76. PROMULA.FORTRAN can be obtained from
  77.  
  78.                    PROMULA Development Corporation
  79.                     3620 N. High Street, Suite 301
  80.                          Columbus, Ohio 43214
  81.                             (614) 263-5454
  82.  
  83. RANLIB.C  was tested  using the xlc  compiler under AIX  3.1 on an IBM
  84. RS/6000.  The code  was  also examined  with lint  on the same system.
  85. The RANLIB test  programs were also  successfully run using   the  gcc
  86. compiler (see below) on a Solbourne.
  87.  
  88. RANLIB.C  can be  obtained by  anonymous  ftp to  odin.mda.uth.tmc.edu
  89. (129.106.3.17) where is is available as
  90.                         /pub/unix/ranlib.c.tar.Z
  91.  
  92. For  obvious   reasons, the   original   RANLIB  (in    Fortran)   has
  93. been renamed to
  94.                         /pub/unix/ranlib.f.tar.Z
  95. on the same machine.
  96.  
  97. I plan to submit RANLIB.C to statlib after users have given me any
  98. comments and I feel that it is fairly solid.
  99.  
  100.                                  CAVEAT
  101.  
  102. RANLIB.C is written in ANSI C and makes  heavy use of prototypes.   It
  103. will not compile under old style (KR) C compilers (such as the default
  104. Sun cc compiler). The decision to  distribute in ANSI C was  mine; the
  105. version of Promula that was used -- 2.0 --  writes  old style headers.
  106. Converting  RANLIB to old style  C is not  a totally trivial task; the
  107. type of many arguments to functions will have to be changed from float
  108. to double.  Also note that I don't changed all ints to longs.  This is
  109. a result of my being a Fortraner, a novice at C, and knowing  that the
  110. underlying generators require at least a 32 bit integer.
  111.  
  112. I don't recommend  conversion to  an obsolete C dialect.  Instead, get
  113. the Free  Software Foundation's excellent  ANSI  C  compiler,  gcc. It
  114. compiles KR C as well as  ANSI version that  runs on many varieties
  115. of Unix is available by anonymous ftp as
  116.                         /pub/gnu/gcc-1.40.tar.Z
  117. at prep.ai.mit.edu  (18.71.0.38).   A Vax version  is also  present on
  118. /pub/gnu.  The compilers  are also available  on tape.  Write the Free
  119. Software Foundation at:
  120.  
  121.                     Free Software Foundation, Inc.
  122.                        675 Massachusetts Avenue
  123.                          Cambridge, MA  02139
  124.                         Phone: (617) 876-3296
  125.  
  126. An MSDOS port of gcc, performed by DJ Delorie is also available by ftp.
  127.  
  128. File location:
  129.  
  130.     host:      grape.ecs.clarkson.edu
  131.     login:     ftp
  132.     password:  send your e-mail address
  133.     directory: ~ftp/pub/msdos/djgcc
  134.  
  135. File in .ZIP format - djgpp.zip - one 2.2M file, contains everything.
  136.  
  137.  
  138.  
  139.                                        Barry W. Brown
  140.                                        Department of Biomathematics, 
  141.                                             Box 237
  142.                                        University of Texas M. D.
  143.                                             Anderson Hospital
  144.                                        1515 Holcombe Blvd
  145.                                        Houston, TX 77030
  146.  
  147. bwb@odin.mda.uth.tmc.edu
  148. internet address is (129.106.3.17)
  149. -- 
  150.                                        Barry W. Brown
  151.                                        Department of Biomathematics, 
  152.                                             Box 237
  153.                                        University of Texas M. D.
  154.