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 |
|
} |
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 |
|
} |