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 objective_constan…
Browse files Browse the repository at this point in the history
…t_term
  • Loading branch information
Matthias Koeppe committed Mar 30, 2016
1 parent f2e52f8 commit ec31ed6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/sage/numerical/interactive_simplex_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -1597,9 +1597,10 @@ def standard_form(self, transformation=False, **kwds):
Domain: Vector space of dimension 2 over Rational Field
Codomain: Vector space of dimension 2 over Rational Field
A more complicated transfromation map::
A more complicated transformation map::
sage: P = InteractiveLPProblem(A, b, c, variable_type=["<=", ""])
sage: P = InteractiveLPProblem(A, b, c, variable_type=["<=", ""],
....: objective_constant_term=42)
sage: PSF, f = P.standard_form(True)
sage: f
Vector space morphism represented by the matrix:
Expand All @@ -1618,6 +1619,10 @@ def standard_form(self, transformation=False, **kwds):
TypeError: given input is not a solution for this problem
sage: P.is_optimal(f(PSF.optimal_solution()))
True
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 ec31ed6

Please sign in to comment.