]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - bin/example-lp
Moved the example linear program and the wrapper in to a separate folder.
[dead/census-tools.git] / bin / example-lp
diff --git a/bin/example-lp b/bin/example-lp
deleted file mode 100755 (executable)
index fe2256f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Solve an example problem with lp_solve.
-"""
-
-import os
-import site
-import sys
-
-# Basically, add '../src' to our path.
-# Needed for the imports that follow.
-site.addsitedir(os.path.dirname(os.path.abspath(sys.argv[0])) + '/../src')
-
-import LinearProgramming
-
-
-lp = LinearProgramming.LinearProgram()
-
-lp.objective_coefficients = [5, 100, 30, 10, 20, 300]
-
-lp.constraint_matrix = [ [1,1,1,0,0,0],
-                         [0,0,0,1,1,1],
-                         [1,0,0,1,0,0],
-                         [0,1,0,0,1,0],
-                         [0,0,1,0,0,1] ]
-
-lp.inequalities = ([LinearProgramming.LE] * 2) + ([LinearProgramming.EQ] * 3)
-
-lp.rhs = [ 500, 600, 400, 300, 200 ]
-
-[v,x,duals] = lp.solve()
-
-print 'Optimal objective function value: ', v
-print 'Optimal solution vector: ', x
-print 'Duals: ', duals