From: Michael Orlitzky Date: Fri, 18 Jun 2010 05:44:02 +0000 (-0400) Subject: Added the objective_function_value() method to the SimplexIteration class. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=3235d38d8e7975724fe06b4a68b1604559eedee2;p=dead%2Fcensus-tools.git Added the objective_function_value() method to the SimplexIteration class. --- diff --git a/src/LinearProgramming.py b/src/LinearProgramming.py index ceb2e5f..2e8477d 100644 --- a/src/LinearProgramming.py +++ b/src/LinearProgramming.py @@ -461,6 +461,13 @@ class SimplexIteration(object): bm = delete(bm, idxs, axis=1) return bm.tolist() + + def objective_function_value(self): + c = array(self.objective_coefficients) + sv = array(self.solution_vector) + return dot(sv, c) + + def reduced_cost(self, idx): # Find the reduced cost ofthe variable whose column has index # idx.