INNER CODE UNIT · Python
complexity
lschoe/mpyc · demos/PrefixOrExplained.py:134
def complexity(pf, n):
# We take the all-zero list as input (complexity is data-independent anyway):
x = [secint(0) for _ in range(n)]
secint.or_complexity = 0
y = pf(x)
or_depths = [a.or_depth for a in y]
print(f'or-complexity: {secint.or_complexity}')
print(f'or-depth: {max(or_depths)} (per output element: {or_depths})')
# In[8]:
correctness(prefix_or0)
correctness(prefix_or1)
# In[9]: