diff --git a/src/simplexe.py b/src/simplexe.py index 698f96a604f2476422a6b45125cb3d867547800c..f1a099f5be9376fdec338b4e5dbefb18a4f7790d 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.')