limp-cbc 0.2.8.6 → 0.3.0.0
raw patch · 5 files changed
+45/−8 lines, 5 filesdep +limp-cbcdep ~basedep ~limp
Dependencies added: limp-cbc
Dependency ranges changed: base, limp
Files
- examples/Test.hs +19/−0
- limp-cbc.cabal +13/−2
- src/Numeric/Limp/Solvers/Cbc.hs +6/−2
- src/Numeric/Limp/Solvers/Cbc/Error.hs +6/−0
- src/Numeric/Limp/Solvers/Cbc/Solve.hs +1/−4
+ examples/Test.hs view
@@ -0,0 +1,19 @@+module Main where++import Base+import Simple+import Infeasible+import Clustering+import Stupid+++main :: IO ()+main+ = do putStrLn "Simple"+ simple+ putStrLn "Infeasible"+ infeasible+ putStrLn "Clustering"+ clustering+ putStrLn "Stupid"+ stupid
limp-cbc.cabal view
@@ -1,8 +1,9 @@ name: limp-cbc-version: 0.2.8.6+version: 0.3.0.0 synopsis: bindings for integer linear programming solver Coin/CBC description: very simple binding to external solver, CBC. CBC is somewhat faster than GLPK, and also has a more permissive licence.+ relies on coin/cbc version 2.8.6. license: MIT license-file: LICENSE@@ -23,6 +24,7 @@ exposed-modules: Numeric.Limp.Solvers.Cbc Numeric.Limp.Solvers.Cbc.Solve+ Numeric.Limp.Solvers.Cbc.Error Numeric.Limp.Solvers.Cbc.MatrixRepr other-modules: @@ -32,7 +34,7 @@ base < 5, containers == 0.5.*, vector == 0.10.*,- limp+ limp == 0.3.* ghc-options: -Wall -fno-warn-orphans default-language: Haskell2010@@ -44,3 +46,12 @@ Include-dirs: cbits includes: Cbc.h coin/Cbc_C_Interface.h C-sources: cbits/Cbc.cpp++test-suite test+ type: exitcode-stdio-1.0+ hs-source-dirs: examples+ main-is: Test.hs+ build-depends: base, limp, limp-cbc+ default-language: Haskell2010+ default-extensions: TemplateHaskell TypeFamilies FlexibleContexts GeneralizedNewtypeDeriving DataKinds GADTs RankNTypes StandaloneDeriving+
src/Numeric/Limp/Solvers/Cbc.hs view
@@ -1,11 +1,15 @@-module Numeric.Limp.Solvers.Cbc where+module Numeric.Limp.Solvers.Cbc+ ( Error(..)+ , solve+ ) where import qualified Numeric.Limp.Canon as C import Numeric.Limp.Program import Numeric.Limp.Rep import qualified Numeric.Limp.Solvers.Cbc.Solve as S+import Numeric.Limp.Solvers.Cbc.Error -solve :: (Ord z, Ord r) => Program z r IntDouble -> Either S.Error (Assignment z r IntDouble)+solve :: (Ord z, Ord r) => Program z r IntDouble -> Either Error (Assignment z r IntDouble) solve p = let pc = C.program p in S.solve pc
+ src/Numeric/Limp/Solvers/Cbc/Error.hs view
@@ -0,0 +1,6 @@+module Numeric.Limp.Solvers.Cbc.Error where++data Error+ = Infeasible+ deriving Show+
src/Numeric/Limp/Solvers/Cbc/Solve.hs view
@@ -2,16 +2,13 @@ import Numeric.Limp.Canon import Numeric.Limp.Rep +import Numeric.Limp.Solvers.Cbc.Error import Numeric.Limp.Solvers.Cbc.MatrixRepr import qualified Data.Vector.Storable as V import Numeric.Limp.Solvers.Cbc.Internal.Wrapper import System.IO.Unsafe--data Error- = Infeasible- deriving Show solve :: (Ord z, Ord r) => Program z r IntDouble -> Either Error (Assignment z r IntDouble) solve p