X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FLinearProgramming.py;h=d779dc00aaad47cf1c05a56bf4b7d475b83d4223;hb=70ff65d7dcb896ca5c0c36d39da1e36d8a239b46;hp=88cdd8d8cc9f1bc5e8ece5bd8d5e7351308d9d89;hpb=72e0a1e1729a2c5693c94d7a835b0735f84d13ed;p=dead%2Fcensus-tools.git diff --git a/src/LinearProgramming.py b/src/LinearProgramming.py index 88cdd8d..d779dc0 100644 --- a/src/LinearProgramming.py +++ b/src/LinearProgramming.py @@ -11,7 +11,7 @@ import sys # Add LP_SOLVE_PATH to our path. There is no point to this variable # other than to make the site.addsitedir() line fit within 80 # characters. -LP_SOLVE_PATH = '/../lib/lp_solve' +LP_SOLVE_PATH = '/../../lib/lp_solve' site.addsitedir(os.path.dirname(os.path.abspath(sys.argv[0])) + LP_SOLVE_PATH) from lpsolve55 import * @@ -59,7 +59,7 @@ class LinearProgram(object): """ return self._type - + @type.setter def type(self, type): if type == MINIMIZE: self._type = MINIMIZE @@ -216,6 +216,15 @@ class LinearProgram(object): + def print_tableau(self): + """ + Tell lp_solve to print its simplex tableau. Only works after + a successful call to solve(). + """ + lpsolve('set_outputfile', self._lp, '') + lpsolve('print_tableau', self._lp) + + def __init__(self): """ Initialize the object, setting all of the properties