From fd2ff86a60ec4ab2a759318e66a159ae148e0101 Mon Sep 17 00:00:00 2001 From: iliya <iliya.saroukhanian@etu.hesge.ch> Date: Tue, 2 Apr 2024 19:12:26 +0200 Subject: [PATCH] idk what happened ngl --- src/simplexe.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/simplexe.py b/src/simplexe.py index 698f96a..f1a099f 100644 --- a/src/simplexe.py +++ b/src/simplexe.py @@ -264,7 +264,6 @@ class Simplexe: ################################################################### # returns cheks if the current solution is feasible or not (return True if feasible) - def __isSolutionFeasible(self): # we MUST have that all BASIC variables are >= 0 to have a FEASIBLE solution # to iterate over basic variables do: @@ -341,7 +340,7 @@ class Simplexe: minRatio = ratio leavingRow = index - # print("leaving row :", leavingRow) # vérification ok + print("leaving row :", leavingRow) # vérification ok return leavingRow @@ -393,6 +392,8 @@ class Simplexe: # | c | 0 | 0 | | c | 0 | 0 | 0 | # |-----------| |---------------| # | d |-1 | 0 | S | + print( + f"Shape = {simplexe.__tableau.shape}\t= {simplexe.__tableau}") # d = - sum(coeff in column) and S is the -sum vector b (NOTE: we already made sure all elements in b are non-negative!) # store the fact we are actually using a Phase I - to make sure we don't select a pivot in the "original" objective row! self.IsPhaseI = True @@ -405,11 +406,17 @@ class Simplexe: tmpCopy = simplexe.__tableau.copy() self.__tableau = tmpCopy[0:-1, 0:-1] # add the auxiliary variables and their objective row + print( + f"Shape = {self.__tableau.shape}\tBefore appending = {self.__tableau}") + self.__tableau = np.append( self.__tableau, np.identity(simplexe.NumRows), axis=1) # add the RHS column self.__tableau = np.append( self.__tableau, np.array([tmpCopy[0:-1, -1]]).T, axis=1) + + print( + f"Shape = {self.__tableau.shape}\tAfter appending = {self.__tableau}") # create the tableau for the PhaseI from above initialized arrays!!! raise Exception('Not implemented', 'Simplexe.initPhaseI: missing code to be implemented.') -- GitLab