Opened 4 years ago

Last modified 3 years ago

## #20462 closed defect

# MixedIntegerLinearProgram/MIPVariable: get_min, set_min, get_max, set_max are broken — at Version 1

Reported by: | mkoeppe | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-7.3 |

Component: | numerical | Keywords: | lp |

Cc: | dimpase, vdelecroix, jdemeyer, chapoton, nbruin | Merged in: | |

Authors: | Reviewers: | ||

Report Upstream: | N/A | Work issues: | |

Branch: | Commit: | ||

Dependencies: | Stopgaps: |

### Description (last modified by )

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.

Oh, and why does a `MIPVariable`

only have `set_max`

, but no `get_max`

?
And why all of that bizarre delegating to `MIPVariable`

when other `MixedIntegerLinearProgram`

methods such as `set_integer`

etc. just do everything directly, and no corresponding `MIPVariable`

methods exist?

I guess this is also a great moment to mention that these things should properly be referred to as `lower_bound`

and `upper_bound`

rather than `min`

and `max`

. Some deprecation fun to be had.

And why is there no way to query the values of the components of the `_default_mipvariable`

?

**Note:**See TracTickets for help on using tickets.