]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Added a setter for the type property.
authorMichael Orlitzky <michael@orlitzky.com>
Sat, 12 Jun 2010 16:47:44 +0000 (12:47 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sat, 12 Jun 2010 16:47:44 +0000 (12:47 -0400)
Added a print_tableau method.

src/LinearProgramming.py

index 2e949d252bd65e18e175a9068d73c9cbc97a32e1..d779dc00aaad47cf1c05a56bf4b7d475b83d4223 100644 (file)
@@ -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