Skip to content

Commit 085220b

Browse files
committed
RFC: minmax: Fix redundancy
1 parent 62c2d55 commit 085220b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

quantecon/optimize/minmax.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
import numpy as np
66
from numba import jit
7-
from .linprog_simplex import _set_criterion_row, solve_tableau, PivOptions
7+
from .linprog_simplex import solve_tableau, PivOptions
88
from .pivoting import _pivoting
99

1010

@@ -45,10 +45,10 @@ def minmax(A, max_iter=10**6, piv_options=PivOptions()):
4545
Value :math:`v^*` of the minmax problem.
4646
4747
x : ndarray(float, ndim=1)
48-
Optimal solution :math:`x^*`, of shape (,m).
48+
Optimal solution :math:`x^*`, of shape (m,).
4949
5050
y : ndarray(float, ndim=1)
51-
Optimal solution :math:`y^*`, of shape (,n).
51+
Optimal solution :math:`y^*`, of shape (n,).
5252
5353
"""
5454
m, n = A.shape
@@ -68,6 +68,7 @@ def minmax(A, max_iter=10**6, piv_options=PivOptions()):
6868

6969
tableau[-2, :n] = 1
7070
tableau[-2, -1] = 1
71+
tableau[-1, n] = -1
7172

7273
# Phase 1
7374
pivcol = 0
@@ -86,11 +87,6 @@ def minmax(A, max_iter=10**6, piv_options=PivOptions()):
8687
basis[pivrow] = n
8788
basis[-1] = 0
8889

89-
# Modify the criterion row for Phase 2
90-
c = np.zeros(n+1)
91-
c[-1] = -1
92-
_set_criterion_row(c, basis, tableau)
93-
9490
# Phase 2
9591
solve_tableau(tableau, basis, max_iter-2, skip_aux=False,
9692
piv_options=piv_options)

0 commit comments

Comments
 (0)