cplex matlab interface
- 1 minutes read - 89 wordsJust for my own reference, I’m documenting the interface to CPLEX.
CPLEX expects a problem in the form ( \begin{split} \min \qquad & g^Td + \frac12 d^TWd\ \text{subject to} \qquad & c_L \leq Ad \leq c_U\ & d_L \leq d \leq d_U \end{split} ) and is called by
cplex = Cplex('test');
cplex.Param.feasopt.tolerance.Cur = 1e-8;
if params.printLevel < 8
cplex.DisplayFunc = [];
end
cplex.Model.sense = 'minimize';
cplex.Param.qpmethod.Cur = 1;
cplex.addCols(gk,[],bl-xk,bu-xk);
cplex.addRows(-ck, A0, -ck);
cplex.Model.Q = W;
cplex.Model.obj = g;
cplex.Model.lb = d_L;
cplex.Model.ub = d_U;
cplex.Model.lhs= c_L;
cplex.Model.rhs= c_U;
cplex.solve();