sasoptpy.Constraint.update_var_coef

Constraint.update_var_coef(self, var, value)[source]

Updates the coefficient of a variable inside the constraint

Parameters
varVariable

Variable to be updated

valuefloat

Coefficient of the variable in the constraint

See also

sasoptpy.Model.set_coef()

Examples

>>> c1 = so.Constraint(exp=3 * x - 5 * y <= 10, name='c1')
>>> print(repr(c1))
sasoptpy.Constraint( -  5.0 * y  +  3.0 * x  <=  10, name='c1')
>>> c1.update_var_coef(x, -1)
>>> print(repr(c1))
sasoptpy.Constraint( -  5.0 * y  -  x  <=  10, name='c1')