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

Comparing jsr166/src/test/loops/BoxedLongSort.java (file contents):
Revision 1.7 by dl, Mon Apr 9 13:18:06 2012 UTC vs.
Revision 1.10 by jsr166, Wed Dec 31 17:00:58 2014 UTC

# Line 4 | Line 4
4   * http://creativecommons.org/publicdomain/zero/1.0/
5   */
6  
7 import java.util.concurrent.*;
7   import java.util.*;
8 + import java.util.concurrent.*;
9  
10   class BoxedLongSort {
11      static final long NPS = (1000L * 1000 * 1000);
# Line 68 | Line 68 | class BoxedLongSort {
68              long now = System.nanoTime();
69              double total = (double)(now - start) / NPS;
70              double elapsed = (double)(now - last) / NPS;
71 <            System.out.printf("Arrays.sort   time:  %7.3f total %9.3f\n",
71 >            System.out.printf("Arrays.sort   time:  %7.3f total %9.3f\n",
72                                elapsed, total);
73              if (i == 0)
74                  checkSorted(a);
# Line 90 | Line 90 | class BoxedLongSort {
90              //            pool.invoke(new TaskChecker());
91              double total = (double)(now - start) / NPS;
92              double elapsed = (double)(now - last) / NPS;
93 <            System.out.printf("Parallel sort time:  %7.3f total %9.3f\n",
93 >            System.out.printf("Parallel sort time:  %7.3f total %9.3f\n",
94                                elapsed, total);
95              if (i == 0)
96                  checkSorted(a);
# Line 165 | Line 165 | class BoxedLongSort {
165           * and finding index of right closest to split point.
166           * Uses left-spine decomposition to generate all
167           * merge tasks before bottomming out at base case.
168         *
168           */
169          public final void compute() {
170              Merger rights = null;
# Line 202 | Line 201 | class BoxedLongSort {
201                      Long al = a[l], ar;
202                      if (r >= rFence ||
203                          al.longValue() <= (ar = a[r]).longValue()) {
204 <                        ++l; t = al;
205 <                    }
206 <                    else {
207 <                        ++r; t = ar;
204 >                        ++l; t = al;
205 >                    }
206 >                    else {
207 >                        ++r; t = ar;
208                      }
209                  }
210                  else if (r < rFence)
211                      t = a[r++];
212 <                else
212 >                else
213                      break;
214                  w[k++] = t;
215              }
# Line 295 | Line 294 | class BoxedLongSort {
294          final Long[] src;
295          final Long[] dst;
296          final int lo, hi, size;
297 <        RandomRepacker(Long[] src, Long[] dst,
297 >        RandomRepacker(Long[] src, Long[] dst,
298                         int lo, int hi, int size) {
299              this.src = src; this.dst = dst;
300              this.lo = lo; this.hi = hi; this.size = size;
301          }
302 <        
302 >
303          public final void compute() {
304              Long[] s = src;
305              Long[] d = dst;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines