Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion quantecon/optimize/lcp_lemke.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def lcp_lemke(M, q, d=None, max_iter=10**6, piv_options=PivOptions(),
ratio = q[i] / d[i]
if ratio <= ratio_min + piv_options.tol_ratio_diff:
pivrow = i
ratio = ratio_min
ratio_min = ratio

_pivoting(tableau, pivcol, pivrow)
basis[pivrow], pivcol = pivcol, pivrow + n
Expand Down
10 changes: 10 additions & 0 deletions quantecon/optimize/tests/test_lcp_lemke.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,13 @@ def test_bimatrix_game(self):

res = lcp_lemke(M, q)
_assert_success(res, M, q)

def test_bug_768(self):
n = 10
seed = 0
rng = np.random.RandomState(seed)
A = rng.standard_normal((n, n))
M = A.T @ A + np.eye(n)
q = rng.standard_normal(n)
res = lcp_lemke(M, q)
_assert_success(res, M, q)
Loading