From ac50e991e7b0c2c00d9ac169a5ddcb06821df172 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Fri, 24 Oct 2014 19:53:56 +1100 Subject: Bugfix: variables in obj but not a constraint caused missing key lookups --- Math/LinProg/LPSolve.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Math/LinProg') diff --git a/Math/LinProg/LPSolve.hs b/Math/LinProg/LPSolve.hs index 83a3f73..beff157 100644 --- a/Math/LinProg/LPSolve.hs +++ b/Math/LinProg/LPSolve.hs @@ -75,7 +75,7 @@ solve (compile -> lp) = do nequals = length (lp ^. equals) allConstr = (lp ^. equals) ++ (lp ^. leqs) - varLUT = M.fromList $ zip (sort $ nub $ concatMap (vars . fst) allConstr) [1..] + varLUT = M.fromList $ zip (sort $ nub $ concatMap (vars . fst) allConstr ++ vars (lp ^. objective)) [1..] with m f = do r <- f m -- cgit v1.2.3