Originally posted by: SystemAdmin
> I have defined a variable xp = IloNumVarArray(env, totNum, 0,
> IloInfinity). My question is: does that define xp as positive? or Is
> there still a need to define a constraint con.add(xp >=0) in the model?
Your declaration looks fine, and fits the following form of a IloNumVarArray declaration:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public IloNumVarArray(const IloEnv env, IloInt n, IloNum lb, IloNum ub, IloNumVar::Type type=ILOFLOAT)
This constructor creates an extensible array of n numeric variables in env with lower and upper bounds and type as specified. The instances of IloNumVar to fill this array are constructed at the same time.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Consequently you need not add the (xp>=0) constraint.
#CPLEXOptimizers#DecisionOptimization