In1d

Usage

use In1d;

or

import In1d;
proc in1d(ar1: [?aD1] ?t, ref ar2: [?aD2] t, invert: bool = false): [aD1] bool throws

For each value in the first array, check membership in the second array.

Arguments
  • ar1 : [] int – array to broadcast in parallel over ar2

  • ar2 : [] int – array to be broadcast over in parallel

  • invert : bool – should the result be inverted (not in1d)

Returns truth

the distributed boolean array containing the result of ar1 being broadcast over ar2

proc in1dAr2PerLocAssoc(ar1: [?aD1] ?t, ref ar2: [?aD2] t) throws

in1d that uses a per-locale set/associative-domain. Each locale will * localize ar2 and put it in the set, so only appropriate in terms of * size and space when ar2 is “small”.

proc in1dSort(ar1: [?aD1] ?t, ar2: [?aD2] t) throws

in1d that uses a sorting strategy. At a high level it uniques both * arrays, finds the intersecting values, then maps back to the original * domain of ar1. Scales well with time/size, but sort has non-trivial * overhead so typically used when ar2 is “large”.

proc indexof1d(keys: ?t, arr: t) throws