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

Comparing ray/src/rt/pmaprand.h (file contents):
Revision 2.1 by greg, Tue Feb 24 19:39:27 2015 UTC vs.
Revision 2.3 by rschregle, Fri May 8 13:20:23 2015 UTC

# Line 7 | Line 7
7  
8     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
9     (c) Fraunhofer Institute for Solar Energy Systems,
10 <       Lucerne University of Applied Sciences & Arts
10 >   (c) Lucerne University of Applied Sciences and Arts,
11 >   supported by the Swiss National Science Foundation (SNSF, #147053)
12     ==================================================================
13    
14     $Id$
# Line 20 | Line 21
21     erand48() with separate states for photon emission, scattering, and
22     russian roulette. The pmapSeed() and pmapRandom() macros can be adapted
23     to other (better?) RNGs. */  
24 +
25 + #if defined(_WIN32) || defined(BSD)
26 +   /* Assume no erand48(), so use standard RNG without explicit multistate
27 +      control; the resulting sequences will be suboptimal */      
28 +   #include "random.h"
29    
30 < #define pmapSeed(seed, state) (state [0] += seed, state [1] += seed, \
31 <                               state [2] += seed)
32 < #define pmapRandom(state) erand48(state)
30 >   #define pmapSeed(seed, state) (srandom(seed))
31 >   #define pmapRandom(state)     (frandom())
32 > #else
33 >   #define pmapSeed(seed, state) (state [0] += seed, state [1] += seed, \
34 >                                  state [2] += seed)
35 >   #define pmapRandom(state) erand48(state)
36 > #endif
37  
28
38    
39   extern unsigned short partState [3], emitState [3], cntState [3],
40                        mediumState [3], scatterState [3], rouletteState [3],
41                        randSeed;
42  
43   #endif
44 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines