45 |
|
} |
46 |
|
|
47 |
|
static class Evens implements Ops.IntToObject<Long> { |
48 |
< |
public Long op(int i) { |
48 |
> |
public Long op(int i) { |
49 |
|
return Long.valueOf((long)(i << 1)); |
50 |
|
} |
51 |
|
} |
250 |
|
|
251 |
|
// ............ |
252 |
|
|
253 |
< |
static void seqRemoveAll(ParallelArray<Long> pa, |
253 |
> |
static void seqRemoveAll(ParallelArray<Long> pa, |
254 |
|
Ops.Predicate<Long> selector) { |
255 |
|
Long[] a = pa.getArray(); |
256 |
|
int n = pa.size(); |
265 |
|
pa.setLimit(k); |
266 |
|
} |
267 |
|
|
268 |
< |
static ArrayList<Long> seqSelectAll(ParallelArray<Long> pa, |
268 |
> |
static ArrayList<Long> seqSelectAll(ParallelArray<Long> pa, |
269 |
|
Ops.Predicate<Long> selector) { |
270 |
|
ArrayList<Long> al = new ArrayList<Long>(); |
271 |
|
Long[] a = pa.getArray(); |
281 |
|
static Long[] seqUnique(Long[] a) { |
282 |
|
int n = a.length; |
283 |
|
HashSet<Long> m = new HashSet<Long>(n); |
284 |
< |
for (int i = 0; i < n; ++i) |
284 |
> |
for (int i = 0; i < n; ++i) |
285 |
|
m.add(a[i]); |
286 |
|
int ul = m.size(); |
287 |
|
Long[] u = new Long[ul]; |
290 |
|
u[k++] = e; |
291 |
|
return u; |
292 |
|
} |
293 |
< |
|
293 |
> |
|
294 |
|
static void checkSorted (ParallelArray<Long> pa) { |
295 |
|
int n = pa.size(); |
296 |
|
for (int i = 0; i < n - 1; i++) { |
299 |
|
} |
300 |
|
} |
301 |
|
} |
302 |
< |
|
302 |
> |
|
303 |
|
static final class RandomLongGenerator implements Ops.Generator<Long> { |
304 |
|
public Long op() { |
305 |
|
return new Long(ThreadLocalRandom.current().nextLong(maxValue)); |