4
4
"""
5
5
import numpy as np
6
6
from numba import jit
7
- from .linprog_simplex import _set_criterion_row , solve_tableau , PivOptions
7
+ from .linprog_simplex import solve_tableau , PivOptions
8
8
from .pivoting import _pivoting
9
9
10
10
@@ -45,10 +45,10 @@ def minmax(A, max_iter=10**6, piv_options=PivOptions()):
45
45
Value :math:`v^*` of the minmax problem.
46
46
47
47
x : ndarray(float, ndim=1)
48
- Optimal solution :math:`x^*`, of shape (,m ).
48
+ Optimal solution :math:`x^*`, of shape (m, ).
49
49
50
50
y : ndarray(float, ndim=1)
51
- Optimal solution :math:`y^*`, of shape (,n ).
51
+ Optimal solution :math:`y^*`, of shape (n, ).
52
52
53
53
"""
54
54
m , n = A .shape
@@ -68,6 +68,7 @@ def minmax(A, max_iter=10**6, piv_options=PivOptions()):
68
68
69
69
tableau [- 2 , :n ] = 1
70
70
tableau [- 2 , - 1 ] = 1
71
+ tableau [- 1 , n ] = - 1
71
72
72
73
# Phase 1
73
74
pivcol = 0
@@ -86,11 +87,6 @@ def minmax(A, max_iter=10**6, piv_options=PivOptions()):
86
87
basis [pivrow ] = n
87
88
basis [- 1 ] = 0
88
89
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
-
94
90
# Phase 2
95
91
solve_tableau (tableau , basis , max_iter - 2 , skip_aux = False ,
96
92
piv_options = piv_options )
0 commit comments