Originally posted by: Dunc
Hi
I am learning Cplex and I have two problems with division. I want to create an expression for doing a simple division like
IloModel model(env);
IloIntVar x(env, 7, 9, "x");
IloExpr sss(env);
sss=x/10000000;
model.add(IloMaximize(env, sss));
(skip)
cplex.solve();
std::cout<<"result cplex.getObjValue() "<<cplex.getObjValue()<<" and x is "<<cplex.getValue(x)<<std::endl;
The result is "result cplex.getObjValue() 7e-07 and x is 7". However I was expecting x to be 9, because I wanted to find the x value maximizing the objective. Why?
The second question is that if I change "sss=x/10000000; " to "sss=10000000/x;", Cplex is crashing with the exception: "Concert exception caught: IloAlgorithm 0x5605be684a10 cannot change extractables 0 and 42263065" . Why? How can I solve it?
#CPLEXOptimizers#DecisionOptimization