Skip to content

Commit

Permalink
lemke_howson: Add cache=True
Browse files Browse the repository at this point in the history
  • Loading branch information
oyamad committed Nov 14, 2016
1 parent 918c687 commit 2c2f54b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions quantecon/game_theory/lemke_howson.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def lemke_howson(g, init_pivot=0, max_iter=10**6, full_output=False):
return NE, res


@jit(nopython=True)
@jit(nopython=True, cache=True)
def initialize_tableaux(payoff_matrices, tableaux, bases):
"""
Given a tuple of payoff matrices, initialize the tableau and basis
Expand Down Expand Up @@ -224,7 +224,7 @@ def initialize_tableaux(payoff_matrices, tableaux, bases):
return tableaux, bases


@jit(nopython=True)
@jit(nopython=True, cache=True)
def lemke_howson_tbl(tableaux, bases, init_pivot, max_iter):
"""
Main body of the Lemke-Howson algorithm implementation.
Expand Down Expand Up @@ -327,7 +327,7 @@ def lemke_howson_tbl(tableaux, bases, init_pivot, max_iter):
return converged, num_iter


@jit(nopython=True)
@jit(nopython=True, cache=True)
def pivoting(tableau, pivot, pivot_row):
"""
Perform a pivoting step. Modify `tableau` in place.
Expand Down Expand Up @@ -367,7 +367,7 @@ def pivoting(tableau, pivot, pivot_row):
return tableau


@jit(nopython=True)
@jit(nopython=True, cache=True)
def min_ratio_test_no_tie_breaking(tableau, pivot, test_col,
argmins, num_candidates):
"""
Expand Down Expand Up @@ -420,7 +420,7 @@ def min_ratio_test_no_tie_breaking(tableau, pivot, test_col,
return num_argmins


@jit(nopython=True)
@jit(nopython=True, cache=True)
def lex_min_ratio_test(tableau, pivot, slack_start, argmins):
"""
Perform the lexico-minimum ratio test.
Expand Down Expand Up @@ -468,7 +468,7 @@ def lex_min_ratio_test(tableau, pivot, slack_start, argmins):
return argmins[0]


@jit(nopython=True)
@jit(nopython=True, cache=True)
def get_mixed_actions(tableaux, bases):
"""
From `tableaux` and `bases`, extract non-slack basic variables and
Expand Down

0 comments on commit 2c2f54b

Please sign in to comment.