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

Comparing ray/src/common/hilbert.c (file contents):
Revision 3.2 by greg, Fri Feb 18 18:41:04 2011 UTC vs.
Revision 3.3 by greg, Fri Apr 8 23:23:28 2011 UTC

# Line 25 | Line 25 | static const char RCSid[] = "$Id$";
25   * from his, the first two interfaces and the style of some comments are very
26   * much derived from his work. */
27  
28 <
28 > #include <stdlib.h>
29   #include "hilbert.h"
30  
31   /* implementation of the hilbert functions */
# Line 1256 | Line 1256 | int main()
1256    printf("How many points? ");
1257    scanf("%d", &n);
1258    a = (double*) malloc(2*n*sizeof(double));
1259 <  for (i = 0; i < n; ++i)
1260 <    a[2*i] = drand48()-0.5, a[2*i+1] = drand48()-0.5;
1261 <
1259 >  for (i = 0; i < n; ++i) {
1260 >    a[2*i] = rand()*(1./RAND_MAX) - 0.5;
1261 >    a[2*i+1] = rand()*(1./RAND_MAX) - 0.5;
1262 >  }
1263    qsort(a, n, 2*sizeof(double), cmp);
1264  
1265    for (i = 0; i < n; ++i)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines