ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/TorusSpanningTree.java
(Generate patch)

Comparing jsr166/src/test/loops/TorusSpanningTree.java (file contents):
Revision 1.2 by jsr166, Mon Nov 2 20:23:53 2009 UTC vs.
Revision 1.3 by jsr166, Mon Nov 2 23:42:46 2009 UTC

# Line 119 | Line 119 | public class TorusSpanningTree {
119                          newList = e;
120                          if (batchSize == 0) {
121                              int s = getQueuedTaskCount();
122 <                            batchSize = ((s >= LOG_MAX_BATCH_SIZE)?
122 >                            batchSize = ((s >= LOG_MAX_BATCH_SIZE) ?
123                                           (1 << LOG_MAX_BATCH_SIZE) :
124                                           (1 << s));
125                          }
# Line 177 | Line 177 | public class TorusSpanningTree {
177          // connect each node to left, right, up, down neighbors
178          int maxcol = n - sideLength;
179          int col = 0;
180 <        for(int i = 0; i < sideLength; ++i) {
181 <            for(int j = 0; j < sideLength; ++j) {
180 >        for (int i = 0; i < sideLength; ++i) {
181 >            for (int j = 0; j < sideLength; ++j) {
182                  Node[] a = vs[col + j].neighbors;
183 <                a[0] = vs[col + ((j < sideLength-1)? (j+1) : 0)];
184 <                a[1] = vs[col + ((j != 0)? (j-1) : (sideLength-1))];
185 <                a[2] = vs[j + ((i < sideLength-1)? (col + sideLength) : 0)];
186 <                a[3] = vs[j + ((i != 0)? (col - sideLength) : maxcol)];
183 >                a[0] = vs[col + ((j < sideLength-1) ? (j+1) : 0)];
184 >                a[1] = vs[col + ((j != 0) ? (j-1) : (sideLength-1))];
185 >                a[2] = vs[j + ((i < sideLength-1) ? (col + sideLength) : 0)];
186 >                a[3] = vs[j + ((i != 0) ? (col - sideLength) : maxcol)];
187              }
188              col += sideLength;
189          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines