ILOG CPLEX .NET Reference Manual

ILinearIntExpr.AddTerm Method (Int32, IIntVar)

Adds the new term coef * var to a scalar product.

void AddTerm(
   int coef,
   IIntVar var
);

Parameters

coef
The coefficient of the added term.
var
The variable of the added term.

Remarks

No checks are performed to verify that the invoking ILinearIntExpr object does not contain a term with the same variable var. This method can create duplicate terms ... + a_i * x + ... + a_k * x + ... that could be joined to a single term ... + (a_i + a_k) * x + ....

Duplicates do not generate errors but require more memory and more runtime when iterating through the terms of an ILinearIntExpr.

See Also

ILinearIntExpr Interface | ILOG.Concert Namespace | ILinearIntExpr.AddTerm Overload List