Skip to content

Commit 24f4329

Browse files
committed
Fix disabling PRSS.
1 parent 15f747c commit 24f4329

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

demos/PrefixOrExplained.ipynb

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"name": "stdout",
1919
"output_type": "stream",
2020
"text": [
21-
"2024-10-08 16:31:45,984 Start MPyC runtime v0.10.3\n"
21+
"2024-10-21 10:53:07,251 Start MPyC runtime v0.10.3\n"
2222
]
2323
}
2424
],
@@ -444,9 +444,10 @@
444444
}
445445
],
446446
"source": [
447+
"no_prss = mpc.options.no_prss\n",
447448
"mpc.options.no_prss = True # disable PRSS temporarily\n",
448449
"complexity(prefix_or1, 32)\n",
449-
"mpc.options.no_prss = False # back to default"
450+
"mpc.options.no_prss = no_prss"
450451
]
451452
},
452453
{
@@ -1004,7 +1005,7 @@
10041005
"name": "stdout",
10051006
"output_type": "stream",
10061007
"text": [
1007-
"2024-10-08 16:31:47,297 Stop MPyC -- elapsed time: 0:00:01.311|bytes sent: 0\n"
1008+
"2024-10-21 10:53:09,859 Stop MPyC -- elapsed time: 0:00:02.607|bytes sent: 0\n"
10081009
]
10091010
}
10101011
],

demos/PrefixOrExplained.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@ def prefix_or2(x):
202202
# In[13]:
203203

204204

205+
no_prss = mpc.options.no_prss
205206
mpc.options.no_prss = True # disable PRSS temporarily
206207
complexity(prefix_or1, 32)
207-
mpc.options.no_prss = False # back to default
208+
mpc.options.no_prss = no_prss
208209

209210

210211
# 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.

0 commit comments

Comments
 (0)