diff options
author | Justin Bedo <cu@cua0.org> | 2014-10-24 19:53:56 +1100 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2014-10-24 19:53:56 +1100 |
commit | ac50e991e7b0c2c00d9ac169a5ddcb06821df172 (patch) | |
tree | 01831c21b82ea0c1e21f5a2772dc18da21dd4b97 | |
parent | 2b2c0bfe78740fe4e228958054729e791e3733dd (diff) |
Bugfix: variables in obj but not a constraint caused missing key lookups
-rw-r--r-- | Math/LinProg/LPSolve.hs | 2 |
1 files changed, 1 insertions, 1 deletions
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 |