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.3 by greg, Thu Jun 9 16:40:53 1994 UTC vs.
Revision 2.9 by greg, Tue Feb 25 02:47:21 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   *  random.h - header file for random(3) and urand() function.
7 *
8 *     10/1/85
4   */
5  
6 + #include "copyright.h"
7 +
8 + #ifdef  NORANDOM
9 +
10 + #undef  random
11 + #define  random()       1073741820
12 + #undef  srandom
13 + #define  srandom(s)     (s)
14 + #define  frandom()      0.5
15 + #define  urand(i)       0.5
16 + #define  initurand(n)   (n)
17 +
18 + #else
19 +
20   #ifdef  MSDOS
21  
22   #define random()        ((long)rand()<<16^(long)rand()<<6^(long)rand()>>4)
23 + #define srandom(s)      srand((unsigned)(s))
24  
25   #define frandom()       (rand()*(1./32768.))
26  
# Line 27 | Line 37 | extern long  lrand48();
37   extern double  drand48();
38  
39   #define  random()       lrand48()
40 + #define  srandom(s)     srand48((long)(s))
41   #define  frandom()      drand48()
42  
43   #endif
44   #endif
45  
46 + #ifdef  MC
47 +
48 + #define  urand(i)       frandom()
49 + #define  initurand(n)   (n)
50 +
51 + #else
52 +
53 + extern unsigned short   *urperm;
54 + extern int      urmask;
55 +
56   #define  urand(i)       ((urperm[(i)&urmask]+frandom())/(urmask+1))
57  
58 < extern short  *urperm;
59 < extern int  urmask;
58 > #endif
59 >
60 > #endif
61 >
62 > #ifdef NOPROTO
63 >
64 > extern int      initurand();
65 > extern int      ilhash();
66 > extern int      urind();
67 > extern void     multisamp();
68 >
69 > #else
70 >                                /* defined in urand.c */
71 > extern int      initurand(int size);
72 > extern int      ilhash(int *d, int n);
73 >                                /* defined in urind.c */
74 > extern int      urind(int s, int i);
75 >                                /* defined in multisamp.c */
76 > extern void     multisamp(double t[], int n, double r);
77 >
78 > #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines