aboutsummaryrefslogtreecommitdiff
path: root/Math/LinProg/LPSolve.hs
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2014-10-23 13:47:53 +1100
committerJustin Bedo <cu@cua0.org>2014-10-23 13:49:09 +1100
commit2b2c0bfe78740fe4e228958054729e791e3733dd (patch)
tree1717077486406f76aec71acb2bc4eb6f802a2d9a /Math/LinProg/LPSolve.hs
parent365afb5dca44d1ce19b30921aa9032e41d9c8e06 (diff)
Added documentation.
Diffstat (limited to 'Math/LinProg/LPSolve.hs')
-rw-r--r--Math/LinProg/LPSolve.hs13
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