X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fcensus-tools.git;a=blobdiff_plain;f=src%2FLinearProgramming.py;fp=src%2FLinearProgramming.py;h=2e8477d609fac8869cb41e23e14fcc89c2d7a1c9;hp=ceb2e5fca184f5825720406ef3db6c7a30c6cad4;hb=3235d38d8e7975724fe06b4a68b1604559eedee2;hpb=d9fd0480b7ef6023b97de948c050f975f9e2c91f 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.