1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
package extra166y; |
65 |
|
// A few public methods exported across all subclasses |
66 |
|
|
67 |
|
/** |
68 |
< |
* Return the number of elements selected using bound or |
68 |
> |
* Returns the number of elements selected using bound or |
69 |
|
* filter restrictions. Note that this method must evaluate |
70 |
|
* all selectors to return its result. |
71 |
|
* @return the number of elements |
82 |
|
/** |
83 |
|
* Returns the index of some element matching bound and filter |
84 |
|
* constraints, or -1 if none. |
85 |
< |
* @return index of matching element, or -1 if none. |
85 |
> |
* @return index of matching element, or -1 if none |
86 |
|
*/ |
87 |
|
public int anyIndex() { |
88 |
|
if (!hasFilter()) |
89 |
< |
return (origin < fence)? origin : -1; |
89 |
> |
return (origin < fence) ? origin : -1; |
90 |
|
AtomicInteger result = new AtomicInteger(-1); |
91 |
|
PAS.FJSelectAny f = new PAS.FJSelectAny |
92 |
|
(this, origin, fence, null, result); |
95 |
|
} |
96 |
|
|
97 |
|
/** |
98 |
< |
* Returns true if there are no elements |
98 |
> |
* Returns true if there are no elements. |
99 |
|
* @return true if there are no elements |
100 |
|
*/ |
101 |
|
public boolean isEmpty() { |
118 |
|
*/ |
119 |
|
final int getThreshold() { |
120 |
|
int t = threshold; |
121 |
< |
if (t == 0) |
121 |
> |
if (t == 0) |
122 |
|
t = computeThreshold(); |
123 |
|
return t; |
124 |
|
} |
403 |
|
int otherOffset, BinaryLongOp combiner) {} |
404 |
|
|
405 |
|
// Base of object ref array classes |
406 |
< |
static abstract class OPap<T> extends AbstractParallelAnyArray { |
406 |
> |
abstract static class OPap<T> extends AbstractParallelAnyArray { |
407 |
|
T[] array; |
408 |
|
OPap(ForkJoinPool ex, int origin, int fence, T[] array) { |
409 |
|
super(ex, origin, fence); |
433 |
|
} |
434 |
|
|
435 |
|
// Base of double array classes |
436 |
< |
static abstract class DPap extends AbstractParallelAnyArray { |
436 |
> |
abstract static class DPap extends AbstractParallelAnyArray { |
437 |
|
double[] array; |
438 |
|
DPap(ForkJoinPool ex, int origin, int fence, double[] array) { |
439 |
|
super(ex, origin, fence); |
463 |
|
} |
464 |
|
|
465 |
|
// Base of long array classes |
466 |
< |
static abstract class LPap extends AbstractParallelAnyArray { |
466 |
> |
abstract static class LPap extends AbstractParallelAnyArray { |
467 |
|
long[] array; |
468 |
|
LPap(ForkJoinPool ex, int origin, int fence, long[] array) { |
469 |
|
super(ex, origin, fence); |
965 |
|
|
966 |
|
public ParallelLongArrayWithLongMapping withIndexedMapping |
967 |
|
(IntAndLongToLong mapper) { |
968 |
< |
return new LULCPap(ex, origin, fence, array, mapper); |
968 |
> |
return new LULCPap(ex, origin, fence, array, mapper); |
969 |
|
} |
970 |
|
|
971 |
|
public int indexOf(long target) { |
1133 |
|
} |
1134 |
|
} |
1135 |
|
|
1136 |
+ |
static final class AndPredicate<T> implements Predicate<T> { |
1137 |
+ |
final Predicate<? super T> first; |
1138 |
+ |
final Predicate<? super T> second; |
1139 |
+ |
AndPredicate(Predicate<? super T> first, |
1140 |
+ |
Predicate<? super T> second) { |
1141 |
+ |
this.first = first; this.second = second; |
1142 |
+ |
} |
1143 |
+ |
public final boolean op(T x) { return first.op(x) && second.op(x); } |
1144 |
+ |
} |
1145 |
+ |
|
1146 |
|
// Filtered (but unmapped) classes |
1147 |
|
static final class OFPap<T> extends ParallelArrayWithFilter<T> { |
1148 |
|
final Predicate<? super T> selector; |
1159 |
|
public ParallelArrayWithFilter<T> withFilter |
1160 |
|
(Predicate<? super T> selector) { |
1161 |
|
return new OFPap<T>(ex, origin, fence, array, |
1162 |
< |
CommonOps.andPredicate(this.selector, selector)); |
1162 |
> |
new AndPredicate(this.selector, selector)); |
1163 |
|
} |
1164 |
|
|
1165 |
|
public ParallelArrayWithFilter<T> withIndexedFilter |
1199 |
|
return new OFLCPap<T>(ex, origin, fence, array, selector, mapper); |
1200 |
|
} |
1201 |
|
|
1202 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
1202 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
1203 |
|
final Predicate s = selector; |
1204 |
|
final Object[] a = this.array; |
1205 |
|
for (int i = lo; i < hi; ++i) { |
1377 |
|
return new DFLCPap(ex, origin, fence, array, selector, mapper); |
1378 |
|
} |
1379 |
|
|
1380 |
< |
final void leafApply(int lo, int hi, DoubleProcedure procedure) { |
1380 |
> |
final void leafApply(int lo, int hi, DoubleProcedure procedure) { |
1381 |
|
final DoublePredicate s = selector; |
1382 |
|
final double[] a = this.array; |
1383 |
|
for (int i = lo; i < hi; ++i) { |
1557 |
|
return new LFLCPap(ex, origin, fence, array, selector, mapper); |
1558 |
|
} |
1559 |
|
|
1560 |
< |
final void leafApply(int lo, int hi, LongProcedure procedure) { |
1560 |
> |
final void leafApply(int lo, int hi, LongProcedure procedure) { |
1561 |
|
final LongPredicate s = selector; |
1562 |
|
final long[] a = this.array; |
1563 |
|
for (int i = lo; i < hi; ++i) { |
1740 |
|
return new ORLCPap<T>(ex, origin, fence, array, selector, mapper); |
1741 |
|
} |
1742 |
|
|
1743 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
1743 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
1744 |
|
final IntAndObjectPredicate s = selector; |
1745 |
|
final Object[] a = this.array; |
1746 |
|
for (int i = lo; i < hi; ++i) { |
1920 |
|
return new DRLCPap(ex, origin, fence, array, selector, mapper); |
1921 |
|
} |
1922 |
|
|
1923 |
< |
final void leafApply(int lo, int hi, DoubleProcedure procedure) { |
1923 |
> |
final void leafApply(int lo, int hi, DoubleProcedure procedure) { |
1924 |
|
final IntAndDoublePredicate s = selector; |
1925 |
|
final double[] a = this.array; |
1926 |
|
for (int i = lo; i < hi; ++i) { |
2100 |
|
return new LRLCPap(ex, origin, fence, array, selector, mapper); |
2101 |
|
} |
2102 |
|
|
2103 |
< |
final void leafApply(int lo, int hi, LongProcedure procedure) { |
2103 |
> |
final void leafApply(int lo, int hi, LongProcedure procedure) { |
2104 |
|
final IntAndLongPredicate s = selector; |
2105 |
|
final long[] a = this.array; |
2106 |
|
for (int i = lo; i < hi; ++i) { |
2228 |
|
|
2229 |
|
// Object-mapped |
2230 |
|
|
2231 |
< |
static abstract class OOMPap<T,U> extends ParallelArrayWithMapping<T,U> { |
2231 |
> |
abstract static class OOMPap<T,U> extends ParallelArrayWithMapping<T,U> { |
2232 |
|
final Op<? super T, ? extends U> op; |
2233 |
|
OOMPap(ForkJoinPool ex, int origin, int fence, |
2234 |
|
T[] array, |
2258 |
|
} |
2259 |
|
} |
2260 |
|
|
2261 |
< |
static abstract class DOMPap<U> extends ParallelDoubleArrayWithMapping<U> { |
2261 |
> |
abstract static class DOMPap<U> extends ParallelDoubleArrayWithMapping<U> { |
2262 |
|
final DoubleToObject<? extends U> op; |
2263 |
|
DOMPap(ForkJoinPool ex, int origin, int fence, |
2264 |
|
double[] array, DoubleToObject<? extends U> op) { |
2287 |
|
} |
2288 |
|
} |
2289 |
|
|
2290 |
< |
static abstract class LOMPap<U> extends ParallelLongArrayWithMapping<U> { |
2290 |
> |
abstract static class LOMPap<U> extends ParallelLongArrayWithMapping<U> { |
2291 |
|
final LongToObject<? extends U> op; |
2292 |
|
LOMPap(ForkJoinPool ex, int origin, int fence, |
2293 |
|
long[] array, LongToObject<? extends U> op) { |
2360 |
|
compoundIndexedOp(this.op, mapper)); |
2361 |
|
} |
2362 |
|
|
2363 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2363 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2364 |
|
final Op f = op; |
2365 |
|
final Object[] a = this.array; |
2366 |
|
for (int i = lo; i < hi; ++i) |
2393 |
|
} |
2394 |
|
|
2395 |
|
public ParallelDoubleArrayWithDoubleMapping withMapping |
2396 |
< |
(ObjectToDouble<? super U> op){ |
2396 |
> |
(ObjectToDouble<? super U> op) { |
2397 |
|
return new DUDMPap(ex, origin, fence, array, |
2398 |
|
CommonOps.compoundOp(this.op, op)); |
2399 |
|
} |
2422 |
|
compoundIndexedOp(this.op, mapper)); |
2423 |
|
} |
2424 |
|
|
2425 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2425 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2426 |
|
final double[] a = this.array; |
2427 |
|
final DoubleToObject f = op; |
2428 |
|
for (int i = lo; i < hi; ++i) |
2484 |
|
compoundIndexedOp(this.op, mapper)); |
2485 |
|
} |
2486 |
|
|
2487 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2487 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2488 |
|
final long[] a = this.array; |
2489 |
|
final LongToObject f = op; |
2490 |
|
for (int i = lo; i < hi; ++i) |
2555 |
|
compoundIndexedOp(this.op, mapper)); |
2556 |
|
} |
2557 |
|
|
2558 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2558 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2559 |
|
final Predicate s = selector; |
2560 |
|
final Object[] a = this.array; |
2561 |
|
final Op f = op; |
2643 |
|
compoundIndexedOp(this.op, mapper)); |
2644 |
|
} |
2645 |
|
|
2646 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2646 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2647 |
|
final DoublePredicate s = selector; |
2648 |
|
final DoubleToObject f = op; |
2649 |
|
final double[] a = this.array; |
2725 |
|
compoundIndexedOp(this.op, mapper)); |
2726 |
|
} |
2727 |
|
|
2728 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2728 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2729 |
|
final LongPredicate s = selector; |
2730 |
|
final LongToObject f = op; |
2731 |
|
final long[] a = this.array; |
2808 |
|
compoundIndexedOp(this.op, mapper)); |
2809 |
|
} |
2810 |
|
|
2811 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2811 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2812 |
|
final IntAndObjectPredicate s = selector; |
2813 |
|
final Object[] a = this.array; |
2814 |
|
final Op f = op; |
2896 |
|
compoundIndexedOp(this.op, mapper)); |
2897 |
|
} |
2898 |
|
|
2899 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2899 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2900 |
|
final IntAndDoublePredicate s = selector; |
2901 |
|
final DoubleToObject f = op; |
2902 |
|
final double[] a = this.array; |
2978 |
|
compoundIndexedOp(this.op, mapper)); |
2979 |
|
} |
2980 |
|
|
2981 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2981 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2982 |
|
final IntAndLongPredicate s = selector; |
2983 |
|
final LongToObject f = op; |
2984 |
|
final long[] a = this.array; |
3013 |
|
|
3014 |
|
// Object-combined |
3015 |
|
|
3016 |
< |
static abstract class OOCPap<T,U> extends ParallelArrayWithMapping<T,U> { |
3016 |
> |
abstract static class OOCPap<T,U> extends ParallelArrayWithMapping<T,U> { |
3017 |
|
final IntAndObjectToObject<? super T, ? extends U> op; |
3018 |
|
OOCPap(ForkJoinPool ex, int origin, int fence, |
3019 |
|
T[] array, |
3045 |
|
} |
3046 |
|
} |
3047 |
|
|
3048 |
< |
static abstract class DOCPap<U> extends ParallelDoubleArrayWithMapping<U> { |
3048 |
> |
abstract static class DOCPap<U> extends ParallelDoubleArrayWithMapping<U> { |
3049 |
|
final IntAndDoubleToObject<? extends U> op; |
3050 |
|
DOCPap(ForkJoinPool ex, int origin, int fence, |
3051 |
|
double[] array, IntAndDoubleToObject<? extends U> op) { |
3076 |
|
} |
3077 |
|
} |
3078 |
|
|
3079 |
< |
static abstract class LOCPap<U> extends ParallelLongArrayWithMapping<U> { |
3079 |
> |
abstract static class LOCPap<U> extends ParallelLongArrayWithMapping<U> { |
3080 |
|
final IntAndLongToObject<? extends U> op; |
3081 |
|
LOCPap(ForkJoinPool ex, int origin, int fence, |
3082 |
|
long[] array, IntAndLongToObject<? extends U> op) { |
3151 |
|
compoundIndexedOp(this.op, mapper)); |
3152 |
|
} |
3153 |
|
|
3154 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3154 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3155 |
|
final IntAndObjectToObject f = op; |
3156 |
|
final Object[] a = this.array; |
3157 |
|
for (int i = lo; i < hi; ++i) |
3213 |
|
compoundIndexedOp(this.op, mapper)); |
3214 |
|
} |
3215 |
|
|
3216 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3216 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3217 |
|
final IntAndDoubleToObject f = op; |
3218 |
|
final double[] a = this.array; |
3219 |
|
for (int i = lo; i < hi; ++i) |
3275 |
|
compoundIndexedOp(this.op, mapper)); |
3276 |
|
} |
3277 |
|
|
3278 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3278 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3279 |
|
final IntAndLongToObject f = op; |
3280 |
|
final long[] a = this.array; |
3281 |
|
for (int i = lo; i < hi; ++i) |
3297 |
|
|
3298 |
|
// object-combined filtered |
3299 |
|
|
3300 |
< |
static final class OFOCPap<T,U> extends OOCPap<T,U> { |
3300 |
> |
static final class OFOCPap<T,U> extends OOCPap<T,U> { |
3301 |
|
final Predicate<? super T> selector; |
3302 |
|
OFOCPap(ForkJoinPool ex, int origin, int fence, |
3303 |
|
T[] array, Predicate<? super T> selector, |
3347 |
|
(this.op, mapper)); |
3348 |
|
} |
3349 |
|
|
3350 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3350 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3351 |
|
final Predicate s = selector; |
3352 |
|
final Object[] a = this.array; |
3353 |
|
final IntAndObjectToObject f = op; |
3427 |
|
compoundIndexedOp(this.op, mapper)); |
3428 |
|
} |
3429 |
|
|
3430 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3430 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3431 |
|
final DoublePredicate s = selector; |
3432 |
|
final double[] a = this.array; |
3433 |
|
final IntAndDoubleToObject f = op; |
3507 |
|
compoundIndexedOp(this.op, mapper)); |
3508 |
|
} |
3509 |
|
|
3510 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3510 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3511 |
|
final LongPredicate s = selector; |
3512 |
|
final long[] a = this.array; |
3513 |
|
final IntAndLongToObject f = op; |
3540 |
|
} |
3541 |
|
|
3542 |
|
// Object-combined, relational |
3543 |
< |
static final class OROCPap<T,U> extends OOCPap<T,U> { |
3543 |
> |
static final class OROCPap<T,U> extends OOCPap<T,U> { |
3544 |
|
final IntAndObjectPredicate<? super T> selector; |
3545 |
|
OROCPap(ForkJoinPool ex, int origin, int fence, |
3546 |
|
T[] array, IntAndObjectPredicate<? super T> selector, |
3590 |
|
(this.op, mapper)); |
3591 |
|
} |
3592 |
|
|
3593 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3593 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3594 |
|
final IntAndObjectPredicate s = selector; |
3595 |
|
final Object[] a = this.array; |
3596 |
|
final IntAndObjectToObject f = op; |
3670 |
|
compoundIndexedOp(this.op, mapper)); |
3671 |
|
} |
3672 |
|
|
3673 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3673 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3674 |
|
final IntAndDoublePredicate s = selector; |
3675 |
|
final double[] a = this.array; |
3676 |
|
final IntAndDoubleToObject f = op; |
3750 |
|
compoundIndexedOp(this.op, mapper)); |
3751 |
|
} |
3752 |
|
|
3753 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3753 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3754 |
|
final IntAndLongPredicate s = selector; |
3755 |
|
final long[] a = this.array; |
3756 |
|
final IntAndLongToObject f = op; |
3784 |
|
|
3785 |
|
// Double-mapped |
3786 |
|
|
3787 |
< |
static abstract class ODMPap<T> extends ParallelArrayWithDoubleMapping<T> { |
3787 |
> |
abstract static class ODMPap<T> extends ParallelArrayWithDoubleMapping<T> { |
3788 |
|
final ObjectToDouble<? super T> op; |
3789 |
|
ODMPap(ForkJoinPool ex, int origin, int fence, |
3790 |
|
T[] array, ObjectToDouble<? super T> op) { |
3814 |
|
|
3815 |
|
} |
3816 |
|
|
3817 |
< |
static abstract class DDMPap extends ParallelDoubleArrayWithDoubleMapping { |
3817 |
> |
abstract static class DDMPap extends ParallelDoubleArrayWithDoubleMapping { |
3818 |
|
final DoubleOp op; |
3819 |
|
DDMPap |
3820 |
|
(ForkJoinPool ex, int origin, int fence, |
3844 |
|
} |
3845 |
|
} |
3846 |
|
|
3847 |
< |
static abstract class LDMPap extends ParallelLongArrayWithDoubleMapping { |
3847 |
> |
abstract static class LDMPap extends ParallelLongArrayWithDoubleMapping { |
3848 |
|
final LongToDouble op; |
3849 |
|
LDMPap(ForkJoinPool ex, int origin, int fence, |
3850 |
|
long[] array, LongToDouble op) { |
4530 |
|
} |
4531 |
|
|
4532 |
|
// double-combined |
4533 |
< |
static abstract class ODCPap<T> extends ParallelArrayWithDoubleMapping<T> { |
4533 |
> |
abstract static class ODCPap<T> extends ParallelArrayWithDoubleMapping<T> { |
4534 |
|
final IntAndObjectToDouble<? super T> op; |
4535 |
|
ODCPap(ForkJoinPool ex, int origin, int fence, |
4536 |
|
T[] array, IntAndObjectToDouble<? super T> op) { |
4562 |
|
|
4563 |
|
} |
4564 |
|
|
4565 |
< |
static abstract class DDCPap extends ParallelDoubleArrayWithDoubleMapping { |
4565 |
> |
abstract static class DDCPap extends ParallelDoubleArrayWithDoubleMapping { |
4566 |
|
final IntAndDoubleToDouble op; |
4567 |
|
DDCPap(ForkJoinPool ex, int origin, int fence, |
4568 |
|
double[] array, IntAndDoubleToDouble op) { |
4593 |
|
} |
4594 |
|
} |
4595 |
|
|
4596 |
< |
static abstract class LDCPap extends ParallelLongArrayWithDoubleMapping { |
4596 |
> |
abstract static class LDCPap extends ParallelLongArrayWithDoubleMapping { |
4597 |
|
final IntAndLongToDouble op; |
4598 |
|
LDCPap(ForkJoinPool ex, int origin, int fence, |
4599 |
|
long[] array, IntAndLongToDouble op) { |
4903 |
|
} |
4904 |
|
|
4905 |
|
public ParallelDoubleArrayWithLongMapping withMapping(DoubleToLong op) { |
4906 |
< |
return new DFLCPap (ex, origin, fence, array, selector, |
4907 |
< |
compoundIndexedOp(this.op, op)); |
4906 |
> |
return new DFLCPap(ex, origin, fence, array, selector, |
4907 |
> |
compoundIndexedOp(this.op, op)); |
4908 |
|
} |
4909 |
|
|
4910 |
|
public <U> ParallelDoubleArrayWithMapping< U> withMapping |
5141 |
|
} |
5142 |
|
|
5143 |
|
public ParallelDoubleArrayWithLongMapping withMapping(DoubleToLong op) { |
5144 |
< |
return new DRLCPap (ex, origin, fence, array, selector, |
5145 |
< |
compoundIndexedOp(this.op, op)); |
5144 |
> |
return new DRLCPap(ex, origin, fence, array, selector, |
5145 |
> |
compoundIndexedOp(this.op, op)); |
5146 |
|
} |
5147 |
|
|
5148 |
|
public <U> ParallelDoubleArrayWithMapping< U> withMapping |
5281 |
|
} |
5282 |
|
|
5283 |
|
// long-combined |
5284 |
< |
static abstract class OLMPap<T> extends ParallelArrayWithLongMapping<T> { |
5284 |
> |
abstract static class OLMPap<T> extends ParallelArrayWithLongMapping<T> { |
5285 |
|
final ObjectToLong<? super T> op; |
5286 |
|
OLMPap(ForkJoinPool ex, int origin, int fence, |
5287 |
|
T[] array, final ObjectToLong<? super T> op) { |
5310 |
|
} |
5311 |
|
} |
5312 |
|
|
5313 |
< |
static abstract class DLMPap extends ParallelDoubleArrayWithLongMapping { |
5313 |
> |
abstract static class DLMPap extends ParallelDoubleArrayWithLongMapping { |
5314 |
|
final DoubleToLong op; |
5315 |
|
DLMPap(ForkJoinPool ex, int origin, int fence, |
5316 |
|
double[] array, DoubleToLong op) { |
5340 |
|
|
5341 |
|
} |
5342 |
|
|
5343 |
< |
static abstract class LLMPap extends ParallelLongArrayWithLongMapping { |
5343 |
> |
abstract static class LLMPap extends ParallelLongArrayWithLongMapping { |
5344 |
|
final LongOp op; |
5345 |
|
LLMPap(ForkJoinPool ex, int origin, int fence, |
5346 |
|
long[] array, LongOp op) { |
6032 |
|
} |
6033 |
|
|
6034 |
|
// long-combined |
6035 |
< |
static abstract class OLCPap<T> extends ParallelArrayWithLongMapping<T> { |
6035 |
> |
abstract static class OLCPap<T> extends ParallelArrayWithLongMapping<T> { |
6036 |
|
final IntAndObjectToLong<? super T> op; |
6037 |
|
OLCPap(ForkJoinPool ex, int origin, int fence, |
6038 |
|
T[] array, IntAndObjectToLong<? super T> op) { |
6063 |
|
} |
6064 |
|
} |
6065 |
|
|
6066 |
< |
static abstract class DLCPap extends ParallelDoubleArrayWithLongMapping { |
6066 |
> |
abstract static class DLCPap extends ParallelDoubleArrayWithLongMapping { |
6067 |
|
final IntAndDoubleToLong op; |
6068 |
|
DLCPap(ForkJoinPool ex, int origin, int fence, |
6069 |
|
double[] array, IntAndDoubleToLong op) { |
6094 |
|
} |
6095 |
|
} |
6096 |
|
|
6097 |
< |
static abstract class LLCPap extends ParallelLongArrayWithLongMapping { |
6097 |
> |
abstract static class LLCPap extends ParallelLongArrayWithLongMapping { |
6098 |
|
final IntAndLongToLong op; |
6099 |
|
LLCPap(ForkJoinPool ex, int origin, int fence, |
6100 |
|
long[] array, IntAndLongToLong op) { |
7882 |
|
}; |
7883 |
|
} |
7884 |
|
|
7885 |
< |
static IntAndDoublePredicate compoundIndexedSelector |
7885 |
> |
static IntAndDoublePredicate compoundIndexedSelector |
7886 |
|
(final IntAndDoublePredicate fst, final IntAndDoublePredicate snd) { |
7887 |
|
return new IntAndDoublePredicate() { |
7888 |
|
public boolean op(int i, double a) { return fst.op(i, a) && snd.op(i, a); } |
7889 |
|
}; |
7890 |
|
} |
7891 |
|
|
7892 |
< |
static IntAndDoublePredicate compoundIndexedSelector |
7892 |
> |
static IntAndDoublePredicate compoundIndexedSelector |
7893 |
|
(final IntAndDoublePredicate fst, final DoublePredicate snd) { |
7894 |
|
return new IntAndDoublePredicate() { |
7895 |
|
public boolean op(int i, double a) { return fst.op(i, a) && snd.op(a); } |
7903 |
|
}; |
7904 |
|
} |
7905 |
|
|
7906 |
< |
static IntAndLongPredicate compoundIndexedSelector |
7906 |
> |
static IntAndLongPredicate compoundIndexedSelector |
7907 |
|
(final IntAndLongPredicate fst, final IntAndLongPredicate snd) { |
7908 |
|
return new IntAndLongPredicate() { |
7909 |
|
public boolean op(int i, long a) { return fst.op(i, a) && snd.op(i, a); } |
7910 |
|
}; |
7911 |
|
} |
7912 |
|
|
7913 |
< |
static IntAndLongPredicate compoundIndexedSelector |
7913 |
> |
static IntAndLongPredicate compoundIndexedSelector |
7914 |
|
(final IntAndLongPredicate fst, final LongPredicate snd) { |
7915 |
|
return new IntAndLongPredicate() { |
7916 |
|
public boolean op(int i, long a) { return fst.op(i, a) && snd.op(a); } |