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

Commit e47b608

Browse files
author
Matthias Koeppe
committed
CVXOPTBackend.add_linear_constraints: Add doctest, simplify code
1 parent 183ce25 commit e47b608

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/sage/numerical/backends/cvxopt_backend.pyx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,17 @@ cdef class CVXOPTBackend(GenericBackend):
429429
([], [])
430430
sage: p.row_bounds(4)
431431
(None, 2)
432+
433+
TESTS:
434+
435+
It does not add mysterious new variables::
436+
437+
sage: p.ncols()
438+
5
439+
432440
"""
433441
for i in range(number):
434-
self.add_linear_constraint(zip(range(self.ncols()),[0]*(self.ncols())),
435-
lower_bound, upper_bound,
442+
self.add_linear_constraint([], lower_bound, upper_bound,
436443
name=None if names is None else names[i])
437444

438445
cpdef int solve(self) except -1:

0 commit comments

Comments
 (0)