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()) |
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() { |
132 |
|
*/ |
133 |
|
Object[] ogetArray() { return null; } |
134 |
|
double[] dgetArray() { return null; } |
135 |
< |
long[] lgetArray() { return null; } |
135 |
> |
long[] lgetArray() { return null; } |
136 |
|
abstract Object oget(int index); |
137 |
|
abstract double dget(int index); |
138 |
|
abstract long lget(int index); |
145 |
|
* oget, dget, etc. But most are overridden in most concrete |
146 |
|
* classes to avoid per-element dispatching. |
147 |
|
*/ |
148 |
+ |
|
149 |
|
void leafApply(int lo, int hi, Procedure procedure) { |
150 |
|
for (int i = lo; i < hi; ++i) |
151 |
|
if (isSelected(i)) |
275 |
|
/** |
276 |
|
* Shared support for select/map all -- probe filter, map, and |
277 |
|
* type to start selection driver, or do parallel mapping, or |
278 |
< |
* just copy, |
278 |
> |
* just copy. |
279 |
|
*/ |
280 |
|
final Object[] allObjects(Class elementType) { |
281 |
|
if (hasFilter()) { |
404 |
|
int otherOffset, BinaryLongOp combiner) {} |
405 |
|
|
406 |
|
// Base of object ref array classes |
407 |
< |
static abstract class OPap<T> extends AbstractParallelAnyArray { |
407 |
> |
abstract static class OPap<T> extends AbstractParallelAnyArray { |
408 |
|
T[] array; |
409 |
|
OPap(ForkJoinPool ex, int origin, int fence, T[] array) { |
410 |
|
super(ex, origin, fence); |
434 |
|
} |
435 |
|
|
436 |
|
// Base of double array classes |
437 |
< |
static abstract class DPap extends AbstractParallelAnyArray { |
437 |
> |
abstract static class DPap extends AbstractParallelAnyArray { |
438 |
|
double[] array; |
439 |
|
DPap(ForkJoinPool ex, int origin, int fence, double[] array) { |
440 |
|
super(ex, origin, fence); |
464 |
|
} |
465 |
|
|
466 |
|
// Base of long array classes |
467 |
< |
static abstract class LPap extends AbstractParallelAnyArray { |
467 |
> |
abstract static class LPap extends AbstractParallelAnyArray { |
468 |
|
long[] array; |
469 |
|
LPap(ForkJoinPool ex, int origin, int fence, long[] array) { |
470 |
|
super(ex, origin, fence); |
514 |
|
return new ORPap<T>(ex, origin, fence, array, selector); |
515 |
|
} |
516 |
|
|
517 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
517 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
518 |
|
(Op<? super T, ? extends U> op) { |
519 |
|
return new OUOMPap<T,U>(ex, origin, fence, array, op); |
520 |
|
} |
966 |
|
|
967 |
|
public ParallelLongArrayWithLongMapping withIndexedMapping |
968 |
|
(IntAndLongToLong mapper) { |
969 |
< |
return new LULCPap(ex, origin, fence, array, mapper); |
969 |
> |
return new LULCPap(ex, origin, fence, array, mapper); |
970 |
|
} |
971 |
|
|
972 |
|
public int indexOf(long target) { |
1137 |
|
static final class AndPredicate<T> implements Predicate<T> { |
1138 |
|
final Predicate<? super T> first; |
1139 |
|
final Predicate<? super T> second; |
1140 |
< |
AndPredicate(Predicate<? super T> first, |
1140 |
> |
AndPredicate(Predicate<? super T> first, |
1141 |
|
Predicate<? super T> second) { |
1142 |
|
this.first = first; this.second = second; |
1143 |
|
} |
1170 |
|
compoundIndexedSelector(this.selector, selector)); |
1171 |
|
} |
1172 |
|
|
1173 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
1173 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
1174 |
|
(Op<? super T, ? extends U> op) { |
1175 |
|
return new OFOMPap<T,U>(ex, origin, fence, array, selector, op); |
1176 |
|
} |
1200 |
|
return new OFLCPap<T>(ex, origin, fence, array, selector, mapper); |
1201 |
|
} |
1202 |
|
|
1203 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
1203 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
1204 |
|
final Predicate s = selector; |
1205 |
|
final Object[] a = this.array; |
1206 |
|
for (int i = lo; i < hi; ++i) { |
1378 |
|
return new DFLCPap(ex, origin, fence, array, selector, mapper); |
1379 |
|
} |
1380 |
|
|
1381 |
< |
final void leafApply(int lo, int hi, DoubleProcedure procedure) { |
1381 |
> |
final void leafApply(int lo, int hi, DoubleProcedure procedure) { |
1382 |
|
final DoublePredicate s = selector; |
1383 |
|
final double[] a = this.array; |
1384 |
|
for (int i = lo; i < hi; ++i) { |
1558 |
|
return new LFLCPap(ex, origin, fence, array, selector, mapper); |
1559 |
|
} |
1560 |
|
|
1561 |
< |
final void leafApply(int lo, int hi, LongProcedure procedure) { |
1561 |
> |
final void leafApply(int lo, int hi, LongProcedure procedure) { |
1562 |
|
final LongPredicate s = selector; |
1563 |
|
final long[] a = this.array; |
1564 |
|
for (int i = lo; i < hi; ++i) { |
1711 |
|
compoundIndexedSelector(this.selector, selector)); |
1712 |
|
} |
1713 |
|
|
1714 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
1714 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
1715 |
|
(Op<? super T, ? extends U> op) { |
1716 |
|
return new OROMPap<T,U>(ex, origin, fence, array, selector, op); |
1717 |
|
} |
1741 |
|
return new ORLCPap<T>(ex, origin, fence, array, selector, mapper); |
1742 |
|
} |
1743 |
|
|
1744 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
1744 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
1745 |
|
final IntAndObjectPredicate s = selector; |
1746 |
|
final Object[] a = this.array; |
1747 |
|
for (int i = lo; i < hi; ++i) { |
1921 |
|
return new DRLCPap(ex, origin, fence, array, selector, mapper); |
1922 |
|
} |
1923 |
|
|
1924 |
< |
final void leafApply(int lo, int hi, DoubleProcedure procedure) { |
1924 |
> |
final void leafApply(int lo, int hi, DoubleProcedure procedure) { |
1925 |
|
final IntAndDoublePredicate s = selector; |
1926 |
|
final double[] a = this.array; |
1927 |
|
for (int i = lo; i < hi; ++i) { |
2101 |
|
return new LRLCPap(ex, origin, fence, array, selector, mapper); |
2102 |
|
} |
2103 |
|
|
2104 |
< |
final void leafApply(int lo, int hi, LongProcedure procedure) { |
2104 |
> |
final void leafApply(int lo, int hi, LongProcedure procedure) { |
2105 |
|
final IntAndLongPredicate s = selector; |
2106 |
|
final long[] a = this.array; |
2107 |
|
for (int i = lo; i < hi; ++i) { |
2229 |
|
|
2230 |
|
// Object-mapped |
2231 |
|
|
2232 |
< |
static abstract class OOMPap<T,U> extends ParallelArrayWithMapping<T,U> { |
2232 |
> |
abstract static class OOMPap<T,U> extends ParallelArrayWithMapping<T,U> { |
2233 |
|
final Op<? super T, ? extends U> op; |
2234 |
|
OOMPap(ForkJoinPool ex, int origin, int fence, |
2235 |
|
T[] array, |
2259 |
|
} |
2260 |
|
} |
2261 |
|
|
2262 |
< |
static abstract class DOMPap<U> extends ParallelDoubleArrayWithMapping<U> { |
2262 |
> |
abstract static class DOMPap<U> extends ParallelDoubleArrayWithMapping<U> { |
2263 |
|
final DoubleToObject<? extends U> op; |
2264 |
|
DOMPap(ForkJoinPool ex, int origin, int fence, |
2265 |
|
double[] array, DoubleToObject<? extends U> op) { |
2288 |
|
} |
2289 |
|
} |
2290 |
|
|
2291 |
< |
static abstract class LOMPap<U> extends ParallelLongArrayWithMapping<U> { |
2291 |
> |
abstract static class LOMPap<U> extends ParallelLongArrayWithMapping<U> { |
2292 |
|
final LongToObject<? extends U> op; |
2293 |
|
LOMPap(ForkJoinPool ex, int origin, int fence, |
2294 |
|
long[] array, LongToObject<? extends U> op) { |
2325 |
|
super(ex, origin, fence, array, op); |
2326 |
|
} |
2327 |
|
|
2328 |
< |
public <V> ParallelArrayWithMapping<T, V> withMapping |
2328 |
> |
public <V> ParallelArrayWithMapping<T,V> withMapping |
2329 |
|
(Op<? super U, ? extends V> op) { |
2330 |
|
return new OUOMPap<T,V>(ex, origin, fence, array, |
2331 |
|
CommonOps.compoundOp(this.op, op)); |
2361 |
|
compoundIndexedOp(this.op, mapper)); |
2362 |
|
} |
2363 |
|
|
2364 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2364 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2365 |
|
final Op f = op; |
2366 |
|
final Object[] a = this.array; |
2367 |
|
for (int i = lo; i < hi; ++i) |
2423 |
|
compoundIndexedOp(this.op, mapper)); |
2424 |
|
} |
2425 |
|
|
2426 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2426 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2427 |
|
final double[] a = this.array; |
2428 |
|
final DoubleToObject f = op; |
2429 |
|
for (int i = lo; i < hi; ++i) |
2485 |
|
compoundIndexedOp(this.op, mapper)); |
2486 |
|
} |
2487 |
|
|
2488 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2488 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2489 |
|
final long[] a = this.array; |
2490 |
|
final LongToObject f = op; |
2491 |
|
for (int i = lo; i < hi; ++i) |
2519 |
|
boolean hasFilter() { return true; } |
2520 |
|
boolean isSelected(int i) { return selector.op(this.array[i]); } |
2521 |
|
|
2522 |
< |
public <V> ParallelArrayWithMapping<T, V> withMapping |
2522 |
> |
public <V> ParallelArrayWithMapping<T,V> withMapping |
2523 |
|
(Op<? super U, ? extends V> op) { |
2524 |
|
return new OFOMPap<T,V> |
2525 |
|
(ex, origin, fence, array, selector, |
2556 |
|
compoundIndexedOp(this.op, mapper)); |
2557 |
|
} |
2558 |
|
|
2559 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2559 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2560 |
|
final Predicate s = selector; |
2561 |
|
final Object[] a = this.array; |
2562 |
|
final Op f = op; |
2644 |
|
compoundIndexedOp(this.op, mapper)); |
2645 |
|
} |
2646 |
|
|
2647 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2647 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2648 |
|
final DoublePredicate s = selector; |
2649 |
|
final DoubleToObject f = op; |
2650 |
|
final double[] a = this.array; |
2726 |
|
compoundIndexedOp(this.op, mapper)); |
2727 |
|
} |
2728 |
|
|
2729 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2729 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2730 |
|
final LongPredicate s = selector; |
2731 |
|
final LongToObject f = op; |
2732 |
|
final long[] a = this.array; |
2774 |
|
boolean hasFilter() { return true; } |
2775 |
|
boolean isSelected(int i) { return selector.op(i, this.array[i]); } |
2776 |
|
|
2777 |
< |
public <V> ParallelArrayWithMapping<T, V> withMapping |
2777 |
> |
public <V> ParallelArrayWithMapping<T,V> withMapping |
2778 |
|
(Op<? super U, ? extends V> op) { |
2779 |
|
return new OROMPap<T,V> |
2780 |
|
(ex, origin, fence, array, selector, |
2809 |
|
compoundIndexedOp(this.op, mapper)); |
2810 |
|
} |
2811 |
|
|
2812 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2812 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2813 |
|
final IntAndObjectPredicate s = selector; |
2814 |
|
final Object[] a = this.array; |
2815 |
|
final Op f = op; |
2897 |
|
compoundIndexedOp(this.op, mapper)); |
2898 |
|
} |
2899 |
|
|
2900 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2900 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2901 |
|
final IntAndDoublePredicate s = selector; |
2902 |
|
final DoubleToObject f = op; |
2903 |
|
final double[] a = this.array; |
2979 |
|
compoundIndexedOp(this.op, mapper)); |
2980 |
|
} |
2981 |
|
|
2982 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
2982 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
2983 |
|
final IntAndLongPredicate s = selector; |
2984 |
|
final LongToObject f = op; |
2985 |
|
final long[] a = this.array; |
3014 |
|
|
3015 |
|
// Object-combined |
3016 |
|
|
3017 |
< |
static abstract class OOCPap<T,U> extends ParallelArrayWithMapping<T,U> { |
3017 |
> |
abstract static class OOCPap<T,U> extends ParallelArrayWithMapping<T,U> { |
3018 |
|
final IntAndObjectToObject<? super T, ? extends U> op; |
3019 |
|
OOCPap(ForkJoinPool ex, int origin, int fence, |
3020 |
|
T[] array, |
3046 |
|
} |
3047 |
|
} |
3048 |
|
|
3049 |
< |
static abstract class DOCPap<U> extends ParallelDoubleArrayWithMapping<U> { |
3049 |
> |
abstract static class DOCPap<U> extends ParallelDoubleArrayWithMapping<U> { |
3050 |
|
final IntAndDoubleToObject<? extends U> op; |
3051 |
|
DOCPap(ForkJoinPool ex, int origin, int fence, |
3052 |
|
double[] array, IntAndDoubleToObject<? extends U> op) { |
3077 |
|
} |
3078 |
|
} |
3079 |
|
|
3080 |
< |
static abstract class LOCPap<U> extends ParallelLongArrayWithMapping<U> { |
3080 |
> |
abstract static class LOCPap<U> extends ParallelLongArrayWithMapping<U> { |
3081 |
|
final IntAndLongToObject<? extends U> op; |
3082 |
|
LOCPap(ForkJoinPool ex, int origin, int fence, |
3083 |
|
long[] array, IntAndLongToObject<? extends U> op) { |
3116 |
|
super(ex, origin, fence, array, op); |
3117 |
|
} |
3118 |
|
|
3119 |
< |
public <V> ParallelArrayWithMapping<T, V> withMapping |
3119 |
> |
public <V> ParallelArrayWithMapping<T,V> withMapping |
3120 |
|
(Op<? super U, ? extends V> op) { |
3121 |
|
return new OUOCPap<T,V>(ex, origin, fence, array, |
3122 |
|
compoundIndexedOp(this.op, op)); |
3152 |
|
compoundIndexedOp(this.op, mapper)); |
3153 |
|
} |
3154 |
|
|
3155 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3155 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3156 |
|
final IntAndObjectToObject f = op; |
3157 |
|
final Object[] a = this.array; |
3158 |
|
for (int i = lo; i < hi; ++i) |
3214 |
|
compoundIndexedOp(this.op, mapper)); |
3215 |
|
} |
3216 |
|
|
3217 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3217 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3218 |
|
final IntAndDoubleToObject f = op; |
3219 |
|
final double[] a = this.array; |
3220 |
|
for (int i = lo; i < hi; ++i) |
3276 |
|
compoundIndexedOp(this.op, mapper)); |
3277 |
|
} |
3278 |
|
|
3279 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3279 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3280 |
|
final IntAndLongToObject f = op; |
3281 |
|
final long[] a = this.array; |
3282 |
|
for (int i = lo; i < hi; ++i) |
3298 |
|
|
3299 |
|
// object-combined filtered |
3300 |
|
|
3301 |
< |
static final class OFOCPap<T,U> extends OOCPap<T,U> { |
3301 |
> |
static final class OFOCPap<T,U> extends OOCPap<T,U> { |
3302 |
|
final Predicate<? super T> selector; |
3303 |
|
OFOCPap(ForkJoinPool ex, int origin, int fence, |
3304 |
|
T[] array, Predicate<? super T> selector, |
3310 |
|
boolean hasFilter() { return true; } |
3311 |
|
boolean isSelected(int i) { return selector.op(this.array[i]); } |
3312 |
|
|
3313 |
< |
public <V> ParallelArrayWithMapping<T, V> withMapping |
3313 |
> |
public <V> ParallelArrayWithMapping<T,V> withMapping |
3314 |
|
(Op<? super U, ? extends V> op) { |
3315 |
|
return new OFOCPap<T,V>(ex, origin, fence, array, selector, |
3316 |
|
compoundIndexedOp(this.op, op)); |
3348 |
|
(this.op, mapper)); |
3349 |
|
} |
3350 |
|
|
3351 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3351 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3352 |
|
final Predicate s = selector; |
3353 |
|
final Object[] a = this.array; |
3354 |
|
final IntAndObjectToObject f = op; |
3428 |
|
compoundIndexedOp(this.op, mapper)); |
3429 |
|
} |
3430 |
|
|
3431 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3431 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3432 |
|
final DoublePredicate s = selector; |
3433 |
|
final double[] a = this.array; |
3434 |
|
final IntAndDoubleToObject f = op; |
3508 |
|
compoundIndexedOp(this.op, mapper)); |
3509 |
|
} |
3510 |
|
|
3511 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3511 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3512 |
|
final LongPredicate s = selector; |
3513 |
|
final long[] a = this.array; |
3514 |
|
final IntAndLongToObject f = op; |
3541 |
|
} |
3542 |
|
|
3543 |
|
// Object-combined, relational |
3544 |
< |
static final class OROCPap<T,U> extends OOCPap<T,U> { |
3544 |
> |
static final class OROCPap<T,U> extends OOCPap<T,U> { |
3545 |
|
final IntAndObjectPredicate<? super T> selector; |
3546 |
|
OROCPap(ForkJoinPool ex, int origin, int fence, |
3547 |
|
T[] array, IntAndObjectPredicate<? super T> selector, |
3553 |
|
boolean hasFilter() { return true; } |
3554 |
|
boolean isSelected(int i) { return selector.op(i, this.array[i]); } |
3555 |
|
|
3556 |
< |
public <V> ParallelArrayWithMapping<T, V> withMapping |
3556 |
> |
public <V> ParallelArrayWithMapping<T,V> withMapping |
3557 |
|
(Op<? super U, ? extends V> op) { |
3558 |
|
return new OROCPap<T,V>(ex, origin, fence, array, selector, |
3559 |
|
compoundIndexedOp(this.op, op)); |
3591 |
|
(this.op, mapper)); |
3592 |
|
} |
3593 |
|
|
3594 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3594 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3595 |
|
final IntAndObjectPredicate s = selector; |
3596 |
|
final Object[] a = this.array; |
3597 |
|
final IntAndObjectToObject f = op; |
3671 |
|
compoundIndexedOp(this.op, mapper)); |
3672 |
|
} |
3673 |
|
|
3674 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3674 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3675 |
|
final IntAndDoublePredicate s = selector; |
3676 |
|
final double[] a = this.array; |
3677 |
|
final IntAndDoubleToObject f = op; |
3751 |
|
compoundIndexedOp(this.op, mapper)); |
3752 |
|
} |
3753 |
|
|
3754 |
< |
void leafApply(int lo, int hi, Procedure procedure) { |
3754 |
> |
void leafApply(int lo, int hi, Procedure procedure) { |
3755 |
|
final IntAndLongPredicate s = selector; |
3756 |
|
final long[] a = this.array; |
3757 |
|
final IntAndLongToObject f = op; |
3785 |
|
|
3786 |
|
// Double-mapped |
3787 |
|
|
3788 |
< |
static abstract class ODMPap<T> extends ParallelArrayWithDoubleMapping<T> { |
3788 |
> |
abstract static class ODMPap<T> extends ParallelArrayWithDoubleMapping<T> { |
3789 |
|
final ObjectToDouble<? super T> op; |
3790 |
|
ODMPap(ForkJoinPool ex, int origin, int fence, |
3791 |
|
T[] array, ObjectToDouble<? super T> op) { |
3815 |
|
|
3816 |
|
} |
3817 |
|
|
3818 |
< |
static abstract class DDMPap extends ParallelDoubleArrayWithDoubleMapping { |
3818 |
> |
abstract static class DDMPap extends ParallelDoubleArrayWithDoubleMapping { |
3819 |
|
final DoubleOp op; |
3820 |
|
DDMPap |
3821 |
|
(ForkJoinPool ex, int origin, int fence, |
3845 |
|
} |
3846 |
|
} |
3847 |
|
|
3848 |
< |
static abstract class LDMPap extends ParallelLongArrayWithDoubleMapping { |
3848 |
> |
abstract static class LDMPap extends ParallelLongArrayWithDoubleMapping { |
3849 |
|
final LongToDouble op; |
3850 |
|
LDMPap(ForkJoinPool ex, int origin, int fence, |
3851 |
|
long[] array, LongToDouble op) { |
3893 |
|
CommonOps.compoundOp(this.op, op)); |
3894 |
|
} |
3895 |
|
|
3896 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
3896 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
3897 |
|
(DoubleToObject<? extends U> op) { |
3898 |
|
return new OUOMPap<T,U>(ex, origin, fence, array, |
3899 |
|
CommonOps.compoundOp(this.op, op)); |
4081 |
|
CommonOps.compoundOp(this.op, op)); |
4082 |
|
} |
4083 |
|
|
4084 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
4084 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
4085 |
|
(DoubleToObject<? extends U> op) { |
4086 |
|
return new OFOMPap<T,U>(ex, origin, fence, array, selector, |
4087 |
|
CommonOps.compoundOp(this.op, op)); |
4317 |
|
CommonOps.compoundOp(this.op, op)); |
4318 |
|
} |
4319 |
|
|
4320 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
4320 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
4321 |
|
(DoubleToObject<? extends U> op) { |
4322 |
|
return new OROMPap<T,U>(ex, origin, fence, array, selector, |
4323 |
|
CommonOps.compoundOp(this.op, op)); |
4531 |
|
} |
4532 |
|
|
4533 |
|
// double-combined |
4534 |
< |
static abstract class ODCPap<T> extends ParallelArrayWithDoubleMapping<T> { |
4534 |
> |
abstract static class ODCPap<T> extends ParallelArrayWithDoubleMapping<T> { |
4535 |
|
final IntAndObjectToDouble<? super T> op; |
4536 |
|
ODCPap(ForkJoinPool ex, int origin, int fence, |
4537 |
|
T[] array, IntAndObjectToDouble<? super T> op) { |
4563 |
|
|
4564 |
|
} |
4565 |
|
|
4566 |
< |
static abstract class DDCPap extends ParallelDoubleArrayWithDoubleMapping { |
4566 |
> |
abstract static class DDCPap extends ParallelDoubleArrayWithDoubleMapping { |
4567 |
|
final IntAndDoubleToDouble op; |
4568 |
|
DDCPap(ForkJoinPool ex, int origin, int fence, |
4569 |
|
double[] array, IntAndDoubleToDouble op) { |
4594 |
|
} |
4595 |
|
} |
4596 |
|
|
4597 |
< |
static abstract class LDCPap extends ParallelLongArrayWithDoubleMapping { |
4597 |
> |
abstract static class LDCPap extends ParallelLongArrayWithDoubleMapping { |
4598 |
|
final IntAndLongToDouble op; |
4599 |
|
LDCPap(ForkJoinPool ex, int origin, int fence, |
4600 |
|
long[] array, IntAndLongToDouble op) { |
4642 |
|
compoundIndexedOp(this.op, op)); |
4643 |
|
} |
4644 |
|
|
4645 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
4645 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
4646 |
|
(DoubleToObject<? extends U> op) { |
4647 |
|
return new OUOCPap<T,U>(ex, origin, fence, array, |
4648 |
|
compoundIndexedOp(this.op, op)); |
4829 |
|
compoundIndexedOp(this.op, op)); |
4830 |
|
} |
4831 |
|
|
4832 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
4832 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
4833 |
|
(DoubleToObject<? extends U> op) { |
4834 |
|
return new OFOCPap<T,U>(ex, origin, fence, array, selector, |
4835 |
|
compoundIndexedOp(this.op, op)); |
5067 |
|
compoundIndexedOp(this.op, op)); |
5068 |
|
} |
5069 |
|
|
5070 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
5070 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
5071 |
|
(DoubleToObject<? extends U> op) { |
5072 |
|
return new OROCPap<T,U>(ex, origin, fence, array, selector, |
5073 |
|
compoundIndexedOp(this.op, op)); |
5282 |
|
} |
5283 |
|
|
5284 |
|
// long-combined |
5285 |
< |
static abstract class OLMPap<T> extends ParallelArrayWithLongMapping<T> { |
5285 |
> |
abstract static class OLMPap<T> extends ParallelArrayWithLongMapping<T> { |
5286 |
|
final ObjectToLong<? super T> op; |
5287 |
|
OLMPap(ForkJoinPool ex, int origin, int fence, |
5288 |
|
T[] array, final ObjectToLong<? super T> op) { |
5311 |
|
} |
5312 |
|
} |
5313 |
|
|
5314 |
< |
static abstract class DLMPap extends ParallelDoubleArrayWithLongMapping { |
5314 |
> |
abstract static class DLMPap extends ParallelDoubleArrayWithLongMapping { |
5315 |
|
final DoubleToLong op; |
5316 |
|
DLMPap(ForkJoinPool ex, int origin, int fence, |
5317 |
|
double[] array, DoubleToLong op) { |
5341 |
|
|
5342 |
|
} |
5343 |
|
|
5344 |
< |
static abstract class LLMPap extends ParallelLongArrayWithLongMapping { |
5344 |
> |
abstract static class LLMPap extends ParallelLongArrayWithLongMapping { |
5345 |
|
final LongOp op; |
5346 |
|
LLMPap(ForkJoinPool ex, int origin, int fence, |
5347 |
|
long[] array, LongOp op) { |
5388 |
|
CommonOps.compoundOp(this.op, op)); |
5389 |
|
} |
5390 |
|
|
5391 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
5391 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
5392 |
|
(LongToObject<? extends U> op) { |
5393 |
|
return new OUOMPap<T,U>(ex, origin, fence, array, |
5394 |
|
CommonOps.compoundOp(this.op, op)); |
5577 |
|
CommonOps.compoundOp(this.op, op)); |
5578 |
|
} |
5579 |
|
|
5580 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
5580 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
5581 |
|
(LongToObject<? extends U> op) { |
5582 |
|
return new OFOMPap<T,U>(ex, origin, fence, array, selector, |
5583 |
|
CommonOps.compoundOp(this.op, op)); |
5817 |
|
CommonOps.compoundOp(this.op, op)); |
5818 |
|
} |
5819 |
|
|
5820 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
5820 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
5821 |
|
(LongToObject<? extends U> op) { |
5822 |
|
return new OROMPap<T,U>(ex, origin, fence, array, selector, |
5823 |
|
CommonOps.compoundOp(this.op, op)); |
6033 |
|
} |
6034 |
|
|
6035 |
|
// long-combined |
6036 |
< |
static abstract class OLCPap<T> extends ParallelArrayWithLongMapping<T> { |
6036 |
> |
abstract static class OLCPap<T> extends ParallelArrayWithLongMapping<T> { |
6037 |
|
final IntAndObjectToLong<? super T> op; |
6038 |
|
OLCPap(ForkJoinPool ex, int origin, int fence, |
6039 |
|
T[] array, IntAndObjectToLong<? super T> op) { |
6064 |
|
} |
6065 |
|
} |
6066 |
|
|
6067 |
< |
static abstract class DLCPap extends ParallelDoubleArrayWithLongMapping { |
6067 |
> |
abstract static class DLCPap extends ParallelDoubleArrayWithLongMapping { |
6068 |
|
final IntAndDoubleToLong op; |
6069 |
|
DLCPap(ForkJoinPool ex, int origin, int fence, |
6070 |
|
double[] array, IntAndDoubleToLong op) { |
6095 |
|
} |
6096 |
|
} |
6097 |
|
|
6098 |
< |
static abstract class LLCPap extends ParallelLongArrayWithLongMapping { |
6098 |
> |
abstract static class LLCPap extends ParallelLongArrayWithLongMapping { |
6099 |
|
final IntAndLongToLong op; |
6100 |
|
LLCPap(ForkJoinPool ex, int origin, int fence, |
6101 |
|
long[] array, IntAndLongToLong op) { |
6143 |
|
compoundIndexedOp(this.op, op)); |
6144 |
|
} |
6145 |
|
|
6146 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
6146 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
6147 |
|
(LongToObject<? extends U> op) { |
6148 |
|
return new OUOCPap<T,U>(ex, origin, fence, array, |
6149 |
|
compoundIndexedOp(this.op, op)); |
6328 |
|
compoundIndexedOp(this.op, op)); |
6329 |
|
} |
6330 |
|
|
6331 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
6331 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
6332 |
|
(LongToObject<? extends U> op) { |
6333 |
|
return new OFOCPap<T,U>(ex, origin, fence, array, |
6334 |
|
selector, |
6570 |
|
compoundIndexedOp(this.op, op)); |
6571 |
|
} |
6572 |
|
|
6573 |
< |
public <U> ParallelArrayWithMapping<T, U> withMapping |
6573 |
> |
public <U> ParallelArrayWithMapping<T,U> withMapping |
6574 |
|
(LongToObject<? extends U> op) { |
6575 |
|
return new OROCPap<T,U>(ex, origin, fence, array, |
6576 |
|
selector, |
6820 |
|
int cursor; |
6821 |
|
FilteredAsDoubleIterator() { |
6822 |
|
cursor = origin; |
6823 |
< |
advance() ; |
6823 |
> |
advance(); |
6824 |
|
} |
6825 |
|
private void advance() { |
6826 |
|
while (cursor < fence) { |
6873 |
|
int cursor; |
6874 |
|
FilteredAsLongIterator() { |
6875 |
|
cursor = origin; |
6876 |
< |
advance() ; |
6876 |
> |
advance(); |
6877 |
|
} |
6878 |
|
private void advance() { |
6879 |
|
while (cursor < fence) { |
6926 |
|
int cursor; |
6927 |
|
FilteredIterator() { |
6928 |
|
cursor = origin; |
6929 |
< |
advance() ; |
6929 |
> |
advance(); |
6930 |
|
} |
6931 |
|
private void advance() { |
6932 |
|
while (cursor < fence) { |
7883 |
|
}; |
7884 |
|
} |
7885 |
|
|
7886 |
< |
static IntAndDoublePredicate compoundIndexedSelector |
7886 |
> |
static IntAndDoublePredicate compoundIndexedSelector |
7887 |
|
(final IntAndDoublePredicate fst, final IntAndDoublePredicate snd) { |
7888 |
|
return new IntAndDoublePredicate() { |
7889 |
|
public boolean op(int i, double a) { return fst.op(i, a) && snd.op(i, a); } |
7890 |
|
}; |
7891 |
|
} |
7892 |
|
|
7893 |
< |
static IntAndDoublePredicate compoundIndexedSelector |
7893 |
> |
static IntAndDoublePredicate compoundIndexedSelector |
7894 |
|
(final IntAndDoublePredicate fst, final DoublePredicate snd) { |
7895 |
|
return new IntAndDoublePredicate() { |
7896 |
|
public boolean op(int i, double a) { return fst.op(i, a) && snd.op(a); } |
7904 |
|
}; |
7905 |
|
} |
7906 |
|
|
7907 |
< |
static IntAndLongPredicate compoundIndexedSelector |
7907 |
> |
static IntAndLongPredicate compoundIndexedSelector |
7908 |
|
(final IntAndLongPredicate fst, final IntAndLongPredicate snd) { |
7909 |
|
return new IntAndLongPredicate() { |
7910 |
|
public boolean op(int i, long a) { return fst.op(i, a) && snd.op(i, a); } |
7911 |
|
}; |
7912 |
|
} |
7913 |
|
|
7914 |
< |
static IntAndLongPredicate compoundIndexedSelector |
7914 |
> |
static IntAndLongPredicate compoundIndexedSelector |
7915 |
|
(final IntAndLongPredicate fst, final LongPredicate snd) { |
7916 |
|
return new IntAndLongPredicate() { |
7917 |
|
public boolean op(int i, long a) { return fst.op(i, a) && snd.op(a); } |