diff options
author | Alberto Ruiz <aruiz@um.es> | 2010-02-21 18:26:23 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2010-02-21 18:26:23 +0000 |
commit | f38b4a3076cfae023559ce61cb2a443c809b7a6f (patch) | |
tree | 022c127181fb65c34705cdcf44221b4ac89ba50b /packages/glpk/examples/simplex2.hs | |
parent | a3d1bb34ae7b1f97b7e9900fc38f145094fe4777 (diff) |
simple glpk interface
Diffstat (limited to 'packages/glpk/examples/simplex2.hs')
-rw-r--r-- | packages/glpk/examples/simplex2.hs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/glpk/examples/simplex2.hs b/packages/glpk/examples/simplex2.hs new file mode 100644 index 0000000..76a53df --- /dev/null +++ b/packages/glpk/examples/simplex2.hs | |||
@@ -0,0 +1,16 @@ | |||
1 | import Numeric.LinearProgramming | ||
2 | |||
3 | prob = Maximize [1,2,3,4] | ||
4 | |||
5 | constr1 = Sparse [ [1#1, 1#2] :<: 10 | ||
6 | , [1#3, 1#4] :<: 10 | ||
7 | ] | ||
8 | |||
9 | constr2 = Dense [ [1,1,0,0] :<: 10 | ||
10 | , [0,0,1,1] :<: 10 | ||
11 | ] | ||
12 | |||
13 | main = do | ||
14 | print $ simplex prob constr1 [] | ||
15 | print $ simplex prob constr2 [] | ||
16 | |||