ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/random.h
(Generate patch)

Comparing ray/src/common/random.h (file contents):
Revision 2.4 by greg, Tue Feb 13 11:32:17 1996 UTC vs.
Revision 2.7 by gwlarson, Sat Jan 9 09:15:48 1999 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1999 Silicon Graphics, Inc. */
2  
3 < /* SCCSid "$SunId$ LBL" */
3 > /* SCCSid "$SunId$ SGI" */
4  
5   /*
6   *  random.h - header file for random(3) and urand() function.
# Line 11 | Line 11
11   #ifdef  MSDOS
12  
13   #define random()        ((long)rand()<<16^(long)rand()<<6^(long)rand()>>4)
14 + #define srandom(s)      srand((unsigned)(s))
15  
16   #define frandom()       (rand()*(1./32768.))
17  
# Line 27 | Line 28 | extern long  lrand48();
28   extern double  drand48();
29  
30   #define  random()       lrand48()
31 + #define  srandom(s)     srand48((long)(s))
32   #define  frandom()      drand48()
33  
34   #endif
35   #endif
36  
37   #ifdef  MC
38 +
39   #define  urand(i)       frandom()
40 + #define  initurand(n)   (n)
41 +
42   #else
43 +
44 + extern unsigned short   *urperm;
45 + extern int      urmask, initurand();
46 +
47   #define  urand(i)       ((urperm[(i)&urmask]+frandom())/(urmask+1))
39 #endif
48  
49 < extern short  *urperm;
42 < extern int  urmask;
49 > #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines