5 |
|
*/ |
6 |
|
|
7 |
|
package extra166y; |
8 |
+ |
|
9 |
|
import jsr166y.*; |
10 |
|
import static extra166y.Ops.*; |
11 |
|
import java.util.*; |
25 |
|
} |
26 |
|
|
27 |
|
/** |
28 |
< |
* Applies the given procedure |
28 |
> |
* Applies the given procedure. |
29 |
|
* @param procedure the procedure |
30 |
|
*/ |
31 |
|
public void apply(LongProcedure procedure) { |
33 |
|
} |
34 |
|
|
35 |
|
/** |
36 |
< |
* Returns reduction of mapped elements |
36 |
> |
* Returns reduction of mapped elements. |
37 |
|
* @param reducer the reducer |
38 |
|
* @param base the result for an empty array |
39 |
|
* @return reduction |
46 |
|
} |
47 |
|
|
48 |
|
/** |
49 |
< |
* Returns the minimum element, or Long.MAX_VALUE if empty |
49 |
> |
* Returns the minimum element, or Long.MAX_VALUE if empty. |
50 |
|
* @return minimum element, or Long.MAX_VALUE if empty |
51 |
|
*/ |
52 |
|
public long min() { |
54 |
|
} |
55 |
|
|
56 |
|
/** |
57 |
< |
* Returns the minimum element, or Long.MAX_VALUE if empty |
57 |
> |
* Returns the minimum element, or Long.MAX_VALUE if empty. |
58 |
|
* @param comparator the comparator |
59 |
|
* @return minimum element, or Long.MAX_VALUE if empty |
60 |
|
*/ |
63 |
|
} |
64 |
|
|
65 |
|
/** |
66 |
< |
* Returns the maximum element, or Long.MIN_VALUE if empty |
66 |
> |
* Returns the maximum element, or Long.MIN_VALUE if empty. |
67 |
|
* @return maximum element, or Long.MIN_VALUE if empty |
68 |
|
*/ |
69 |
|
public long max() { |
71 |
|
} |
72 |
|
|
73 |
|
/** |
74 |
< |
* Returns the maximum element, or Long.MIN_VALUE if empty |
74 |
> |
* Returns the maximum element, or Long.MIN_VALUE if empty. |
75 |
|
* @param comparator the comparator |
76 |
|
* @return maximum element, or Long.MIN_VALUE if empty |
77 |
|
*/ |
80 |
|
} |
81 |
|
|
82 |
|
/** |
83 |
< |
* Returns the sum of elements |
83 |
> |
* Returns the sum of elements. |
84 |
|
* @return the sum of elements |
85 |
|
*/ |
86 |
|
public long sum() { |
88 |
|
} |
89 |
|
|
90 |
|
/** |
91 |
< |
* Returns summary statistics |
91 |
> |
* Returns summary statistics. |
92 |
|
* @param comparator the comparator to use for |
93 |
|
* locating minimum and maximum elements |
94 |
< |
* @return the summary. |
94 |
> |
* @return the summary |
95 |
|
*/ |
96 |
|
public ParallelLongArray.SummaryStatistics summary |
97 |
|
(LongComparator comparator) { |
102 |
|
} |
103 |
|
|
104 |
|
/** |
105 |
< |
* Returns summary statistics, using natural comparator |
106 |
< |
* @return the summary. |
105 |
> |
* Returns summary statistics, using natural comparator. |
106 |
> |
* @return the summary |
107 |
|
*/ |
108 |
|
public ParallelLongArray.SummaryStatistics summary() { |
109 |
|
return summary(CommonOps.naturalLongComparator()); |
110 |
|
} |
111 |
|
|
112 |
|
/** |
113 |
< |
* Returns a new ParallelLongArray holding mappings |
113 |
> |
* Returns a new ParallelLongArray holding mappings. |
114 |
|
* @return a new ParallelLongArray holding mappings |
115 |
|
*/ |
116 |
|
public ParallelLongArray all() { |
151 |
|
* @param other the other array |
152 |
|
* @return operation prefix |
153 |
|
* @throws IllegalArgumentException if other array is a |
154 |
< |
* filtered view (all filters must precede all mappings). |
154 |
> |
* filtered view (all filters must precede all mappings) |
155 |
|
*/ |
156 |
|
public <V,W,X> ParallelDoubleArrayWithMapping<W> withMapping |
157 |
|
(LongAndObjectToObject<? super V, ? extends W> combiner, |
167 |
|
* @param other the other array |
168 |
|
* @return operation prefix |
169 |
|
* @throws IllegalArgumentException if other array is a |
170 |
< |
* filtered view (all filters must precede all mappings). |
170 |
> |
* filtered view (all filters must precede all mappings) |
171 |
|
*/ |
172 |
|
public <V> ParallelDoubleArrayWithMapping<V> withMapping |
173 |
|
(LongAndDoubleToObject<? extends V> combiner, |
183 |
|
* @param other the other array |
184 |
|
* @return operation prefix |
185 |
|
* @throws IllegalArgumentException if other array is a |
186 |
< |
* filtered view (all filters must precede all mappings). |
186 |
> |
* filtered view (all filters must precede all mappings) |
187 |
|
*/ |
188 |
|
public <V> ParallelDoubleArrayWithMapping<V> withMapping |
189 |
|
(LongAndLongToObject<? extends V> combiner, |
199 |
|
* @param other the other array |
200 |
|
* @return operation prefix |
201 |
|
* @throws IllegalArgumentException if other array is a |
202 |
< |
* filtered view (all filters must precede all mappings). |
202 |
> |
* filtered view (all filters must precede all mappings) |
203 |
|
*/ |
204 |
|
public <V,W> ParallelDoubleArrayWithDoubleMapping withMapping |
205 |
|
(LongAndObjectToDouble<? super V> combiner, |
215 |
|
* @param other the other array |
216 |
|
* @return operation prefix |
217 |
|
* @throws IllegalArgumentException if other array is a |
218 |
< |
* filtered view (all filters must precede all mappings). |
218 |
> |
* filtered view (all filters must precede all mappings) |
219 |
|
*/ |
220 |
|
public ParallelDoubleArrayWithDoubleMapping withMapping |
221 |
|
(LongAndDoubleToDouble combiner, |
231 |
|
* @param other the other array |
232 |
|
* @return operation prefix |
233 |
|
* @throws IllegalArgumentException if other array is a |
234 |
< |
* filtered view (all filters must precede all mappings). |
234 |
> |
* filtered view (all filters must precede all mappings) |
235 |
|
*/ |
236 |
|
public ParallelDoubleArrayWithDoubleMapping withMapping |
237 |
|
(LongAndLongToDouble combiner, |
247 |
|
* @param other the other array |
248 |
|
* @return operation prefix |
249 |
|
* @throws IllegalArgumentException if other array is a |
250 |
< |
* filtered view (all filters must precede all mappings). |
250 |
> |
* filtered view (all filters must precede all mappings) |
251 |
|
*/ |
252 |
|
public <V,W> ParallelDoubleArrayWithLongMapping withMapping |
253 |
|
(LongAndObjectToLong<? super V> combiner, |
263 |
|
* @param other the other array |
264 |
|
* @return operation prefix |
265 |
|
* @throws IllegalArgumentException if other array is a |
266 |
< |
* filtered view (all filters must precede all mappings). |
266 |
> |
* filtered view (all filters must precede all mappings) |
267 |
|
*/ |
268 |
|
public ParallelDoubleArrayWithLongMapping withMapping |
269 |
|
(LongAndDoubleToLong combiner, |
279 |
|
* @param other the other array |
280 |
|
* @return operation prefix |
281 |
|
* @throws IllegalArgumentException if other array is a |
282 |
< |
* filtered view (all filters must precede all mappings). |
282 |
> |
* filtered view (all filters must precede all mappings) |
283 |
|
*/ |
284 |
|
public ParallelDoubleArrayWithLongMapping withMapping |
285 |
|
(BinaryLongOp combiner, |
327 |
|
/** |
328 |
|
* Returns an Iterable view to sequentially step through mapped |
329 |
|
* elements also obeying bound and filter constraints, without |
330 |
< |
* performing computations to evaluate them in parallel |
330 |
> |
* performing computations to evaluate them in parallel. |
331 |
|
* @return the Iterable view |
332 |
|
*/ |
333 |
|
public Iterable<Long> sequentially() { |