Opened 3 years ago

Closed 3 years ago

#20462 closed defect (fixed)

MixedIntegerLinearProgram/MIPVariable: set_min, set_max are broken

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-7.3
Component: numerical Keywords: lp
Cc: dimpase, vdelecroix, jdemeyer, chapoton, nbruin Merged in:
Authors: Matthias Koeppe Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: 3a8b10d (Commits) Commit: 3a8b10d356e77aa26fac3212fc869736db528540
Dependencies: Stopgaps:

Description (last modified by mkoeppe)

Here's a bug:

sage: p.<x,y> = MixedIntegerLinearProgram()
sage: x[0], y[0]
(x_0, x_1)
sage: p.set_max(x, 42)
sage: p.get_max(y[0])
42.0

The bug is in MIPVariable.set_min, .set_max, which calls back into the problem to change the bounds of *all* variables of the problem rather than just its components.

Change History (10)

comment:1 Changed 3 years ago by mkoeppe

  • Description modified (diff)

comment:2 Changed 3 years ago by mkoeppe

  • Cc jdemeyer added

comment:3 Changed 3 years ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Description modified (diff)

comment:4 Changed 3 years ago by mkoeppe

  • Summary changed from MixedIntegerLinearProgram/MIPVariable: get_min, set_min, get_max, set_max are broken to MixedIntegerLinearProgram/MIPVariable: set_min, set_max are broken

comment:5 Changed 3 years ago by mkoeppe

  • Branch set to u/mkoeppe/mixedintegerlinearprogram_mipvariable__get_min__set_min__get_max__set_max_are_broken

comment:6 Changed 3 years ago by mkoeppe

  • Commit set to 3a8b10d356e77aa26fac3212fc869736db528540
  • Status changed from new to needs_review

New commits:

3a8b10dFix #20462 - MIPVariable.set_min, set_max

comment:7 Changed 3 years ago by mkoeppe

  • Cc chapoton nbruin added

comment:8 Changed 3 years ago by tscrim

  • Milestone changed from sage-7.2 to sage-7.3
  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

LGTM.

comment:9 Changed 3 years ago by mkoeppe

Thanks!

comment:10 Changed 3 years ago by vbraun

  • Branch changed from u/mkoeppe/mixedintegerlinearprogram_mipvariable__get_min__set_min__get_max__set_max_are_broken to 3a8b10d356e77aa26fac3212fc869736db528540
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.