1 |
greg |
2.3 |
#ifndef lint |
2 |
|
|
static const char RCSid[] = "$Id$"; |
3 |
|
|
#endif |
4 |
greg |
2.1 |
/* |
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 |
rschregle |
2.2 |
(c) Lucerne University of Applied Sciences and Arts, |
11 |
|
|
supported by the Swiss National Science Foundation (SNSF, #147053) |
12 |
greg |
2.1 |
================================================================== |
13 |
|
|
|
14 |
greg |
2.3 |
$Id: pmaprand.c,v 2.2 2015/05/08 13:20:23 rschregle Exp $ |
15 |
greg |
2.1 |
*/ |
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
/* |
20 |
|
|
Separate RNG states are used for the following variates during photon |
21 |
|
|
distribution: |
22 |
|
|
|
23 |
|
|
- source partition |
24 |
|
|
- emission direction |
25 |
|
|
- emission counter fraction |
26 |
|
|
- mean free distance in medium |
27 |
|
|
- scattering direction |
28 |
|
|
- russian roulette. |
29 |
|
|
|
30 |
|
|
Each photon map also has a local state randState used for distribRatio |
31 |
|
|
during distribution and for bias compensation during gathering. |
32 |
|
|
|
33 |
|
|
The random seed randSeed can added to each initial state with pmapSeed() |
34 |
|
|
so the RNGs can be externally seeded if necessary. |
35 |
|
|
*/ |
36 |
|
|
|
37 |
|
|
unsigned short partState [3] = {47717, 5519, 21521}, |
38 |
|
|
emitState [3] = {33997, 59693, 11003}, |
39 |
|
|
cntState [3] = {17077, 4111, 48907}, |
40 |
|
|
mediumState [3] = {25247, 7507, 33797}, |
41 |
|
|
scatterState [3] = {21863, 45191, 5099}, |
42 |
|
|
rouletteState [3] = {10243, 39829, 9433}, |
43 |
|
|
randSeed = 0; |