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.4 by greg, Tue Aug 18 18:45:55 2015 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines