Opened 3 years ago

Last modified 3 years ago

#20657 new defect

More fixes for copying a MIP and the MIPVariables created by new_variable

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

Description

This is a follow-up on #20461.

  • a new MixedIntegerLinearProgram.copy method that takes a names keyword argument, enabling this operation:
    sage: p.<x,y> = MixedIntegerLinearProgram()
    sage: q.<newx,newy> = p.copy()
    
    and the less magical syntax
    sage: q, newx, newy = p.copy([x, y])
    
  • if MixedIntegerLinearProgram.new_variable has been called, it should set a flag and then if __copy__ (or __deepcopy__) are called, it should display a warning (deprecation??) and refer the user to the new copy method.

Change History (2)

comment:1 Changed 3 years ago by mkoeppe

  • Cc nbruin added

comment:2 Changed 3 years ago by mkoeppe

  • Dependencies set to #20602
Note: See TracTickets for help on using tickets.