ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/multisamp.c
(Generate patch)

Comparing ray/src/common/multisamp.c (file contents):
Revision 2.2 by gregl, Mon Dec 1 09:54:59 1997 UTC vs.
Revision 2.6 by greg, Wed Apr 17 15:07:29 2024 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1997 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
7 #include "random.h"
8
4   /*
5   * Binary space partitioning curve for multidimensional sampling.
6   *
7   *      Written by Christophe Schlick
8   */
9  
10 < multisamp(t, n, r)      /* convert 1-dimensional sample to N dimensions */
11 < double  t[];                    /* returned N-dimensional vector */
12 < register int    n;              /* number of dimensions */
13 < double  r;                      /* 1-dimensional sample [0,1) */
10 > #include "copyright.h"
11 >
12 > #include <stdlib.h>
13 >
14 > #include "random.h"
15 >
16 >
17 > /* Convert 1-dimensional sample to N dimensions */
18 > void
19 > multisamp(double t[], int n, double r)
20   {
21          int     j;
22 <        register int    i, k;
22 >        int     i, k;
23          int     ti[8];
24          double  s;
25  
# Line 35 | Line 36 | double r;                      /* 1-dimensional sample [0,1) */
36          }
37          i = n;
38          while (i-- > 0)
39 <                t[i] = 1./256. * (ti[i] + frandom());
39 >                t[i] = (1./256.) * (ti[i] + frandom());
40   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines