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

Comparing ray/src/util/rttree_reduce.c (file contents):
Revision 2.17 by greg, Wed May 31 03:26:46 2017 UTC vs.
Revision 2.20 by greg, Tue Jun 30 17:18:22 2020 UTC

# Line 19 | Line 19 | int    log2g = 4;              /* log2 of grid resolution */
19   int     infmt = 'a';            /* input format ('a','f','d') */
20   double  pctcull = 95.;          /* target culling percentile */
21  
22 < #define dval3(ix,ox,oy)         datarr[((((ix)<<log2g)+(ox))<<log2g)+(oy)]
23 < #define dval4(ix,iy,ox,oy)      datarr[((((((ix)<<log2g)+(iy))<<log2g)+(ox))<<log2g)+(oy)]
22 > #define dval3(ix,ox,oy)         datarr[((size_t)(((ix)<<log2g)+(ox))<<log2g)+(oy)]
23 > #define dval4(ix,iy,ox,oy)      datarr[((((size_t)(((ix)<<log2g)+(iy))<<log2g)+(ox))<<log2g)+(oy)]
24  
25   /* Tensor tree node */
26   typedef struct ttree_s {
# Line 30 | Line 30 | typedef struct ttree_s {
30   } TNODE;
31  
32   #define HISTLEN         300     /* histogram resolution */
33 < #define HISTMAX         10.     /* maximum recorded measure in histogram */
33 > #define HISTMAX         4.      /* maximum recorded measure in histogram */
34  
35   int     histo[HISTLEN];         /* histogram freq. of variance measure */
36  
37   double  tthresh;                /* acceptance threshold (TBD) */
38  
39 < #define var_measure(tp)         ( ((tp)->vmax - (tp)->vmin) / \
39 > #define var_measure(tp)         sqrt( ((tp)->vmax - (tp)->vmin) / \
40                                          (sqrt((tp)->vavg) + .03) )
41   #define above_threshold(tp)     (var_measure(tp) > tthresh)
42  
# Line 402 | Line 402 | main(int argc, char *argv[])
402          if (recipavg)
403                  do_reciprocity();
404          if (doheader) {
405 <                for (i = 0; i < argc; i++) {
406 <                        fputs(argv[i], stdout);
407 <                        fputc(i < argc-1 ? ' ' : '\n', stdout);
408 <                }
405 >                newheader("RADIANCE", stdout);
406 >                printargs(argc, argv, stdout);
407 >                fputnow(stdout);
408 >                fputformat("ascii", stdout);
409                  fputc('\n', stdout);
410          }
411          gtree.kid = NULL;               /* create our tree */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines