Skip to content

Commit

Permalink
Fix disabling PRSS.
Browse files Browse the repository at this point in the history
  • Loading branch information
lschoe committed Oct 21, 2024
1 parent 15f747c commit 24f4329
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions demos/PrefixOrExplained.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"2024-10-08 16:31:45,984 Start MPyC runtime v0.10.3\n"
"2024-10-21 10:53:07,251 Start MPyC runtime v0.10.3\n"
]
}
],
Expand Down Expand Up @@ -444,9 +444,10 @@
}
],
"source": [
"no_prss = mpc.options.no_prss\n",
"mpc.options.no_prss = True # disable PRSS temporarily\n",
"complexity(prefix_or1, 32)\n",
"mpc.options.no_prss = False # back to default"
"mpc.options.no_prss = no_prss"
]
},
{
Expand Down Expand Up @@ -1004,7 +1005,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"2024-10-08 16:31:47,297 Stop MPyC -- elapsed time: 0:00:01.311|bytes sent: 0\n"
"2024-10-21 10:53:09,859 Stop MPyC -- elapsed time: 0:00:02.607|bytes sent: 0\n"
]
}
],
Expand Down
3 changes: 2 additions & 1 deletion demos/PrefixOrExplained.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ def prefix_or2(x):
# In[13]:


no_prss = mpc.options.no_prss
mpc.options.no_prss = True # disable PRSS temporarily
complexity(prefix_or1, 32)
mpc.options.no_prss = False # back to default
mpc.options.no_prss = no_prss


# The or-complexity is now reduced to $2n-2-\log_2 n$ for inputs of length $n=2^k$. The trade-off is that the or-depth increases by almost a factor of 2, as it becomes $2\log_2 n -2$. The underlying method due to Brent–Kung is explained in Section 3.
Expand Down

0 comments on commit 24f4329

Please sign in to comment.