Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
InteractiveLPProblem.standard_form: Add doctest for minimization with…
Browse files Browse the repository at this point in the history
… objective_constant_term
  • Loading branch information
Matthias Koeppe committed Apr 11, 2016
1 parent 4d7afca commit 78d0e78
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/sage/numerical/interactive_simplex_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,25 @@ def standard_form(self, transformation=False, **kwds):
5042
sage: P.optimal_value()
5042
TESTS:
Above also works for the equivalent minimization problem::
sage: c = (-10, -5)
sage: P = InteractiveLPProblem(A, b, c, variable_type=["<=", ""],
....: objective_constant_term=-42,
....: problem_type="min")
sage: PSF, f = P.standard_form(True)
sage: PSF.optimal_solution()
(0, 1000, 0)
sage: P.optimal_solution()
(0, 1000)
sage: PSF.optimal_value()
-5042
sage: P.optimal_value()
-5042
"""
A, b, c, x = self.Abcx()
f = identity_matrix(self.n()).columns()
Expand Down

0 comments on commit 78d0e78

Please sign in to comment.