diff options
| author | Justin Bedo <cu@cua0.org> | 2014-11-01 10:18:31 +1100 | 
|---|---|---|
| committer | Justin Bedo <cu@cua0.org> | 2014-11-01 10:18:31 +1100 | 
| commit | aeafc1692afa5952f3d06195916bb38463c1674c (patch) | |
| tree | 8d0c0a3ddad35f4f5b85f4e53709e0cb8ba15385 /Math/LinProg/LP.hs | |
| parent | 946d8bcd81c1ea580032cd9f8140aad223b3156f (diff) | |
Benchmarking & optimisations
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  | 
