22Contain `linprog_simplex`, a Numba-jitted linear programming solver
33based on the Simplex Method.
44
5- The formulation of linear program `linprog_simplex` assumes is:
5+ The formulation of linear program that `linprog_simplex` assumes is:
66
77maximize::
88
1616
1717Examples
1818--------
19- 1. A problem inequality constraints:
19+ 1. A problem with inequality constraints:
2020
2121 .. math::
2222
4949 >>> res.lambd
5050 array([0.45, 0.25, 1.1 ])
5151
52- 2. A problem equality constraints:
52+ 2. A problem with equality constraints:
5353
5454 .. math::
5555
9999
100100 .. math::
101101
102- \max_{z_0, z_1, z_2}\ \ & z_0 + z_1 - 4z_2 \\
103- \mbox{such that}\ \ & -3z_0 - 3z_1 + z_2 \leq 9, \\
104- & z_0 + z_1 + 2z_2 \leq -2 , \\
102+ \max_{z_0, z_1, z_2}\ \ & z_0 - z_1 - 4z_2 \\
103+ \mbox{such that}\ \ & -3z_0 + 3z_1 + z_2 \leq 9, \\
104+ & z_0 - z_1 + 2z_2 \leq 10 , \\
105105 & z_0, z_1, z_2 \geq 0.
106106
107107 Solve the latter problem with `linprog_simplex`:
108108
109- >>> c = np.array([1, 1, -4])
110- >>> A = np.array([[-3, - 3, 1], [1, 1, 2]])
109+ >>> c = np.array([1, - 1, -4])
110+ >>> A = np.array([[-3, 3, 1], [1, - 1, 2]])
111111 >>> b = np.array([9, 10])
112112 >>> res = linprog_simplex(c, A_ub=A, b_ub=b)
113113
114114 The optimal value of the original problem:
115115
116- >>> -(res.fun + 12) # -(z_0 + z_1 - 4 (z_2 - 3))
117- -22.0
116+ >>> -(res.fun + 12) # -(z_0 - z_1 - 4 (z_2 - 3))
117+ -21.999999999999996
118118
119119 And the solution found:
120120
121121 >>> res.x[0] - res.x[1], res.x[2] - 3 # (z_0 - z_1, z_2 - 3)
122- (10.0, -3.0)
122+ (np.float64(9.999999999999998), np.float64( -3.0) )
123123
124124"""
125125from collections import namedtuple
@@ -192,7 +192,7 @@ def linprog_simplex(c, A_ub=np.empty((0, 0)), b_ub=np.empty((0,)),
192192 ndarray of shape (k,).
193193
194194 max_iter : int, optional(default=10**6)
195- Maximum number of iteration to perform.
195+ Maximum number of iterations to perform.
196196
197197 piv_options : PivOptions, optional
198198 PivOptions namedtuple to set the following tolerance values:
@@ -204,7 +204,7 @@ def linprog_simplex(c, A_ub=np.empty((0, 0)), b_ub=np.empty((0,)),
204204 Pivot tolerance (default={TOL_PIV}).
205205
206206 tol_ratio_diff : float
207- Tolerance used in the the lexicographic pivoting
207+ Tolerance used in the lexicographic pivoting
208208 (default={TOL_RATIO_DIFF}).
209209
210210 tableau : ndarray(float, ndim=2), optional
0 commit comments