Îõ³h&&       Custom types(c) Junaid Rasheed, 2020-2022BSD-3jrasheed178@gmail.com experimental Safe-InferredTsimplex-methodÖType representing equations. Each pair in the list is one equation. The first item of the pair is the basic variable, and is on the LHS of the equation with a coefficient of one. The RHS is represented using a  2. The integer variable -1 is used to represent a   on the RHSsimplex-methodA Ý of equations. Each pair in the list is a row. The first item in the pair specifies which !Ö variable is basic in the equation. The second item in the pair is an equation. The  æ in the second equation is a list of variables with their coefficients. The RHS of the equation is a   constant.simplex-method-Create an objective function. We can either  imize or imize a  .simplex-method6For specifying constraints in a system. The LHS is a  , and the RHS, is a  ù number. LEQ [(1, 2), (2, 1)] 3.5 is equivalent to 2x1 + x2 <= 3.5. Users must only provide positive integer variables.ØExample: LEQ [(2, 3), (6, (-1), (2, 1))] 12.3 is equivalent to 3x2 + (-x6) + x2 <= 12.3. simplex-methodList of ! variables with their   coefficients. There is an implicit addition between elements in this list. Users must only provide positive integer variables.ÉExample: [(2, 3), (6, (-1), (2, 1))] is equivalent to 3x2 + (-x6) + x2.  Prettifier for Linear.Simplex.Types types(c) Junaid Rasheed, 2020-2022BSD-3jrasheed178@gmail.com experimental Safe-InferredËsimplex-method Convert a   into a human-readable "simplex-method Convert a  into a human-readable "simplex-method Convert an  into a human-readable "Helper functions(c) Junaid Rasheed, 2020-2022BSD-3jrasheed178@gmail.com experimental Safe-Inferredâû simplex-method Is the given  to be imized?simplex-methodExtract the objective (  ) from an simplex-methodSimplifies a system of s by first calling , then reducing  and ; with same LHS and RHS (and other similar situations) into 1, and finally removing duplicate elements using #.simplex-method Simplify an  by first $ing and then calling  on the  .simplex-method Simplify a  by first $ing and then calling  on the  . simplex-methodAdd a sorted list of  (s, folding where the variables are equalsimplex-method Get a map of the value of every ! variable in a simplex-method Get a map of the value of every ! variable in a simplex-methodMap the given ! variable to the given , for entering into .simplex-method Converts a  to ç. We do this by isolating the basic variable on the LHS, ending up with all non basic variables and a  Ç constant on the RHS. (-1) is used to represent the rational constant.simplex-method Converts a  to a ù. This is done by moving all non-basic variables from the right to the left. The rational constant (represented by the !Û variable -1) stays on the right. The basic variables will have a coefficient of 1 in the .simplex-methodIf this function is given % , return %. Otherwise, we & the !Š given in the first item of the pair in the map given in the second item of the pair. This is typically used to extract the value of the  after calling .  %Implements the twoPhaseSimplex method(c) Junaid Rasheed, 2020-2022BSD-3jrasheed178@gmail.com experimental Safe-InferredÓâìsimplex-method1Find a feasible solution for the given system of Ås by performing the first phase of the two-phase simplex method All ! variables in the 8 must be positive. If the system is infeasible, return %+ Otherwise, return the feasible system in ß as well as a list of slack variables, a list artificial variables, and the objective variable.simplex-methodíOptimize a feasible system by performing the second phase of the two-phase simplex method. We first pass an  . Then, the feasible system in Ž as well as a list of slack variables, a list artificial variables, and the objective variable. Returns a pair with the first item being the ! variable equal to the 7 and the second item being a map of the values of all !2 variables appearing in the system, including the .simplex-method2Perform the two phase simplex method with a given  a system of s. Assumes the  and > is not empty. Returns a pair with the first item being the ! variable equal to the 7 and the second item being a map of the values of all !2 variables appearing in the system, including the .'simplex-methodâPerform the simplex pivot algorithm on a system with basic vars, assume that the first row is the . Safe-Inferred()*+,-./0      !"#$%&'()*+&,-&./&.0&12&3456789:;<=>simplex-method-0.1.0.0-inplaceLinear.Simplex.TypesLinear.Simplex.PrettifyLinear.Simplex.UtilLinear.Simplex.SimplextwoPhaseSimplexPaths_simplex_methodDictionaryFormTableauObjectiveFunctionMaxMinPolyConstraintLEQGEQEQ VarConstMap$fShowObjectiveFunction$fEqObjectiveFunction$fShowPolyConstraint$fEqPolyConstraintprettyShowVarConstMapprettyShowPolyConstraintprettyShowObjectiveFunctionisMax getObjectivesimplifySystemsimplifyObjectiveFunctionsimplifyPolyConstraintfoldSumVarConstMapdisplayTableauResultsdisplayDictionaryResultscreateObjectiveDicttableauInDictionaryFormdictionaryFormToTableauextractObjectiveValuefindFeasibleSolutionoptimizeFeasibleSystembaseGHC.RealRational ghc-bignumGHC.Num.IntegerIntegerGHC.BaseString Data.OldListnubsort GHC.MaybeNothingGHC.Listlookup simplexPivotversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDir