Originally posted by: enthuTyro
double numberOne, numberTwo;
for(int k=0; k<50000; k++) {
try {
matrix.addRow(cplex.addRange(-Double.MAX_VALUE , cplex.sum(cplex.prod(numberTwo, intergerValue[k]), cplex.negative(binaryValue[k]) ),0, "1st constraint"));
matrix.addRow(cplex.addRange(0 , cplex.sum(cplex.prod(numberOne, intergerValue[k]), cplex.negative(binaryValue[k]) ),Double.MAX_VALUE, "2nd constraint"));
} catch (IloException e) {
e.printStackTrace();
}
}
I am using the IloLPMatrix format for the coding. Both integerValue and binaryValue are of type IloNumVarArray with the first one as positive integer (with upper bound) and second one with lb=0 & ub=1. Above two lines of the program is taking quite high time. Any suggestion for the rephrasing these two lines so that I can pass integerValue and binaryValue as array in one shot. I hope this will save time as there will be no frequent interaction between JAVA and CPLEX.
Thanks in Advance
#CPLEXOptimizers#DecisionOptimization