vendredi 27 février 2015

How to add multi dimensional IloRangeArray to the model on CPLEX


I'm a beginner in CPLEx and using it to wite my mathematical model. I defined and built a three dimensional IloRangeArray as my constraint as follows:



typedef IloArray<IloRangeArray> TwoDimRange;
con = IloArray <IloArray <IloRangeArray> > (env, n);
for ()
{
con [h] = IloArray <IloRangeArray> (env, nbRow);
for ()
{
con[h][m] = IloRangeArray (env);
for ()
{
IloExpr tempExp(env);
if ()
con [h][m].add(0 <= tempExp <= 0);
}
}
}


When I want to add "con" to the model (model.add(con);), I have the following error:


error C2664: 'IloExtractable IloModel::add(const IloExtractable) const' : cannot convert parameter 1 from 'ThreeDimRange' to 'const IloExtractable'


It is the same for 2 dim IloArrangeArray. What is your opinion?


Thanks




Aucun commentaire:

Enregistrer un commentaire