44"""
55import numpy as np
66from numba import jit
7- from .linprog_simplex import _set_criterion_row , solve_tableau , PivOptions
7+ from .linprog_simplex import solve_tableau , PivOptions
88from .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