diff options
Diffstat (limited to 'Math/LinProg/LP.hs')
-rw-r--r-- | Math/LinProg/LP.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Math/LinProg/LP.hs b/Math/LinProg/LP.hs index d1a1cf1..513bdad 100644 --- a/Math/LinProg/LP.hs +++ b/Math/LinProg/LP.hs @@ -24,11 +24,12 @@ module Math.LinProg.LP ( ,bins ) where -import Data.List -import Math.LinProg.Types import Control.Lens -import Data.Maybe import Control.Monad.Free +import Data.Hashable +import Data.List +import Data.Maybe +import Math.LinProg.Types type Equation t v = (LinExpr t v, t) -- LHS and RHS @@ -88,7 +89,7 @@ instance (Show t, Num t, Ord t) => Show (CompilerS t String) where render x = (if x >= 0 then "+" else "") ++ show x -findBounds :: (Eq v, Num t, Ord t, Eq t) => [Equation t v] -> ([(t, v, t)], [Equation t v]) +findBounds :: (Hashable v, Eq v, Num t, Ord t, Eq t) => [Equation t v] -> ([(t, v, t)], [Equation t v]) findBounds eqs = (mapMaybe bound singleTerms, eqs \\ filter (isBounded . head . vars . fst) singleTermEqs) where singleTermEqs = filter (\(ts, _) -> length (vars ts) == 1) eqs |