diff options
Diffstat (limited to 'packages/glpk/examples/simplex2.hs')
-rw-r--r-- | packages/glpk/examples/simplex2.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/glpk/examples/simplex2.hs b/packages/glpk/examples/simplex2.hs index 76a53df..40e4bbd 100644 --- a/packages/glpk/examples/simplex2.hs +++ b/packages/glpk/examples/simplex2.hs | |||
@@ -1,6 +1,6 @@ | |||
1 | import Numeric.LinearProgramming | 1 | import Numeric.LinearProgramming |
2 | 2 | ||
3 | prob = Maximize [1,2,3,4] | 3 | prob = Maximize [4, 3, -2, 7] |
4 | 4 | ||
5 | constr1 = Sparse [ [1#1, 1#2] :<: 10 | 5 | constr1 = Sparse [ [1#1, 1#2] :<: 10 |
6 | , [1#3, 1#4] :<: 10 | 6 | , [1#3, 1#4] :<: 10 |
@@ -12,5 +12,6 @@ constr2 = Dense [ [1,1,0,0] :<: 10 | |||
12 | 12 | ||
13 | main = do | 13 | main = do |
14 | print $ simplex prob constr1 [] | 14 | print $ simplex prob constr1 [] |
15 | print $ simplex prob constr2 [] | 15 | print $ simplex prob constr2 [ 2 :>: 1, 4 :&: (2,7)] |
16 | print $ simplex prob constr2 [ Free 3 ] | ||
16 | 17 | ||