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