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

Commit

Permalink
CVXOPTBackend.add_linear_constraints: Remove, inherit from GenericBac…
Browse files Browse the repository at this point in the history
…kend
  • Loading branch information
Matthias Koeppe committed May 24, 2016
1 parent 8b73e2d commit 16ed7e9
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/sage/numerical/backends/cvxopt_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -406,44 +406,6 @@ cdef class CVXOPTBackend(GenericBackend):
self.row_upper_bound.append(upper_bound)
self.row_name_var.append(name)

cpdef add_linear_constraints(self, int number, lower_bound, upper_bound, names=None):
"""
Add constraints.
INPUT:
- ``number`` (integer) -- the number of constraints to add.
- ``lower_bound`` - a lower bound, either a real value or ``None``
- ``upper_bound`` - an upper bound, either a real value or ``None``
- ``names`` - an optional list of names (default: ``None``)
EXAMPLE::
sage: from sage.numerical.backends.generic_backend import get_solver
sage: p = get_solver(solver = "CVXOPT")
sage: p.add_variables(5)
4
sage: p.add_linear_constraints(5, None, 2)
sage: p.row(4)
([], [])
sage: p.row_bounds(4)
(None, 2)
TESTS:
It does not add mysterious new variables::
sage: p.ncols()
5
"""
for i in range(number):
self.add_linear_constraint([], lower_bound, upper_bound,
name=None if names is None else names[i])

cpdef int solve(self) except -1:
"""
Solve the problem.
Expand Down

0 comments on commit 16ed7e9

Please sign in to comment.