ILOG CPLEX .NET Reference Manual

ILinearNumExpr.AddTerms Method (INumVar[], Double[])

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

void AddTerms(
   INumVar[] var,
   double[] coef
);

Parameters

var
The variables of the added terms.
coef
The coefficients of the added terms.

Remarks

The caller must ensure that the variables being added are not yet part of the invoking IloScalProd. If this cannot be asserted, use the method setCoef instead.

No checks are performed to ensure that the invoking ILinearNumExpr 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 ILinearNumExpr.

See Also

ILinearNumExpr Interface | ILOG.Concert Namespace | ILinearNumExpr.AddTerms Overload List