Skip to content

Commit

Permalink
Merge pull request #37 from ComboProblem/t/31308/interactive_simplex_…
Browse files Browse the repository at this point in the history
…method__make_it_safe_to_copy_dictionaries

interactive_simplex_method - making copy method safe -  update
  • Loading branch information
Matthias Köppe authored May 8, 2024
2 parents 4a22c7e + 0b8257a commit 4e66ef3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/sage/numerical/interactive_simplex_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -3914,6 +3914,22 @@ def __init__(self, A, b, c, objective_value,
self._AbcvBNz = [A, b, c, objective_value, B, N, SR(objective_name)]

def __copy__(self):
r"""
TESTS::
sage: A = ([1, 1], [3, 1])
sage: b = (1000, 1500)
sage: c = (10, 5)
sage: P = InteractiveLPProblemStandardForm(A, b, c)
sage: D = P.initial_dictionary()
sage: D_2 = copy(D)
sage: D is D_2
False
sage: D.enter('x1')
sage: D.leave('x3')
sage: D.update()
sage: D_2 == D
False
"""
return type(self)(*self._AbcvBNz)

@staticmethod
Expand Down

0 comments on commit 4e66ef3

Please sign in to comment.