Originally posted by: samuel269
Hello,
I am solving binary linear problems with cplex 12.5.1.0. However, my input files (.mps) correspond to LPs, and I add the binary contraints "by hand" to my model. Moreover, I want to provide a feasible initial solution (mipstart).
When I do so, I keep on having the following error : Concert exception caught: CPLEX Error 3003: Not a mixed-integer problem.
Thanks in advance for your help!
Samuel
There is a short overview of the kind of code it is :
IloEnv env;
IloModel model(env);
IloCplex cplex(env);
IloObjective obj;
IloNumVarArray var(env);
IloRangeArray rng(env);
cplex.importModel(model, inputFile, obj, var, rng);
[... some other code ...]
// Here, I change the variables to booleans (n is known)
for(int j=0; j<n; j++){
model.add(IloConversion(env,var[j],ILOBOOL));
}
// Here, I have a routine that gives me the
IloNumVarArray startVar = [*some routine to get the set of variables that take value 1 in the initial solution*]
IloNumArray startVal(env);
for (int j = 0; j < startVar.getSize(); ++j) {
startVal.add(1);
}
cplex.addMIPStart(startVar, startVal);
cplex.extract(model);
cplex.solve()
#CPLEXOptimizers#DecisionOptimization