addTerms(self,
coeffs=[ ] ,
vars=[ ] ,
values=[ ] )
| source code
|
Adds new terms into left-hand-side of linear constraint.
-
Arguments:
-
coeffs: Coefficients for new terms; either a list of coefficients
or a single coefficient. The three arguments must have the same
size.
-
vars: Variables for new terms; either a list of variables or a
single variable. The three arguments must have the same size.
-
values: Values for new terms; either a list of values or a single
value. The three arguments must have the same size.
-
Example usage:
>>> L.addTerms(1.0, y, "A")
>>> L.addTerms([2, 3, 1], [y, y, z], ["C", "D", "C"])
which adds the left-hand-side 2 X[y,"C"]+3
X[y,"D"]+1 X[z,"C"].
|