Originally posted by: arronlee11
hi~
i define my decision variable y as follow:
y = IloNumVarArray (env,ILOINT);
.....after model and solve .....
if i want to know the size of y,i write as follow:
y.getSize();
if i want to output the value of y,i write as follow :
for(int i=0;i<y.getSize();i++)
{
cout<<modelSolver.getValue(y[i]);
}
now i can't output the value of y;
but if i write as follow:
for(int i=1;i<y.getSize();i++)
{
cout<<modelSolver.getValue(y[i]);
}
now the value of y is output successfully.
i want to know why the Size number i begin at 1,but not 0?
if i want the Size num i begin at 0,how shoulde i do?
#CPLEXOptimizers#DecisionOptimization