summaryrefslogtreecommitdiff
path: root/packages/glpk/examples/simplex2.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/glpk/examples/simplex2.hs')
-rw-r--r--packages/glpk/examples/simplex2.hs16
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 @@
1import Numeric.LinearProgramming
2
3prob = Maximize [1,2,3,4]
4
5constr1 = Sparse [ [1#1, 1#2] :<: 10
6 , [1#3, 1#4] :<: 10
7 ]
8
9constr2 = Dense [ [1,1,0,0] :<: 10
10 , [0,0,1,1] :<: 10
11 ]
12
13main = do
14 print $ simplex prob constr1 []
15 print $ simplex prob constr2 []
16