simplex-method-0.2.0.0: Implementation of the two-phase simplex method in exact rational arithmetic
Copyright(c) Junaid Rasheed 2020-2023
LicenseBSD-3
Maintainerjrasheed178@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Linear.Simplex.Util

Description

Helper functions for performing the two-phase simplex method.

Synopsis

Documentation

isMax :: ObjectiveFunction -> Bool Source #

Is the given ObjectiveFunction to be Maximized?

simplifySystem :: [PolyConstraint] -> [PolyConstraint] Source #

Simplifies a system of PolyConstraints by first calling simplifyPolyConstraint, then reducing LEQ and GEQ with same LHS and RHS (and other similar situations) into EQ, and finally removing duplicate elements using nub.

dictionaryFormToTableau :: Dict -> Tableau Source #

Converts a Dict to a Tableau using dictEntryToTableauEntry. FIXME: maybe remove this line. The basic variables will have a coefficient of 1 in the Tableau.

tableauInDictionaryForm :: Tableau -> Dict Source #

Converts a Tableau to a Dict. We do this by isolating the basic variable on the LHS, ending up with all non basic variables and a SimplexNum constant on the RHS.

extractObjectiveValue :: Maybe Result -> Maybe SimplexNum Source #

If this function is given Nothing, return Nothing. Otherwise, we lookup the Integer 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 ObjectiveFunction after calling twoPhaseSimplex.

combineVarLitMapSums :: VarLitMapSum -> VarLitMapSum -> VarLitMapSum Source #

Combines two 'VarLitMapSums together by summing values with matching keys

showT :: Show a => a -> Text Source #

logMsg :: (MonadIO m, MonadLogger m) => LogLevel -> Text -> m () Source #