Originally posted by: mkmk
I am trying to solve a problem which has 13 decision variables.
4 of them are quadratic (x1~x4) and rest of them are linear.
For example,
min x1^2 + x2^2 + x3+ x4
..
In this case, NUMCOLS = 4, and NUMQNZ = 2 and Q matrix is supposed to be
[ 2 0
0 2 ]
How am I supposed to set the Q matrix in this case?
I tried
for(int i = 0; i < NUMCOLS; i++){
if(i < NUMQNZ){
zqmatbeg[i] = i;
zqmatcnt[i] = 1;
}
else{
zqmatbeg[i] = i;
zqmatcnt[i] = 0;
}
}
for(int i = 0; i < NUMQNZ; i++){
zqmatind[i] = i;
zqmatval[i] = (-1)*val;
}
It compiles, but gives me infeasible solution..
Solutio status = 119
CPLEX Error 1217L No Solution Exists.
Could you please please help me overcome this problem?
I really appreciate it!
#CPLEXOptimizers#DecisionOptimization