47 |
|
} |
48 |
|
|
49 |
|
static class Evens implements Ops.IntToObject<Long> { |
50 |
< |
public Long op(int i) { |
50 |
> |
public Long op(int i) { |
51 |
|
return Long.valueOf((long)(i << 1)); |
52 |
|
} |
53 |
|
} |
252 |
|
|
253 |
|
// ............ |
254 |
|
|
255 |
< |
static void seqRemoveAll(ParallelArray<Long> pa, |
255 |
> |
static void seqRemoveAll(ParallelArray<Long> pa, |
256 |
|
Ops.Predicate<Long> selector) { |
257 |
|
Long[] a = pa.getArray(); |
258 |
|
int n = pa.size(); |
267 |
|
pa.setLimit(k); |
268 |
|
} |
269 |
|
|
270 |
< |
static ArrayList<Long> seqSelectAll(ParallelArray<Long> pa, |
270 |
> |
static ArrayList<Long> seqSelectAll(ParallelArray<Long> pa, |
271 |
|
Ops.Predicate<Long> selector) { |
272 |
|
ArrayList<Long> al = new ArrayList<Long>(); |
273 |
|
Long[] a = pa.getArray(); |
283 |
|
static Long[] seqUnique(Long[] a) { |
284 |
|
int n = a.length; |
285 |
|
HashSet<Long> m = new HashSet<Long>(n); |
286 |
< |
for (int i = 0; i < n; ++i) |
286 |
> |
for (int i = 0; i < n; ++i) |
287 |
|
m.add(a[i]); |
288 |
|
int ul = m.size(); |
289 |
|
Long[] u = new Long[ul]; |
292 |
|
u[k++] = e; |
293 |
|
return u; |
294 |
|
} |
295 |
< |
|
295 |
> |
|
296 |
|
static void checkSorted (ParallelArray<Long> pa) { |
297 |
|
int n = pa.size(); |
298 |
|
for (int i = 0; i < n - 1; i++) { |
301 |
|
} |
302 |
|
} |
303 |
|
} |
304 |
< |
|
304 |
> |
|
305 |
|
static final class RandomLongGenerator implements Ops.Generator<Long> { |
306 |
|
public Long op() { |
307 |
|
return new Long(ThreadLocalRandom.current().nextLong(maxValue)); |