Line | |
---|
1 | #include "common.h"
|
---|
2 | #include "Halton.h"
|
---|
3 |
|
---|
4 |
|
---|
5 | float Halton2::_invBases[2];
|
---|
6 |
|
---|
7 | template<int T> float Halton<T>::_invBases[T];
|
---|
8 |
|
---|
9 | Halton<1> dummmyHalton1(true);
|
---|
10 | Halton<2> dummmyHalton2(true);
|
---|
11 | Halton<3> dummmyHalton3(true);
|
---|
12 | Halton<4> dummmyHalton4(true);
|
---|
13 | Halton<5> dummmyHalton5(true);
|
---|
14 | Halton<6> dummmyHalton6(true);
|
---|
15 |
|
---|
16 |
|
---|
17 | int HaltonSequence::sPregeneratedDim = 0;
|
---|
18 | int HaltonSequence::sPregeneratedNumber = 0;
|
---|
19 | float *HaltonSequence::sPregeneratedValues = NULL;
|
---|
20 |
|
---|
21 |
|
---|
22 | // special construtor for pregenerating static halton sequences
|
---|
23 | HaltonSequence::HaltonSequence(const int dim, const int number)
|
---|
24 | {
|
---|
25 |
|
---|
26 | sPregeneratedDim = 0;
|
---|
27 | sPregeneratedNumber = 0;
|
---|
28 | sPregeneratedValues = new float[number*dim];
|
---|
29 |
|
---|
30 | float *p = sPregeneratedValues;
|
---|
31 |
|
---|
32 | for (int i=0; i < number; i++, p+=dim)
|
---|
33 | {
|
---|
34 | GetNext(dim, p);
|
---|
35 | }
|
---|
36 |
|
---|
37 | sPregeneratedDim = dim;
|
---|
38 | sPregeneratedNumber = number;
|
---|
39 | }
|
---|
40 |
|
---|
41 |
|
---|
42 | void HaltonSequence::GetNext(const int dimensions, float *p)
|
---|
43 | {
|
---|
44 | for (int i = 0; i < dimensions; ++ i)
|
---|
45 | p[i] = (float)GetNumber(i + 1);
|
---|
46 |
|
---|
47 | GenerateNext();
|
---|
48 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.