Opened 4 years ago

Last modified 4 years ago

#20331 new enhancement

MIPVariable misreports its dimension (always 1) — at Initial Version

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-7.2
Component: numerical Keywords: lp
Cc: dimpase, vdelecroix, jdemeyer Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:


sage: p = MixedIntegerLinearProgram(solver="glpk")
sage: bar = p.new_variable(name="bar")
sage: bar
MIPVariable of dimension 1
sage: bar[0]
sage: bar
MIPVariable of dimension 1
sage: bar[1]
sage: bar
MIPVariable of dimension 1
sage: p.solve()
sage: bar.values()
[x_0, x_1]
sage: p.get
p.get_backend                 p.get_min                     p.get_relative_objective_gap  
p.get_max                     p.get_objective_value         p.get_values                  
sage: p.get_values(bar)
{0: 0.0, 1: 0.0}

I think the print method should also print some useful information, such as the name of the variable.

Change History (0)

Note: See TracTickets for help on using tickets.