comfort-glpk: Linear Programming using GLPK and comfort-array
Simple interface to linear programming functions provided by GLPK
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 "GLPK solver failed"Alternatives: hmatrix-glpk, glpk-hs
Downloads
- comfort-glpk-0.0.0.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.0, 0.0.0.1, 0.0.1, 0.1 (info) |
|---|---|
| Dependencies | base (>=4.5 && <5), comfort-array (>=0.4 && <0.6), deepseq (>=1.3 && <1.5), glpk-headers (>=0.4.1 && <0.6), non-empty (>=0.3.2 && <0.4), utility-ht (>=0.0.16 && <0.1) [details] |
| Tested with | ghc ==8.6.5 |
| License | BSD-3-Clause |
| Author | Henning Thielemann <haskell@henning-thielemann.de> |
| Maintainer | Henning Thielemann <haskell@henning-thielemann.de> |
| Uploaded | by HenningThielemann at 2023-03-01T16:35:03Z |
| Category | Math |
| Source repo | this: darcs get https://hub.darcs.net/thielema/comfort-glpk/ --tag 0.0.0.1 head: darcs get https://hub.darcs.net/thielema/comfort-glpk/ |
| Distributions | LTSHaskell:0.1, NixOS:0.1, Stackage:0.1 |
| Downloads | 438 total (4 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs uploaded by user [build log] All reported builds failed as of 2023-03-01 [all 1 reports] |