1 |
#ifndef PMAPRAND_H |
2 |
#define PMAPRAND_H |
3 |
|
4 |
/* |
5 |
================================================================== |
6 |
Random number generators for photon distribution |
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 |
11 |
================================================================== |
12 |
|
13 |
$Id: pmaprand.h,v 4.1 2014/01/24 14:54:13 taschreg Exp taschreg $ |
14 |
*/ |
15 |
|
16 |
|
17 |
|
18 |
/* According to the analytical validation, skipping numbers in the sequence |
19 |
introduces bias in scenes with high reflectance. We therefore use |
20 |
erand48() with separate states for photon emission, scattering, and |
21 |
russian roulette. The pmapSeed() and pmapRandom() macros can be adapted |
22 |
to other (better?) RNGs. */ |
23 |
|
24 |
#define pmapSeed(seed, state) (state [0] += seed, state [1] += seed, \ |
25 |
state [2] += seed) |
26 |
#define pmapRandom(state) erand48(state) |
27 |
|
28 |
|
29 |
|
30 |
extern unsigned short partState [3], emitState [3], cntState [3], |
31 |
mediumState [3], scatterState [3], rouletteState [3], |
32 |
randSeed; |
33 |
|
34 |
#endif |