Skip to content

Commit 90d3b01

Browse files
author
Martin Benes
committed
added kw to optim search
1 parent 60e1a66 commit 90d3b01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

conseal/simulate/_optim.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def calc_lambda(
181181
n: int,
182182
objective: Callable = None,
183183
alpha_max: float = 1,
184+
**kw,
184185
) -> float:
185186
"""Implements binary search for lambda.
186187
@@ -222,7 +223,7 @@ def calc_lambda(
222223
l3 *= 2
223224

224225
# Compute total entropy m3
225-
_, m3 = objective(lbda=l3, rhos=rhos) # objective function
226+
_, m3 = objective(lbda=l3, rhos=rhos, **kw) # objective function
226227

227228
iterations += 1
228229

@@ -245,7 +246,7 @@ def calc_lambda(
245246
lbda = l1 + (l3 - l1) / 2
246247

247248
# Calculate entropy at the mid of the interval
248-
_, m2 = objective(lbda=lbda, rhos=rhos) # objective function
249+
_, m2 = objective(lbda=lbda, rhos=rhos, **kw) # objective function
249250

250251
# binary search
251252
if m2 < m:

0 commit comments

Comments
 (0)