-
-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add copy/__copy__ methods to CVXOPT, PPL, InteractiveLP backends, and __deepcopy__ to MixedIntegerLinearProgram and backends #20414
Comments
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:5
The branch is on top of #20323 (Common |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:7
Now also contains a fix for #15159 (see description). |
This comment has been minimized.
This comment has been minimized.
Author: Matthias Koeppe |
comment:10
How reliable is |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
Replying to @dimpase:
It's working. I've added another test to illustrate deepcopy semantics. |
comment:14
Replying to @dimpase:
Before this patch, deepcopy didn't even copy the backend of a MIP. Both copy and deepcopy have weird semantics in relation to the MIPVariables in a problems -- because a MIP does not have an API to gain access to its variables; and trying to use the old MIPVariables with the copy is questionable and definitely broken if one creates new components of this variable, see #15159, #19523. Fixing this would require a redesign; a possible stopgap would be to stop all MIPVariables from creating new components when they have been subjected to copy(). |
comment:15
ok, fine. |
Reviewer: Dima Pasechnik |
Changed branch from u/mkoeppe/add_copy___copy___methods_to_cvxopt__ppl__interactivelp_backends to |
The COIN, CPLEX, GLPK, and Gurobi backends supply a
copy
method.But it's not documented as a backend interface method in
GenericBackend
, and the CVXOPT, PPL, InteractiveLP backends do not implement it.It is used by
MixedIntegerLinearProgram.__copy__
.The backend method should actually probably be called
__copy__
as well -- see https://docs.python.org/2/library/copy.htmlThe branch on the ticket does this.
We also add
__deepcopy__
methods toMixedIntegerLinearProgram
and the backends.This fixes #15159, though the semantics of
copy
anddeepcopy
of aMixedIntegerLinearProgram
remains questionable due to its interaction withMIPVariable
; see #15159 and #19523.See also #20323 (in which copying a backend could be the basis for more diverse tests).
CC: @videlec @vbraun @dimpase
Component: numerical
Author: Matthias Koeppe
Branch/Commit:
3117b01
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/20414
The text was updated successfully, but these errors were encountered: