You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 30, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: src/sage/numerical/backends/generic_backend.pyx
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -96,12 +96,12 @@ cdef class GenericBackend:
96
96
"""
97
97
raiseNotImplementedError()
98
98
99
-
cpdef int add_variables(self, int n, lower_bound=0, upper_bound=None, binary=False, continuous=True, integer=False, obj=None, names=None) except-1:
99
+
cpdef int add_variables(self, int n, lower_bound=False, upper_bound=None, binary=False, continuous=True, integer=False, obj=None, names=None) except-1:
100
100
"""
101
101
Add ``n`` variables.
102
102
103
103
This amounts to adding new columns to the matrix. By default,
104
-
the variables are both positive and real.
104
+
the variables are both nonnegative and real.
105
105
106
106
INPUT:
107
107
@@ -151,6 +151,10 @@ cdef class GenericBackend:
151
151
"""
152
152
cdef int i
153
153
cdef int value
154
+
if lower_bound isFalse:
155
+
lower_bound =self.zero()
156
+
if obj isNone:
157
+
obj =self.zero()
154
158
for i inrange(n):
155
159
value =self.add_variable(lower_bound= lower_bound,
0 commit comments