diff options
author | Justin Bedo <cu@cua0.org> | 2014-10-23 13:47:53 +1100 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2014-10-23 13:49:09 +1100 |
commit | 2b2c0bfe78740fe4e228958054729e791e3733dd (patch) | |
tree | 1717077486406f76aec71acb2bc4eb6f802a2d9a /Math/LinProg/LPSolve.hs | |
parent | 365afb5dca44d1ce19b30921aa9032e41d9c8e06 (diff) |
Added documentation.
Diffstat (limited to 'Math/LinProg/LPSolve.hs')
-rw-r--r-- | Math/LinProg/LPSolve.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Math/LinProg/LPSolve.hs b/Math/LinProg/LPSolve.hs index 7b1f8ca..83a3f73 100644 --- a/Math/LinProg/LPSolve.hs +++ b/Math/LinProg/LPSolve.hs @@ -1,5 +1,17 @@ {-# LANGUAGE ViewPatterns #-} +{-| +Module : Math.LinProg.LPSolve +Description : Binding for solving LPs with lp_solve library. +Copyright : (c) Justin Bedő, 2014 +License : BSD +Maintainer : cu@cua0.org +Stability : experimental +This module allows finding the solution to an LP using the lp_solve library. +The LP is specified using the monad and expressions in Math.LinProg.Types. +Note that the objective is minimised by default, so negation is needed to +maximise instead. +-} module Math.LinProg.LPSolve ( solve ,ResultCode(..) @@ -16,6 +28,7 @@ import Math.LinProg.Types import qualified Data.Map as M import Prelude hiding (EQ) +-- | Solves an LP using lp_solve. solve :: (Eq v, Ord v) => LinProg Double v () -> IO (Either (Maybe ResultCode) [(v, Double)]) solve (compile -> lp) = do model <- makeLP nconstr nvars |