INNER CODE UNIT · Python

y0

lschoe/mpyc · demos/PrefixOrExplained.py:227

    y0 = prefix_or3(x[:n//2])
    y1 = prefix_or3(x[n//2:])
    a = y0[-1]
    return y0 + [a | b for b in y1]  # all |s in parallel in 1 round


# In[15]:


correctness(prefix_or3)
complexity(prefix_or3, 8)


# The actual implementation in `mpyc.mpctools.accumulate()` is slightly more advanced, as we want to avoid excessive copying of lists.

# In[16]:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…