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

Comparing ray/src/hd/clumpbeams.c (file contents):
Revision 3.5 by schorsch, Mon Jul 21 22:30:18 2003 UTC vs.
Revision 3.7 by greg, Mon Nov 17 02:21:53 2003 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8   #include "holo.h"
9  
10   #define flgop(p,i,op)           ((p)[(i)>>5] op (1L<<((i)&0x1f)))
11 < #define isset(p,i)              flgop(p,i,&)
11 > #define issetfl(p,i)            flgop(p,i,&)
12   #define setfl(p,i)              flgop(p,i,|=)
13   #define clrfl(p,i)              flgop(p,i,&=~)
14  
# Line 76 | Line 76 | int    b;
76          bneighrem = 0;
77          for (i = 9; i--; )
78                  for (j = 9; j--; ) {
79 <                        if (i == 4 & j == 4)    /* don't copy starting beam */
79 >                        if ((i == 4) & (j == 4))        /* don't copy starting beam */
80                                  continue;
81                          if (wg0[i].w == wg1[j].w)
82                                  continue;
# Line 112 | Line 112 | int    (*cf)();
112          bqueue = (int *)malloc(maxcnt*sizeof(int));
113          bflags = (uint32 *)calloc((nbeams(hp)>>5)+1,
114                          sizeof(uint32));
115 <        if (bqueue == NULL | bflags == NULL)
115 >        if ((bqueue == NULL) | (bflags == NULL))
116                  error(SYSTEM, "out of memory in clumpbeams");
117                                          /* mark empty beams as done */
118          for (i = nbeams(hp); i > 0; i--)
# Line 127 | Line 127 | int    (*cf)();
127                                          /* add each input beam and neighbors */
128          for (bc = bci = nbeams(hp); bc > 0; bc--,
129                          bci += bci>myprime ? -myprime : nbeams(hp)-myprime) {
130 <                if (isset(bflags, bci))
130 >                if (issetfl(bflags, bci))
131                          continue;
132                  bqueue[0] = bci;                /* initialize queue */
133                  bqlen = 1;
# Line 138 | Line 138 | int    (*cf)();
138                                                  /* add neighbors until full */
139                          for (i = firstneigh(hp,bqueue[bqc]); i > 0;
140                                          i = nextneigh()) {
141 <                                if (isset(bflags, i))   /* done already? */
141 >                                if (issetfl(bflags, i)) /* done already? */
142                                          continue;
143                                  bqueue[bqlen++] = i;    /* add it */
144                                  bqtotal += bnrays(hp, i);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines