id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
12823,Allow constants for objective function & deletion of rows in MixedIntegerLinearProgram,john_perry,ncohen,"Currently, MixedIntegerLinearProgram does not allow deleting rows. We would like to enable this for all backends that allow it.
Also, this is a bug.
{{{
sage: lp = MixedIntegerLinearProgram()
sage: x, y = lp[0], lp[1]
sage: lp.add_constraint(2*x + 3*y <= 6)
sage: lp.add_constraint(3*x + 2*y <= 6)
sage: lp.set_objective(x + y + 7)
sage: lp.set_integer(x); lp.set_integer(y)
sage: lp.solve()
2.0
}}}
The correct value ought to be '''9''', not '''2'''. The problem is this line in the `set_objective()` method of `mip.pyx`:
{{{
f.pop(-1,0)
}}}
John Perry will create a patch for GLPK and CBC; Nathann Cohen will create a patch for Gurobi and CPLEX.
'''Apply''':
* [attachment:trac_12823_rolls_all_into_one.patch]",defect,closed,major,sage-5.1,linear programming,fixed,solver objective,ncohen,sage-5.1.beta1,"John Perry, Nathann Cohen","David Coudert, Nathann Cohen",N/A,,,,"#12220, #12736, #12833",