coinor-clp

Linear Programming using COIN-OR/CLP and comfort-array

Version on this page:0.0
LTS Haskell 22.36:0.0.0.2
Stackage Nightly 2024-10-05:0.0.0.2
Latest on Hackage:0.0.0.2

See all snapshots coinor-clp appears in

BSD-3-Clause licensed and maintained by Henning Thielemann
This version can be pinned in stack with:coinor-clp-0.0@sha256:9fe50dd52b00001354de13942e099c990a98a306e754fd0032733a29288083d7,2968

Module documentation for 0.0

Simple interface to linear programming functions provided by COIN-OR using the flexible Array shape framework from comfort-array.

E.g. you can use Shape.Tuple to convert safely between nested tuples and arrays with the same number of elements.

type X = Shape.Element
type PairShape = Shape.NestedTuple Shape.TupleIndex (X,X)

case Shape.indexTupleFromShape (Shape.static :: PairShape) of
  (posIx,negIx) ->
    case mapSnd (mapSnd Array.toTuple) <$>
         LP.simplex [] [[1.*posIx, (-1).*negIx] ==. 314]
           (LP.Minimize,
            Array.fromTuple (23,42) :: Array PairShape Double)
      of
        (Right (LP.Optimal, (absol, (pos, neg)))) ->
          printf "absol %f,  pos %f, neg %f\n" absol pos neg
        _ -> fail "COINOR solver failed"

Alternatives: comfort-glpk, hmatrix-glpk, glpk-hs