A user reports:
There is a bug resulting in an error when there are only discrete variables and no continuous ones in the optimization problem.
It is in the Optimizer class, lines 883-892.
for (int i=0; i < dimCon-1; i++)
em += x[iT].getX(i) + ", ";
if (dimDis == 0)
em += x[iT].getX(dimCon-1) + ")." + LS;
else{
em += x[iT].getX(dimCon-1) + "; ";
for (int i=0; i < dimDis-1; i++)
em += x[iT].getIndex(i) + ", ";
em += x[iT].getIndex(dimDis-1) + ")." + LS;
}
I managed to amend it by using the following code in its place
for (int i=0; i < dimCon-1; i++)
em += x[iT].getX(i) + ", ";
for (int i=0; i < dimDis-1; i++)
em += x[iT].getIndex(i) + ", ";
if (dimDis == 0)
em += x[iT].getX(dimCon-1) + ")." + LS;
else if (dimCon == 0){
em += x[iT].getIndex(dimDis-1) + ")." + LS;
}else{
em += x[iT].getX(dimCon-1) + ", " + x[iT].getIndex(dimDis-1) + ")." + LS;
}
This needs to be
[x] checked by adding an example that reproduces the bug, and then
A user reports: There is a bug resulting in an error when there are only discrete variables and no continuous ones in the optimization problem. It is in the Optimizer class, lines 883-892.
I managed to amend it by using the following code in its place
This needs to be