@hackage / highs-lp

Linear Programming using HiGHS and comfort-array

Latest0.0

About

Metadata

  • Last updated , by HenningThielemann
  • License BSD-3-Clause
  • Categories Mathematics
  • Maintained by: Henning Thielemann <haskell@henning-thielemann.de>

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 8.6.5

Package Flags

Use the -f option with cabal commands to enable flags

    debug (off by default)

    Enable debug output

Readme

Simple interface to linear programming functions provided by HiGHS 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 fmap (mapSnd Array.toTuple) $ snd $
         LP.solve LP.choose [] [[1.*posIx, (-1).*negIx] ==. 314]
           (LP.Minimize,
            Array.fromTuple (23,42) :: Array PairShape Double)
      of
        Just (absol, (pos, neg)) ->
          printf "absol %f,  pos %f, neg %f\n" absol pos neg
        _ -> fail "HiGHS solver failed"

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