2 Classes to create, solve, and make dinner for linear programs. Handles
3 integration with lp_solve.
10 # Add LP_SOLVE_PATH to our path. There is no point to this variable
11 # other than to make the site.addsitedir() line fit within 80
13 LP_SOLVE_PATH
= '/../lib/lp_solve'
14 site
.addsitedir(os
.path
.dirname(os
.path
.abspath(sys
.argv
[0])) + LP_SOLVE_PATH
)
16 from lp_solve
import *
21 class LinearProgram(object):
23 Represents an instance of an lp_solve linear program.
27 self
.objective_function_coefficients
= []
28 self
.constraint_matrix
= []
30 self
.inequalities
= []
34 [v
,x
,duals
] = lp_solve(self
.objective_function_coefficients
,
35 self
.constraint_matrix
,