Algorithm 3. Parallel UNWOUNDSUM.
1: function PARALLEL_UNWOUNDSUM(m, pz, po, pi) |
2: l = len(m) |
3: sum = [] array of l zeroes |
4: for to l + 1 in parallel, do |
5: next = shuffle(mi.w, l) |
6: for to 1 do |
7: wj = shuffle(mi.w, j) |
8: tmp = (next ⋅ (l − 1) + 1)/j |
9: sumi = sumi + tmp ⋅ po |
10: next = wj − tmp ⋅ (l − j) ⋅ pz/l |
11: sumi = sumi + (1 − po) ⋅ wj ⋅ l/((l − j) ⋅ pz) |
12: return sum |