ILOG CPLEX .NET Reference Manual

ILinearIntExpr.AddTerms Method (IIntVar[], Int32[], Int32, Int32)

Adds the new terms sum_i(coef[i] * var[i]) to a scalar product.

void AddTerms(
   IIntVar[] var,
   int[] coef,
   int start,
   int num
);

Parameters

var
The variables of the added terms.
coef
The coefficients of the added terms.
start
The first element in coef, var to be added.
num
The number of added terms.

Remarks

No checks are performed to verify that the invoking ILinearIntExpr object does not contain terms 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.AddTerms Overload List