Originally posted by: lluvia
Hi, I'm new with CPLEX.
I want to assign the values in an Array Cost to IloNumArray FoodCost.
But the first element of FoodCost is always 0. The first element in Cost is assigned to the second place in FoodCost and the last one in Cost is missing.
Here is my code:
IloNumArray FoodCost (env, ILOINT);
IloNumArray2 CplPenalty (env);
for (i=0; i<30; ++i)
{
FoodCost.add(cost[i]);
cout<<"FoodCost["<<i<<"]"<<"= "<<FoodCost[i]<<endl;
}
for (i=0; i<30; ++i)
{
cout<<"cost["<<i<<"]"<<"= "<<cost[i]<<endl;
}
Could you please me help with these problem? I also have the problem on how to add values to IloNumArray2 CplPenalty from a 2-D array in C++.
Thank you very much.
Jacinda
#CPLEXOptimizers#DecisionOptimization