Originally posted by: FANS_Nader_Al_Theeb
Hi, dear all
I spend a long time in trying to solve a problem in cplex and I have just one error and I can't fix it, could you please help me
1- Define the variable array as following
typedef IloArray<IloNumVarArray> IloNumVarArrayArray;
typedef IloArray<IloNumVarArrayArray> IloNumVarArrayArrayArray;
typedef IloArray<IloNumVarArrayArrayArray> IloNumVarArrayArrayArrayArray;
typedef IloArray<IloNumVarArrayArrayArrayArray>IloNumVarArrayArrayArrayArrayArray;
IloNumVarArrayArrayArrayArray DEV_hot(env,nbWoundedCat);
for(int h = 0; h <= nbWoundedCat; h++)
{
DEV_hot[h] = IloNumVarArrayArrayArray (env, nbDNodes);
for(int o=0; o<= nbDNodes; o++)
{
DEV_hot[h][o] = IloNumVarArrayArray (env, nbTimes);
for(int t = 0; t <= nbTimes; t++)
DEV_hot[h][o][t] = IloNumVarArray(env, nbTimes, 0.0, IloInfinity);
}
}
2- using expression as following:
IloExpr costSum(env);
for (int h=0; h<nbWoundedCat; h++){
for(int o=0; o<nbDNodes; o++){
for (int t=0; t<curr_t; t++){
costSum = 2 * costSum + DEV_hot[h][o][t] - 110; }}}
model.add(IloMinimize(env, costSum ));
costSum.end();
3- the error I received is
error: no match for ‘operator+’ in ‘operator*(IloNum, IloNumExprArg)(IloNumExprArg(((const IloNumExprArg&)((const IloNumExprArg*)(& costSum.IloExpr::<anonymous>.IloNumExpr::<anonymous>))))) + ((IloArray<IloNumVarArray>*)((IloArray<IloArray<IloNumVarArray> >*)DEV_hot.IloArray<X>::operator[]
with X = IloArray<IloArray<IloNumVarArray> >](((long int)h)))->IloArray<X>::operator[ with X = IloArray<IloNumVarArray>](((long int)o)))->IloArray<X>::operator[ with X = IloNumVarArray(((long int)t))’
Thanks
#CPLEXOptimizers#DecisionOptimization