ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/ArrayPrefixHelpers.java
(Generate patch)

Comparing jsr166/src/main/java/util/ArrayPrefixHelpers.java (file contents):
Revision 1.2 by jsr166, Sun Jan 20 04:25:11 2013 UTC vs.
Revision 1.11 by jsr166, Fri Aug 30 18:05:39 2019 UTC

# Line 5 | Line 5
5   */
6  
7   package java.util;
8 < import java.util.concurrent.ForkJoinPool;
8 >
9   import java.util.concurrent.CountedCompleter;
10 + import java.util.concurrent.ForkJoinPool;
11   import java.util.function.BinaryOperator;
12 + import java.util.function.DoubleBinaryOperator;
13   import java.util.function.IntBinaryOperator;
14   import java.util.function.LongBinaryOperator;
13 import java.util.function.DoubleBinaryOperator;
15  
16   /**
17   * ForkJoin tasks to perform Arrays.parallelPrefix operations.
# Line 19 | Line 20 | import java.util.function.DoubleBinaryOp
20   * @since 1.8
21   */
22   class ArrayPrefixHelpers {
23 <    private ArrayPrefixHelpers() {}; // non-instantiable
23 >    private ArrayPrefixHelpers() {} // non-instantiable
24  
25      /*
26       * Parallel prefix (aka cumulate, scan) task classes
# Line 117 | Line 118 | class ArrayPrefixHelpers {
118                          int mid = (l + h) >>> 1;
119                          f = rt = t.right =
120                              new CumulateTask<T>(t, fn, a, org, fnc, th, mid, h);
121 <                        t = lt = t.left  =
121 >                        t = lt = t.left =
122                              new CumulateTask<T>(t, fn, a, org, fnc, th, l, mid);
123                      }
124                      else {                           // possibly refork
# Line 221 | Line 222 | class ArrayPrefixHelpers {
222                  }
223              }
224          }
225 +        // OPENJDK @java.io.Serial
226          private static final long serialVersionUID = 5293554502939613543L;
227      }
228  
# Line 269 | Line 271 | class ArrayPrefixHelpers {
271                          int mid = (l + h) >>> 1;
272                          f = rt = t.right =
273                              new LongCumulateTask(t, fn, a, org, fnc, th, mid, h);
274 <                        t = lt = t.left  =
274 >                        t = lt = t.left =
275                              new LongCumulateTask(t, fn, a, org, fnc, th, l, mid);
276                      }
277                      else {                           // possibly refork
# Line 371 | Line 373 | class ArrayPrefixHelpers {
373                  }
374              }
375          }
376 +        // OPENJDK @java.io.Serial
377          private static final long serialVersionUID = -5074099945909284273L;
378      }
379  
# Line 383 | Line 386 | class ArrayPrefixHelpers {
386  
387          /** Root task constructor */
388          public DoubleCumulateTask(DoubleCumulateTask parent,
389 <                                DoubleBinaryOperator function,
390 <                                double[] array, int lo, int hi) {
389 >                                  DoubleBinaryOperator function,
390 >                                  double[] array, int lo, int hi) {
391              super(parent);
392              this.function = function; this.array = array;
393              this.lo = this.origin = lo; this.hi = this.fence = hi;
# Line 396 | Line 399 | class ArrayPrefixHelpers {
399  
400          /** Subtask constructor */
401          DoubleCumulateTask(DoubleCumulateTask parent, DoubleBinaryOperator function,
402 <                         double[] array, int origin, int fence, int threshold,
403 <                         int lo, int hi) {
402 >                           double[] array, int origin, int fence, int threshold,
403 >                           int lo, int hi) {
404              super(parent);
405              this.function = function; this.array = array;
406              this.origin = origin; this.fence = fence;
# Line 419 | Line 422 | class ArrayPrefixHelpers {
422                          int mid = (l + h) >>> 1;
423                          f = rt = t.right =
424                              new DoubleCumulateTask(t, fn, a, org, fnc, th, mid, h);
425 <                        t = lt = t.left  =
425 >                        t = lt = t.left =
426                              new DoubleCumulateTask(t, fn, a, org, fnc, th, l, mid);
427                      }
428                      else {                           // possibly refork
# Line 521 | Line 524 | class ArrayPrefixHelpers {
524                  }
525              }
526          }
527 +        // OPENJDK @java.io.Serial
528          private static final long serialVersionUID = -586947823794232033L;
529      }
530  
# Line 533 | Line 537 | class ArrayPrefixHelpers {
537  
538          /** Root task constructor */
539          public IntCumulateTask(IntCumulateTask parent,
540 <                                IntBinaryOperator function,
541 <                                int[] array, int lo, int hi) {
540 >                               IntBinaryOperator function,
541 >                               int[] array, int lo, int hi) {
542              super(parent);
543              this.function = function; this.array = array;
544              this.lo = this.origin = lo; this.hi = this.fence = hi;
# Line 546 | Line 550 | class ArrayPrefixHelpers {
550  
551          /** Subtask constructor */
552          IntCumulateTask(IntCumulateTask parent, IntBinaryOperator function,
553 <                         int[] array, int origin, int fence, int threshold,
554 <                         int lo, int hi) {
553 >                        int[] array, int origin, int fence, int threshold,
554 >                        int lo, int hi) {
555              super(parent);
556              this.function = function; this.array = array;
557              this.origin = origin; this.fence = fence;
# Line 569 | Line 573 | class ArrayPrefixHelpers {
573                          int mid = (l + h) >>> 1;
574                          f = rt = t.right =
575                              new IntCumulateTask(t, fn, a, org, fnc, th, mid, h);
576 <                        t = lt = t.left  =
576 >                        t = lt = t.left =
577                              new IntCumulateTask(t, fn, a, org, fnc, th, l, mid);
578                      }
579                      else {                           // possibly refork
# Line 671 | Line 675 | class ArrayPrefixHelpers {
675                  }
676              }
677          }
678 +        // OPENJDK @java.io.Serial
679          private static final long serialVersionUID = 3731755594596840961L;
680      }
676
681   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines