This commit is contained in:
imengus 2023-08-15 13:28:03 +01:00
parent 3e3955530d
commit da21cb4832

View File

@ -37,7 +37,9 @@ class Tableau:
""" """
# Max iteration number to prevent cycling # Max iteration number to prevent cycling
maxiter = 100 maxiter = 100
def __init__(self, tableau: np.ndarray, n_vars: int, n_artificial_vars: int) -> None: def __init__(
self, tableau: np.ndarray, n_vars: int, n_artificial_vars: int
) -> None:
if tableau.dtype != 'float64': if tableau.dtype != 'float64':
raise TypeError('Tableau must have type float64') raise TypeError('Tableau must have type float64')
@ -233,7 +235,7 @@ class Tableau:
... [0, 0, 0.25, 0.25, 2], ... [0, 0, 0.25, 0.25, 2],
... [0, 1, 0.375, -0.125, 1], ... [0, 1, 0.375, -0.125, 1],
... [1, 0, -0.125, 0.375, 1] ... [1, 0, -0.125, 0.375, 1]
... ]), 2, 0).run_simplex() ... ]), 2, 0).run_simplex()
{'P': 2.0, 'x1': 1.0, 'x2': 1.0} {'P': 2.0, 'x1': 1.0, 'x2': 1.0}
# Non-standard: >= constraints # Non-standard: >= constraints