Originally posted by: Maichel_Aguayo
Hello all,
I am trying to inject a new incumbent solution using HEURISTICCALLBACK (I am solving a MIP model in CPLEX/C++). I only have a two-dimensional variable in the model. How can I use setSolution for this case ?
I have reproduced below some part of my code for convenience. I got the following error: no matching function for call to "Non_fixedI::setSolution(Arcs&, FloatMatrix&, IloNum&)"
Thanks,
typedef IloArray<IloIntVarArray> Arcs;
...
ILOHEURISTICCALLBACK1(Non_fixed,Arcs, x) {
FloatMatrix sol; // contains the value of the variables
IloNum objval=new_incumbentObjValue; // contains the objective value of the incumbent solution
...
setSolution(x, sol, objval); //error: no matching function for call to 'Non_fixedI::setSolution(Arcs&, FloatMatrix&, IloNum&)'
}
int main(int argc, char **argv)
{
Arcs x(masterEnv, numNodes);
IloCplex masterCplex(masterMod);
masterCplex.use(Non_fixed(masterEnv, x));
....
}
#CPLEXOptimizers#DecisionOptimization