jyp / glpk-hs

Haskell bindings to glpk
Other
13 stars 18 forks source link

MsgOff doesn't disable all messages #3

Closed mingyuguo closed 7 years ago

mingyuguo commented 7 years ago

Even if I use MsgOff, I still get the following messages a lot:

Constructing initial basis... Size of triangular part is 1

BTW, how do I add constant to my linear functions? Say, I want 3x+4. My approach now is to define a variable "One", and then in the constraint set it to be 1. The expression is then 3 & X + 4 & One

(Thanks for this package! Enjoyed it a lot.)

jyp commented 7 years ago

Yes, glpk is a chatty library and I never found out how to shut is completely.

As for constants: you can use the LinExpr constructor directly:

LinExpr (LinFunc v c) c

Its second argument is a constant.

mingyuguo commented 7 years ago

Hi, I just found this package, which is useful for disabling output. https://hackage.haskell.org/package/silently