From 3235d38d8e7975724fe06b4a68b1604559eedee2 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 18 Jun 2010 01:44:02 -0400 Subject: [PATCH] Added the objective_function_value() method to the SimplexIteration class. --- src/LinearProgramming.py | 7 +++++++ 1 file changed, 7 insertions(+) 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. -- 2.44.2