1 |
– |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Binary space partitioning curve for multidimensional sampling. |
6 |
|
* |
7 |
|
* Written by Christophe Schlick |
8 |
|
*/ |
9 |
|
|
10 |
+ |
#include "copyright.h" |
11 |
+ |
|
12 |
+ |
#include "random.h" |
13 |
+ |
|
14 |
+ |
void |
15 |
|
multisamp(t, n, r) /* convert 1-dimensional sample to N dimensions */ |
16 |
|
double t[]; /* returned N-dimensional vector */ |
17 |
|
register int n; /* number of dimensions */ |
35 |
|
} |
36 |
|
i = n; |
37 |
|
while (i-- > 0) |
38 |
< |
t[i] = 1./256. * ti[i]; |
38 |
> |
t[i] = 1./256. * (ti[i] + frandom()); |
39 |
|
} |