Hello , I have a array of variables Z[10] for example and i want them to be 0 or 1.( boolean) , I have declared it as follows : IloNumVarArray Z(env,M,0,1,ILOINT);
However when i use env.out() to see what are the values of Z .... one or two or them read 1.11022e -016 .... which is zero but why is is getting that number instead of just plain 0 . I have also tried IloNumVarArray Z(env,M,0,1,ILOBOOL); but surprisingly it does the same.
arush wrote: > Hello , > I have a array of variables Z[10] for example and i want them to be 0 > or 1.( boolean) , I have declared it as follows : > IloNumVarArray Z(env,M,0,1,ILOINT);
> However when i use env.out() to see what are the values of Z .... one > or two or them read 1.11022e -016 .... which is zero but why is is > getting that number instead of just plain 0 . I have also tried > IloNumVarArray Z(env,M,0,1,ILOBOOL); but surprisingly it does the > same.
> Any suggestions. > Arush.
It's just rounding error. All variables are double precision during the computations, and a little decimal dust creeps in sometimes.
Arush, It is possible to change values of some default tolerances from their original ones of 1e-4 and 1e-6 to 0. Look at the EPINT parameter for the integer tolerance (default is 1e-5) and try to set it to 0. However, if your problem is large or highly degenerate, it may trigger the numeric instability effect and cause infeasibility. Presolve has its own integer tolerance (I think 1e-8 or 1e-12) that can't be changed. Practically every matrix of a LP/MIP problem has a non-full rank, which means that it's degenerate to a certain degree, but that shouldn't stop you from trying if you really want to see integers.
On Aug 5, 10:01 pm, arush <arushgad...@gmail.com> wrote:
> Hello , > I have a array of variables Z[10] for example and i want them to be 0 > or 1.( boolean) , I have declared it as follows : > IloNumVarArray Z(env,M,0,1,ILOINT);
> However when i use env.out() to see what are the values of Z .... one > or two or them read 1.11022e -016 .... which is zero but why is is > getting that number instead of just plain 0 . I have also tried > IloNumVarArray Z(env,M,0,1,ILOBOOL); but surprisingly it does the > same.
> Any suggestions. > Arush.
Presumably, some of the variables are /exactly/ 0 (or 1) because they have been declared so by branches like "x = 0" or "x = 1" in the B&B search tree. Others may be zero in the LP relaxation, but come out as small positive numbers because of roundoff errors. I have seen other software that can even give small negative numbers, at least in the older versions of a few years ago.